diff --git a/src/components/input/ChatInput.vue b/src/components/input/ChatInput.vue index ad5e3d7..9f195e8 100644 --- a/src/components/input/ChatInput.vue +++ b/src/components/input/ChatInput.vue @@ -97,14 +97,12 @@ - 深度思考 @@ -190,6 +188,14 @@ const props = withDefaults( }, ); +// 强制深度思考的模型列表(这些模型默认开启深度思考且不可关闭) +const FORCE_DEEP_THINKING_MODELS = ["deepseek-reasoner", "glm-z1-flash"]; + +// 判断当前模型是否强制开启深度思考 +const isForceDeepThinkingModel = computed(() => { + return FORCE_DEEP_THINKING_MODELS.includes(modelName.value.toLowerCase()); +}); + const emit = defineEmits<{ send: [ text: string, @@ -532,10 +538,20 @@ watch(inputText, () => { // 监听模型变化,重置选项功能 watch( () => settingsStore.settings.defaultModel, - () => { + (newModel) => { + // 如果是强制深度思考的模型,自动开启深度思考 + if (FORCE_DEEP_THINKING_MODELS.includes(newModel.toLowerCase())) { + isDeepThinking.value = true; + localStorage.setItem("isDeepThinking", "true"); + } else { + isDeepThinking.value = false; + localStorage.setItem("isDeepThinking", "false"); + } + // 重置搜索相关选项 isDeepSearch.value = false; - isDeepThinking.value = false; isWebSearch.value = false; + localStorage.setItem("isDeepSearch", "false"); + localStorage.setItem("isWebSearch", "false"); }, );