From 3c955e69f17ea61b906e0fdd9238fe2b34bd8ff3 Mon Sep 17 00:00:00 2001 From: lizhixuan Date: Mon, 7 Jul 2025 23:33:22 +0800 Subject: [PATCH] feat: conditionally enable web search plugin based on configuration - Updated the logic to add the `webSearchPlugin` only if `middlewareConfig.enableWebSearch` is true. - Added comments to clarify the use of default search parameters and configuration options. --- src/renderer/src/aiCore/index_new.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/aiCore/index_new.ts b/src/renderer/src/aiCore/index_new.ts index 3f6cc77e18..2b08a59175 100644 --- a/src/renderer/src/aiCore/index_new.ts +++ b/src/renderer/src/aiCore/index_new.ts @@ -143,7 +143,10 @@ export default class ModernAiProvider { const plugins: AiPlugin[] = [] // 1. 总是添加通用插件 // plugins.push(textPlugin) - plugins.push(webSearchPlugin()) + if (middlewareConfig.enableWebSearch) { + // 内置了默认搜索参数,如果改的话可以传config进去 + plugins.push(webSearchPlugin()) + } // 2. 推理模型时添加推理插件 if (middlewareConfig.enableReasoning) {