web_search 从内置工具改为 MCP 服务:新增 server/mcp.js 极简 MCP 客户端(JSON-RPC over HTTP,SSE 帧容错解析),config.yml 新增 mcp_servers(可多个,每项 name?/url/headers,authorization 即普通 header),启动时 tools/list 发现工具转 OpenAI function 格式,随 system prompt 与内置工具一起发给模型(内置 definitions.json 移除 web_search,剩 12 个);executeTool 未命中内置时按注册表经 tools/call 转发,工具重名加服务名前缀;旧 web_search.{url,authorization} 配置自动迁移为一条 mcp_servers;单服务发现失败仅告警不阻塞启动;README/example 配置同步

This commit is contained in:
2026-08-31 17:12:32 +08:00
parent 93e463e704
commit 526880a956
9 changed files with 175 additions and 151 deletions
-31
View File
@@ -302,37 +302,6 @@
}
}
},
{
"type": "function",
"function": {
"name": "web_search",
"description": "免费网页搜索:Parallel(默认,匿名免 key)或 Exa(备用)。返回结构化结果数组(title / url / snippet / publishedAt)。",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "搜索查询词"
},
"provider": {
"type": "string",
"enum": [
"parallel",
"exa"
],
"description": "免费后端:parallel(默认)/ exa(备用)"
},
"numResults": {
"type": "number",
"description": "返回结果条数上限(默认 8)"
}
},
"required": [
"query"
]
}
}
},
{
"type": "function",
"function": {