diff --git a/pkg/tools/web.go b/pkg/tools/web.go index 8ba2a723aa..6518989fe0 100644 --- a/pkg/tools/web.go +++ b/pkg/tools/web.go @@ -651,14 +651,16 @@ 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), } }