fix: update Azure provider handling in AI SDK integration (#11465)
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user