fix web_fetch
This commit is contained in:
parent
08599f8736
commit
17b5c39d56
1 changed files with 10 additions and 7 deletions
|
|
@ -651,14 +651,17 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) *ToolRe
|
||||||
|
|
||||||
resultJSON, _ := json.MarshalIndent(result, "", " ")
|
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{
|
return &ToolResult{
|
||||||
ForLLM: fmt.Sprintf(
|
ForLLM: forLLM,
|
||||||
"Fetched %d bytes from %s (extractor: %s, truncated: %v)",
|
|
||||||
len(text),
|
|
||||||
urlStr,
|
|
||||||
extractor,
|
|
||||||
truncated,
|
|
||||||
),
|
|
||||||
ForUser: string(resultJSON),
|
ForUser: string(resultJSON),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue