mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
fix: azure-openai provider
This commit is contained in:
parent
450d6228d4
commit
b67cd9d145
@ -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
|
||||||
|
|||||||
@ -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: '',
|
||||||
|
|||||||
@ -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'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user