fix web_fetch

This commit is contained in:
Lei 2026-02-28 22:38:52 +08:00
parent 08599f8736
commit 17b5c39d56

View file

@ -651,14 +651,17 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) *ToolRe
resultJSON, _ := json.MarshalIndent(result, "", " ")
forLLM := fmt.Sprintf(
"Fetched %d bytes from %s (extractor: %s, truncated: %v)\nContent:\n%s",
len(text),
urlStr,
extractor,
truncated,
text
),
return &ToolResult{
ForLLM: fmt.Sprintf(
"Fetched %d bytes from %s (extractor: %s, truncated: %v)",
len(text),
urlStr,
extractor,
truncated,
),
ForLLM: forLLM,
ForUser: string(resultJSON),
}
}