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