feat: add support for Qwen 3-235B-A22B thinking model detection (#8641)

- Introduced a new function to check if a model is the Qwen 3-235B-A22B thinking model.
- Updated the ThinkingButton component to utilize the new detection function for improved model handling.
This commit is contained in:
SuYao 2025-07-30 00:18:21 +08:00 committed by GitHub
parent 78173ae24e
commit 7436b34a96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -2704,6 +2704,14 @@ export function isSupportedThinkingTokenQwenModel(model?: Model): boolean {
)
}
export function isQwen3235BA22BThinkingModel(model?: Model): boolean {
if (!model) {
return false
}
const baseName = getLowerBaseModelName(model.id, '/')
return baseName.includes('qwen3-235b-a22b-thinking')
}
export function isSupportedThinkingTokenDoubaoModel(model?: Model): boolean {
if (!model) {
return false

View File

@ -9,6 +9,7 @@ import { useQuickPanel } from '@renderer/components/QuickPanel'
import {
GEMINI_FLASH_MODEL_REGEX,
isDoubaoThinkingAutoModel,
isQwen3235BA22BThinkingModel,
isSupportedReasoningEffortGrokModel,
isSupportedReasoningEffortPerplexityModel,
isSupportedThinkingTokenDoubaoModel,
@ -69,7 +70,7 @@ const ThinkingButton: FC<Props> = ({ ref, model, assistant, ToolbarButton }): Re
const isGeminiModel = isSupportedThinkingTokenGeminiModel(model)
const isGeminiFlashModel = GEMINI_FLASH_MODEL_REGEX.test(model.id)
const isQwenModel = isSupportedThinkingTokenQwenModel(model)
const isQwen3235BA22BThinkingModel = model.id.includes('qwen3-235b-a22b-thinking')
const isQwen3235BA22BThinking = isQwen3235BA22BThinkingModel(model)
const isDoubaoModel = isSupportedThinkingTokenDoubaoModel(model)
const isHunyuanModel = isSupportedThinkingTokenHunyuanModel(model)
const isPerplexityModel = isSupportedReasoningEffortPerplexityModel(model)
@ -90,7 +91,7 @@ const ThinkingButton: FC<Props> = ({ ref, model, assistant, ToolbarButton }): Re
}
if (isGrokModel) return 'grok'
if (isQwenModel) {
if (isQwen3235BA22BThinkingModel) {
if (isQwen3235BA22BThinking) {
return 'qwen_3235ba22b_thinking'
}
return 'qwen'
@ -108,7 +109,7 @@ const ThinkingButton: FC<Props> = ({ ref, model, assistant, ToolbarButton }): Re
isGeminiFlashModel,
isHunyuanModel,
isPerplexityModel,
isQwen3235BA22BThinkingModel,
isQwen3235BA22BThinking,
isZhipuModel
])