mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +08:00
fix(models): some qwen3 models cannot disable thinking (#8854)
* fix(models): 修正qwen3模型thinking系列的支持判断
修复qwen3模型中thinking系列不应支持控制思考的逻辑错误
* Revert "fix(models): 修正qwen3模型thinking系列的支持判断"
This reverts commit 189d878dc3.
* feat(OpenAIApiClient): 添加对Qwen3235BA22B模型的支持
处理Qwen3235BA22B模型的特殊逻辑,当检测到该模型时禁用enable_thinking
This commit is contained in:
parent
a3b8c722a7
commit
c6cc1baae1
@ -7,6 +7,7 @@ import {
|
|||||||
isDoubaoThinkingAutoModel,
|
isDoubaoThinkingAutoModel,
|
||||||
isGrokReasoningModel,
|
isGrokReasoningModel,
|
||||||
isNotSupportSystemMessageModel,
|
isNotSupportSystemMessageModel,
|
||||||
|
isQwen3235BA22BThinkingModel,
|
||||||
isQwenMTModel,
|
isQwenMTModel,
|
||||||
isQwenReasoningModel,
|
isQwenReasoningModel,
|
||||||
isReasoningModel,
|
isReasoningModel,
|
||||||
@ -145,6 +146,9 @@ export class OpenAIAPIClient extends OpenAIBaseClient<
|
|||||||
return { reasoning: { enabled: false, exclude: true } }
|
return { reasoning: { enabled: false, exclude: true } }
|
||||||
}
|
}
|
||||||
if (isSupportedThinkingTokenQwenModel(model) || isSupportedThinkingTokenHunyuanModel(model)) {
|
if (isSupportedThinkingTokenQwenModel(model) || isSupportedThinkingTokenHunyuanModel(model)) {
|
||||||
|
if (isQwen3235BA22BThinkingModel(model)) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
return { enable_thinking: false }
|
return { enable_thinking: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +196,7 @@ export class OpenAIAPIClient extends OpenAIBaseClient<
|
|||||||
// Qwen models
|
// Qwen models
|
||||||
if (isSupportedThinkingTokenQwenModel(model)) {
|
if (isSupportedThinkingTokenQwenModel(model)) {
|
||||||
const thinkConfig = {
|
const thinkConfig = {
|
||||||
enable_thinking: true,
|
enable_thinking: isQwen3235BA22BThinkingModel(model) ? undefined : true,
|
||||||
thinking_budget: budgetTokens
|
thinking_budget: budgetTokens
|
||||||
}
|
}
|
||||||
if (this.provider.id === 'dashscope') {
|
if (this.provider.id === 'dashscope') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user