mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
fix: correct OVMS API URL path formation (#11701)
* Initial plan * fix: correct OVMS API URL path from '../v1/config' to 'config' Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com> * fix: update OVMSClient to use formatted API URL for model listing --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com> Co-authored-by: suyao <sy20010504@gmail.com>
This commit is contained in:
parent
ea36b918f1
commit
968210faa7
@ -3,6 +3,7 @@ import { loggerService } from '@logger'
|
||||
import { isSupportedModel } from '@renderer/config/models'
|
||||
import type { Provider } from '@renderer/types'
|
||||
import { objectKeys } from '@renderer/types'
|
||||
import { formatApiHost, withoutTrailingApiVersion } from '@renderer/utils'
|
||||
|
||||
import { OpenAIAPIClient } from '../openai/OpenAIApiClient'
|
||||
|
||||
@ -16,11 +17,8 @@ export class OVMSClient extends OpenAIAPIClient {
|
||||
override async listModels(): Promise<OpenAI.Models.Model[]> {
|
||||
try {
|
||||
const sdk = await this.getSdkInstance()
|
||||
|
||||
const chatModelsResponse = await sdk.request({
|
||||
method: 'get',
|
||||
path: '../v1/config'
|
||||
})
|
||||
const url = formatApiHost(withoutTrailingApiVersion(this.getBaseURL()), true, 'v1')
|
||||
const chatModelsResponse = await sdk.withOptions({ baseURL: url }).get('/config')
|
||||
logger.debug(`Chat models response: ${JSON.stringify(chatModelsResponse)}`)
|
||||
|
||||
// Parse the config response to extract model information
|
||||
|
||||
Loading…
Reference in New Issue
Block a user