feat(options): enhance provider key handling for cherryin in buildPro… (#11361)

feat(options): enhance provider key handling for cherryin in buildProviderOptions function
This commit is contained in:
MyPrototypeWhat 2025-11-19 16:25:29 +08:00 committed by GitHub
parent dc9503ef8b
commit 40a64a7c92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,13 +162,17 @@ export function buildProviderOptions(
...getCustomParameters(assistant)
}
const rawProviderKey =
let rawProviderKey =
{
'google-vertex': 'google',
'google-vertex-anthropic': 'anthropic',
'ai-gateway': 'gateway'
}[rawProviderId] || rawProviderId
if (rawProviderKey === 'cherryin') {
rawProviderKey = { gemini: 'google' }[actualProvider.type] || actualProvider.type
}
// 返回 AI Core SDK 要求的格式:{ 'providerId': providerOptions }
return {
[rawProviderKey]: providerSpecificOptions