mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 23:22:05 +08:00
fix: update Dashscope Anthropic API host and migrate old configs (#10973)
* fix: update Dashscope Anthropic API host and migrate old configs * fix(migration): remove obsolete dashscope rewrite * fix(migrate): overwrite Anthropic API host for dashscope provider
This commit is contained in:
parent
888a183328
commit
fc4f30feab
@ -419,7 +419,7 @@ export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> =
|
|||||||
type: 'openai',
|
type: 'openai',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1/',
|
apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1/',
|
||||||
anthropicApiHost: 'https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy',
|
anthropicApiHost: 'https://dashscope.aliyuncs.com/apps/anthropic',
|
||||||
models: SYSTEM_MODELS.dashscope,
|
models: SYSTEM_MODELS.dashscope,
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export const getCodeToolsApiBaseUrl = (model: Model, type: EndpointType) => {
|
|||||||
},
|
},
|
||||||
dashscope: {
|
dashscope: {
|
||||||
anthropic: {
|
anthropic: {
|
||||||
api_base_url: 'https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy'
|
api_base_url: 'https://dashscope.aliyuncs.com/apps/anthropic'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modelscope: {
|
modelscope: {
|
||||||
|
|||||||
@ -2728,6 +2728,11 @@ const migrateConfig = {
|
|||||||
preset.settings.toolUseMode = DEFAULT_ASSISTANT_SETTINGS.toolUseMode
|
preset.settings.toolUseMode = DEFAULT_ASSISTANT_SETTINGS.toolUseMode
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 更新阿里云百炼的 Anthropic API 地址
|
||||||
|
const dashscopeProvider = state.llm.providers.find((provider) => provider.id === 'dashscope')
|
||||||
|
if (dashscopeProvider) {
|
||||||
|
dashscopeProvider.anthropicApiHost = 'https://dashscope.aliyuncs.com/apps/anthropic'
|
||||||
|
}
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('migrate 166 error', error as Error)
|
logger.error('migrate 166 error', error as Error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user