mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 06:19:05 +08:00
feat(models): add support for new Qwen model and update effort ratio (#8537)
* feat(models): add support for new Qwen model and update effort ratio - Introduced support for the 'qwen3-235b-a22b-thinking' model with a max token limit of 81,920. - Updated the model options in ThinkingButton to include 'qwen_3235ba22b_thinking'. - Adjusted the effort ratio for 'low' from 0.2 to 0.05 for improved performance. * chore: remove
This commit is contained in:
parent
e7ad3e6935
commit
6d1e58b130
@ -2975,6 +2975,7 @@ export const THINKING_TOKEN_MAP: Record<string, { min: number; max: number }> =
|
|||||||
'gemini-.*-pro.*$': { min: 128, max: 32768 },
|
'gemini-.*-pro.*$': { min: 128, max: 32768 },
|
||||||
|
|
||||||
// Qwen models
|
// Qwen models
|
||||||
|
'qwen3-235b-a22b-thinking(?:-[\\w-]+)$': { min: 0, max: 81_920 },
|
||||||
'qwen-plus-.*$': { min: 0, max: 38912 },
|
'qwen-plus-.*$': { min: 0, max: 38912 },
|
||||||
'qwen-turbo-.*$': { min: 0, max: 38912 },
|
'qwen-turbo-.*$': { min: 0, max: 38912 },
|
||||||
'qwen3-0\\.6b$': { min: 0, max: 30720 },
|
'qwen3-0\\.6b$': { min: 0, max: 30720 },
|
||||||
|
|||||||
@ -42,6 +42,7 @@ const MODEL_SUPPORTED_OPTIONS: Record<string, ThinkingOption[]> = {
|
|||||||
gemini: ['off', 'low', 'medium', 'high', 'auto'],
|
gemini: ['off', 'low', 'medium', 'high', 'auto'],
|
||||||
gemini_pro: ['low', 'medium', 'high', 'auto'],
|
gemini_pro: ['low', 'medium', 'high', 'auto'],
|
||||||
qwen: ['off', 'low', 'medium', 'high'],
|
qwen: ['off', 'low', 'medium', 'high'],
|
||||||
|
qwen_3235ba22b_thinking: ['low', 'medium', 'high'],
|
||||||
doubao: ['off', 'auto', 'high'],
|
doubao: ['off', 'auto', 'high'],
|
||||||
hunyuan: ['off', 'auto']
|
hunyuan: ['off', 'auto']
|
||||||
}
|
}
|
||||||
@ -64,6 +65,7 @@ const ThinkingButton: FC<Props> = ({ ref, model, assistant, ToolbarButton }): Re
|
|||||||
const isGeminiModel = isSupportedThinkingTokenGeminiModel(model)
|
const isGeminiModel = isSupportedThinkingTokenGeminiModel(model)
|
||||||
const isGeminiFlashModel = GEMINI_FLASH_MODEL_REGEX.test(model.id)
|
const isGeminiFlashModel = GEMINI_FLASH_MODEL_REGEX.test(model.id)
|
||||||
const isQwenModel = isSupportedThinkingTokenQwenModel(model)
|
const isQwenModel = isSupportedThinkingTokenQwenModel(model)
|
||||||
|
const isQwen3235BA22BThinkingModel = model.id.includes('qwen3-235b-a22b-thinking')
|
||||||
const isDoubaoModel = isSupportedThinkingTokenDoubaoModel(model)
|
const isDoubaoModel = isSupportedThinkingTokenDoubaoModel(model)
|
||||||
const isHunyuanModel = isSupportedThinkingTokenHunyuanModel(model)
|
const isHunyuanModel = isSupportedThinkingTokenHunyuanModel(model)
|
||||||
|
|
||||||
@ -81,11 +83,24 @@ const ThinkingButton: FC<Props> = ({ ref, model, assistant, ToolbarButton }): Re
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isGrokModel) return 'grok'
|
if (isGrokModel) return 'grok'
|
||||||
if (isQwenModel) return 'qwen'
|
if (isQwenModel) {
|
||||||
|
if (isQwen3235BA22BThinkingModel) {
|
||||||
|
return 'qwen_3235ba22b_thinking'
|
||||||
|
}
|
||||||
|
return 'qwen'
|
||||||
|
}
|
||||||
if (isDoubaoModel) return 'doubao'
|
if (isDoubaoModel) return 'doubao'
|
||||||
if (isHunyuanModel) return 'hunyuan'
|
if (isHunyuanModel) return 'hunyuan'
|
||||||
return 'default'
|
return 'default'
|
||||||
}, [isGeminiModel, isGrokModel, isQwenModel, isDoubaoModel, isGeminiFlashModel, isHunyuanModel])
|
}, [
|
||||||
|
isGeminiModel,
|
||||||
|
isGrokModel,
|
||||||
|
isQwenModel,
|
||||||
|
isDoubaoModel,
|
||||||
|
isHunyuanModel,
|
||||||
|
isGeminiFlashModel,
|
||||||
|
isQwen3235BA22BThinkingModel
|
||||||
|
])
|
||||||
|
|
||||||
// 获取当前模型支持的选项
|
// 获取当前模型支持的选项
|
||||||
const supportedOptions = useMemo(() => {
|
const supportedOptions = useMemo(() => {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export type ReasoningEffortOptions = 'low' | 'medium' | 'high' | 'auto'
|
|||||||
export type EffortRatio = Record<ReasoningEffortOptions, number>
|
export type EffortRatio = Record<ReasoningEffortOptions, number>
|
||||||
|
|
||||||
export const EFFORT_RATIO: EffortRatio = {
|
export const EFFORT_RATIO: EffortRatio = {
|
||||||
low: 0.2,
|
low: 0.05,
|
||||||
medium: 0.5,
|
medium: 0.5,
|
||||||
high: 0.8,
|
high: 0.8,
|
||||||
auto: 2
|
auto: 2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user