From 7c2cc9358502d90104e7b3b4dffc7b953dc1a17c Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Sat, 22 Nov 2025 16:18:42 +0800 Subject: [PATCH] chore: include current time in web_search description --- core/main_terminal.py | 4 +++- sub_agent/core/main_terminal.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/main_terminal.py b/core/main_terminal.py index 5fd7895..7a3aef4 100644 --- a/core/main_terminal.py +++ b/core/main_terminal.py @@ -905,6 +905,8 @@ class MainTerminal: def define_tools(self) -> List[Dict]: """定义可用工具(添加确认工具)""" + current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + tools = [ { "type": "function", @@ -1230,7 +1232,7 @@ class MainTerminal: "type": "function", "function": { "name": "web_search", - "description": "当现有资料不足时搜索外部信息。调用前说明目的,精准撰写 query,并合理设置时间/主题参数;避免重复或无意义的搜索。", + "description": f"当现有资料不足时搜索外部信息(当前时间 {current_time})。调用前说明目的,精准撰写 query,并合理设置时间/主题参数;避免重复或无意义的搜索。", "parameters": { "type": "object", "properties": { diff --git a/sub_agent/core/main_terminal.py b/sub_agent/core/main_terminal.py index 68be775..16ac226 100644 --- a/sub_agent/core/main_terminal.py +++ b/sub_agent/core/main_terminal.py @@ -41,7 +41,6 @@ from modules.todo_manager import TodoManager from modules.sub_agent_manager import SubAgentManager from modules.webpage_extractor import extract_webpage_content, tavily_extract from modules.ocr_client import OCRClient -from modules.easter_egg_manager import EasterEggManager from core.tool_config import TOOL_CATEGORIES from utils.api_client import DeepSeekClient from utils.context_manager import ContextManager @@ -86,7 +85,6 @@ class MainTerminal: project_path=self.project_path, data_dir=str(self.data_dir) ) - self.easter_egg_manager = EasterEggManager() self._announced_sub_agent_tasks = set() # 聚焦文件管理 @@ -891,6 +889,8 @@ class MainTerminal: def define_tools(self) -> List[Dict]: """定义可用工具(添加确认工具)""" + current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + tools = [ { "type": "function", @@ -1216,7 +1216,7 @@ class MainTerminal: "type": "function", "function": { "name": "web_search", - "description": "当现有资料不足时搜索外部信息。调用前说明目的,精准撰写 query,并合理设置时间/主题参数;避免重复或无意义的搜索。", + "description": f"当现有资料不足时搜索外部信息(当前时间 {current_time})。调用前说明目的,精准撰写 query,并合理设置时间/主题参数;避免重复或无意义的搜索。", "parameters": { "type": "object", "properties": { @@ -2036,7 +2036,11 @@ class MainTerminal: ) elif tool_name == "trigger_easter_egg": - result = self.easter_egg_manager.trigger_effect(arguments.get("effect")) + result = { + "success": False, + "error": "子智能体未启用彩蛋特效", + "available_effects": [] + } else: result = {"success": False, "error": f"未知工具: {tool_name}"}