fix: update Azure provider handling in AI SDK integration (#11465)

This commit is contained in:
SuYao
2025-11-26 15:43:32 +08:00
committed by GitHub
parent d4396b4890
commit a2de7d48be
2 changed files with 9 additions and 3 deletions

View File

@@ -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

View File

@@ -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') {