mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 19:30:17 +08:00
fix: update Azure provider handling in AI SDK integration (#11465)
This commit is contained in:
parent
d4396b4890
commit
a2de7d48be
@ -60,8 +60,12 @@ function tryResolveProviderId(identifier: string): ProviderId | null {
|
||||
export function getAiSdkProviderId(provider: Provider): string {
|
||||
// 1. 尝试解析provider.id
|
||||
const resolvedFromId = tryResolveProviderId(provider.id)
|
||||
if (isAzureOpenAIProvider(provider) && isAzureResponsesEndpoint(provider)) {
|
||||
return 'azure-responses'
|
||||
if (isAzureOpenAIProvider(provider)) {
|
||||
if (isAzureResponsesEndpoint(provider)) {
|
||||
return 'azure-responses'
|
||||
} else {
|
||||
return 'azure'
|
||||
}
|
||||
}
|
||||
if (resolvedFromId) {
|
||||
return resolvedFromId
|
||||
|
||||
@ -249,7 +249,9 @@ export function buildProviderOptions(
|
||||
'google-vertex': 'google',
|
||||
'google-vertex-anthropic': 'anthropic',
|
||||
'azure-anthropic': 'anthropic',
|
||||
'ai-gateway': 'gateway'
|
||||
'ai-gateway': 'gateway',
|
||||
azure: 'openai',
|
||||
'azure-responses': 'openai'
|
||||
}[rawProviderId] || rawProviderId
|
||||
|
||||
if (rawProviderKey === 'cherryin') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user