fix: azure-openai provider

This commit is contained in:
suyao 2025-07-08 13:38:14 +08:00
parent 450d6228d4
commit b67cd9d145
No known key found for this signature in database
3 changed files with 5 additions and 1 deletions

View File

@ -145,12 +145,14 @@ function addProviderSpecificMiddlewares(builder: AiSdkMiddlewareBuilder, config:
// Anthropic特定中间件 // Anthropic特定中间件
break break
case 'openai': case 'openai':
case 'azure-openai': {
const tagName = config.model?.id.includes('gemini') ? tagNameArray[1] : tagNameArray[0] const tagName = config.model?.id.includes('gemini') ? tagNameArray[1] : tagNameArray[0]
builder.add({ builder.add({
name: 'thinking-tag-extraction', name: 'thinking-tag-extraction',
middleware: extractReasoningMiddleware({ tagName }) middleware: extractReasoningMiddleware({ tagName })
}) })
break break
}
case 'gemini': case 'gemini':
// Gemini特定中间件 // Gemini特定中间件
break break

View File

@ -217,7 +217,7 @@ export const INITIAL_PROVIDERS: Provider[] = [
{ {
id: 'azure-openai', id: 'azure-openai',
name: 'Azure OpenAI', name: 'Azure OpenAI',
type: 'openai', type: 'azure-openai',
apiKey: '', apiKey: '',
apiHost: '', apiHost: '',
apiVersion: '', apiVersion: '',

View File

@ -800,6 +800,7 @@ const migrateConfig = {
state.llm.providers.forEach((provider) => { state.llm.providers.forEach((provider) => {
if (provider.id === 'qwenlm') { if (provider.id === 'qwenlm') {
// @ts-ignore eslint-disable-next-line
provider.type = 'qwenlm' provider.type = 'qwenlm'
} }
}) })
@ -857,6 +858,7 @@ const migrateConfig = {
try { try {
state.llm.providers.forEach((provider) => { state.llm.providers.forEach((provider) => {
if (provider.id === 'qwenlm') { if (provider.id === 'qwenlm') {
// @ts-ignore eslint-disable-next-line
provider.type = 'qwenlm' provider.type = 'qwenlm'
} }
}) })