mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-11 08:19:01 +08:00
fix(provider): adjust response mode handling for OpenAI and Cherryin providers
This commit is contained in:
parent
5a6e25e1e3
commit
3c51616e5b
@ -190,13 +190,15 @@ export function providerToAiSdkConfig(actualProvider: Provider, model: Model): A
|
|||||||
extraOptions.endpoint = endpoint
|
extraOptions.endpoint = endpoint
|
||||||
if (actualProvider.type === 'openai-response' && !isOpenAIChatCompletionOnlyModel(model)) {
|
if (actualProvider.type === 'openai-response' && !isOpenAIChatCompletionOnlyModel(model)) {
|
||||||
extraOptions.mode = 'responses'
|
extraOptions.mode = 'responses'
|
||||||
} else if (aiSdkProviderId === 'openai' || (aiSdkProviderId === 'cherryin' && actualProvider.type === 'openai')) {
|
} else if (aiSdkProviderId === 'openai' ) {
|
||||||
// OAuth authentication requires using the responses API mode instead of chat mode
|
// OAuth authentication requires using the responses API mode instead of chat mode
|
||||||
if (actualProvider.authType == 'oauth') {
|
if (actualProvider.authType == 'oauth') {
|
||||||
extraOptions.mode = 'responses'
|
extraOptions.mode = 'responses'
|
||||||
} else {
|
} else {
|
||||||
extraOptions.mode = 'chat'
|
extraOptions.mode = 'chat'
|
||||||
}
|
}
|
||||||
|
} else if (aiSdkProviderId === 'cherryin') {
|
||||||
|
extraOptions.mode = 'chat'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加额外headers
|
// 添加额外headers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user