mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 16:49:07 +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
|
||||
if (actualProvider.type === 'openai-response' && !isOpenAIChatCompletionOnlyModel(model)) {
|
||||
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
|
||||
if (actualProvider.authType == 'oauth') {
|
||||
extraOptions.mode = 'responses'
|
||||
} else {
|
||||
extraOptions.mode = 'chat'
|
||||
}
|
||||
} else if (aiSdkProviderId === 'cherryin') {
|
||||
extraOptions.mode = 'chat'
|
||||
}
|
||||
|
||||
// 添加额外headers
|
||||
|
||||
Loading…
Reference in New Issue
Block a user