mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
fix(poe): poe cannot process multiple text part (#9711)
fix(poe): 修复poe provider不支持array content的问题 临时解决方案是强制poe使用string content,同时将reasoning_effort参数拼接逻辑优化为使用suffix变量
This commit is contained in:
parent
4dbe5c8055
commit
2e5ffb8324
@ -639,12 +639,18 @@ export class OpenAIAPIClient extends OpenAIBaseClient<
|
|||||||
}
|
}
|
||||||
if (this.provider.id === SystemProviderIds.poe) {
|
if (this.provider.id === SystemProviderIds.poe) {
|
||||||
// 如果以后 poe 支持 reasoning_effort 参数了,可以删掉这部分
|
// 如果以后 poe 支持 reasoning_effort 参数了,可以删掉这部分
|
||||||
|
let suffix = ''
|
||||||
if (isGPT5SeriesModel(model) && reasoningEffort.reasoning_effort) {
|
if (isGPT5SeriesModel(model) && reasoningEffort.reasoning_effort) {
|
||||||
lastUserMsg.content += ` --reasoning_effort ${reasoningEffort.reasoning_effort}`
|
suffix = ` --reasoning_effort ${reasoningEffort.reasoning_effort}`
|
||||||
} else if (isClaudeReasoningModel(model) && reasoningEffort.thinking?.budget_tokens) {
|
} else if (isClaudeReasoningModel(model) && reasoningEffort.thinking?.budget_tokens) {
|
||||||
lastUserMsg.content += ` --thinking_budget ${reasoningEffort.thinking.budget_tokens}`
|
suffix = ` --thinking_budget ${reasoningEffort.thinking.budget_tokens}`
|
||||||
} else if (isGeminiReasoningModel(model) && reasoningEffort.extra_body?.google?.thinking_config) {
|
} else if (isGeminiReasoningModel(model) && reasoningEffort.extra_body?.google?.thinking_config) {
|
||||||
lastUserMsg.content += ` --thinking_budget ${reasoningEffort.extra_body.google.thinking_config.thinking_budget}`
|
suffix = ` --thinking_budget ${reasoningEffort.extra_body.google.thinking_config.thinking_budget}`
|
||||||
|
}
|
||||||
|
// FIXME: poe 不支持多个text part,上传文本文件的时候用的不是file part而是text part,因此会出问题
|
||||||
|
// 临时解决方案是强制poe用string content,但是其实poe部分支持array
|
||||||
|
if (typeof lastUserMsg.content === 'string') {
|
||||||
|
lastUserMsg.content += suffix
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1262,7 +1262,8 @@ const NOT_SUPPORT_ARRAY_CONTENT_PROVIDERS = [
|
|||||||
'deepseek',
|
'deepseek',
|
||||||
'baichuan',
|
'baichuan',
|
||||||
'minimax',
|
'minimax',
|
||||||
'xirang'
|
'xirang',
|
||||||
|
'poe'
|
||||||
] as const satisfies SystemProviderId[]
|
] as const satisfies SystemProviderId[]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user