Compare commits

...

1 Commits

Author SHA1 Message Date
b9e99da01b fix: 搜索改为勾选即执行,不再依赖关键词检测 2026-04-13 16:00:32 +08:00

View File

@@ -750,9 +750,8 @@ async def websocket_endpoint(websocket: WebSocket, user_id: str):
# 检查是否需要执行搜索
search_context = None
if 'search' in agent_tools and 'search' not in disabled_tools:
# 使用关键词检测:如果消息包含搜索相关关键词,执行搜索
search_keywords = ['搜索', '查找', '查询', '最新', '新闻', '新闻', 'weather', '天气', '股价', '股票', '汇率', 'what is', 'what are', 'find', 'search', 'look up']
should_search = any(kw in message.lower() for kw in search_keywords)
# 只要启用了搜索工具且未禁用,就执行搜索(不再依赖关键词检测)
should_search = True
if should_search:
# 执行搜索