From 58874a954c67901a174343c10865a1386ba0fdd0 Mon Sep 17 00:00:00 2001 From: icarus Date: Fri, 29 Aug 2025 19:19:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiCore):=20=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E6=99=BA=E8=B0=B1AI=E6=A8=A1=E5=9E=8B=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在getReasoningEffort函数中新增对智谱AI模型的支持逻辑,包括判断模型类型及设置对应的推理参数 --- src/renderer/src/aiCore/utils/reasoning.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/aiCore/utils/reasoning.ts b/src/renderer/src/aiCore/utils/reasoning.ts index b59ce40b61..507b2cd9ce 100644 --- a/src/renderer/src/aiCore/utils/reasoning.ts +++ b/src/renderer/src/aiCore/utils/reasoning.ts @@ -20,6 +20,7 @@ import { isSupportedThinkingTokenHunyuanModel, isSupportedThinkingTokenModel, isSupportedThinkingTokenQwenModel, + isSupportedThinkingTokenZhipuModel, MODEL_SUPPORTED_REASONING_EFFORT } from '@renderer/config/models' import { isSupportEnableThinkingProvider } from '@renderer/config/providers' @@ -88,7 +89,8 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin return {} } - if (isSupportedThinkingTokenDoubaoModel(model)) { + // use thinking, doubao, zhipu, etc. + if (isSupportedThinkingTokenDoubaoModel(model) || isSupportedThinkingTokenZhipuModel(model)) { return { thinking: { type: 'disabled' } } } @@ -254,7 +256,7 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin } } - // Doubao models, use thinking + // Use thinking, doubao, zhipu, etc. if (isSupportedThinkingTokenDoubaoModel(model)) { if (assistant.settings?.reasoning_effort === 'high') { return { @@ -264,6 +266,9 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin } } } + if (isSupportedThinkingTokenZhipuModel(model)) { + return { thinking: { type: 'enabled' } } + } // Default case: no special thinking settings return {}