fix: 修复 web_search 搜索超时和噪音问题
- 移除baidu/360search引擎(安全验证拦截),保留bing+sogou - 超时从10s增加到25s,SearXNG内部timeout=20s - 添加User-Agent - 跳过失败的工具结果推送,避免"百度被安全验证挡住"等噪音刷屏 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -462,6 +462,14 @@ func main() {
|
||||
if err := json.Unmarshal([]byte(result), &toolResult); err != nil {
|
||||
toolResult = map[string]interface{}{"output": result}
|
||||
}
|
||||
|
||||
// 跳过失败的工具调用 — 错误结果不需要 LLM 跟进,避免噪音刷屏
|
||||
if success, ok := toolResult["success"].(bool); ok && !success {
|
||||
errMsg, _ := toolResult["error"].(string)
|
||||
log.Printf("[tool-followup] 跳过失败工具 %s: %s", toolName, errMsg)
|
||||
return
|
||||
}
|
||||
|
||||
output, _ := toolResult["output"].(string)
|
||||
if output == "" {
|
||||
output = result
|
||||
|
||||
Reference in New Issue
Block a user