fix(web): send fetched content to LLM instead of summary metadata
web_fetch was returning only a short metadata string to the LLM
("Fetched N bytes from ..."), so the model never saw the actual page
content and fell back to hallucinated answers. Now ForLLM carries the
full JSON payload (url, status, text) so the model reasons on real
fetched data.
This commit is contained in:
parent
56a060ff61
commit
137cf94878
1 changed files with 1 additions and 1 deletions
|
|
@ -477,7 +477,7 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]interface{})
|
||||||
resultJSON, _ := json.MarshalIndent(result, "", " ")
|
resultJSON, _ := json.MarshalIndent(result, "", " ")
|
||||||
|
|
||||||
return &ToolResult{
|
return &ToolResult{
|
||||||
ForLLM: fmt.Sprintf("Fetched %d bytes from %s (extractor: %s, truncated: %v)", len(text), urlStr, extractor, truncated),
|
ForLLM: string(resultJSON),
|
||||||
ForUser: string(resultJSON),
|
ForUser: string(resultJSON),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue