mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 05:11:24 +08:00
fix(provider): config error
This commit is contained in:
parent
448b5b5c9e
commit
4b0d8d7e65
@ -130,6 +130,9 @@ export class ProviderConfigBuilder<T extends ProviderId = ProviderId> {
|
||||
}
|
||||
if (options.location) {
|
||||
googleConfig.location = options.location
|
||||
if (options.location === 'global') {
|
||||
googleConfig.baseURL = 'https://aiplatform.googleapis.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
|
||||
@ -47,7 +47,11 @@ function providerToAiSdkConfig(provider: Provider): {
|
||||
actualProvider = createVertexProvider(provider)
|
||||
}
|
||||
|
||||
if (actualProvider.type === 'openai' || actualProvider.type === 'anthropic') {
|
||||
if (
|
||||
actualProvider.type === 'openai' ||
|
||||
actualProvider.type === 'anthropic' ||
|
||||
actualProvider.type === 'openai-response'
|
||||
) {
|
||||
actualProvider.apiHost = formatApiHost(actualProvider.apiHost)
|
||||
}
|
||||
|
||||
@ -62,7 +66,16 @@ function providerToAiSdkConfig(provider: Provider): {
|
||||
: undefined
|
||||
|
||||
if (AiCore.isSupported(aiSdkProviderId) && aiSdkProviderId !== 'openai-compatible') {
|
||||
const options = ProviderConfigFactory.fromProvider(aiSdkProviderId, actualProvider, openaiResponseOptions)
|
||||
const options = ProviderConfigFactory.fromProvider(
|
||||
aiSdkProviderId,
|
||||
{
|
||||
baseURL: actualProvider.apiHost,
|
||||
apiKey: actualProvider.apiKey,
|
||||
headers: actualProvider.extra_headers
|
||||
},
|
||||
openaiResponseOptions
|
||||
)
|
||||
|
||||
return {
|
||||
providerId: aiSdkProviderId as ProviderId,
|
||||
options
|
||||
|
||||
Loading…
Reference in New Issue
Block a user