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:
George·Dong
2025-10-29 09:20:19 +08:00
committed by GitHub
parent 888a183328
commit fc4f30feab
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -419,7 +419,7 @@ export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> =
type: 'openai',
apiKey: '',
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,
isSystem: true,
enabled: false
+1 -1
View File
@@ -72,7 +72,7 @@ export const getCodeToolsApiBaseUrl = (model: Model, type: EndpointType) => {
},
dashscope: {
anthropic: {
api_base_url: 'https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy'
api_base_url: 'https://dashscope.aliyuncs.com/apps/anthropic'
}
},
modelscope: {
+5
View File
@@ -2728,6 +2728,11 @@ const migrateConfig = {
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
} catch (error) {
logger.error('migrate 166 error', error as Error)