12//go:embed web_search.md
13var webSearchToolDescription []byte
15// NewWebSearchTool creates a web search tool for sub-agents (no permissions needed).
16func NewWebSearchTool(client *http.Client) fantasy.AgentTool {
18 client = &http.Client{
19 Timeout: 30 * time.Second,
20 Transport: &http.Transport{
22 MaxIdleConnsPerHost: 10,
23 IdleConnTimeout: 90 * time.Second,
28 return fantasy.NewParallelAgentTool(
30 string(webSearchToolDescription),
31 func(ctx context.Context, params WebSearchParams, call fantasy.ToolCall) (fantasy.ToolResponse, error) {
32 if params.Query == "" {
33 return fantasy.NewTextErrorResponse("query is required"), nil
36 maxResults := params.MaxResults
44 results, err := searchDuckDuckGo(ctx, client, params.Query, maxResults)
46 return fantasy.NewTextErrorResponse("Failed to search: " + err.Error()), nil
49 return fantasy.NewTextResponse(formatSearchResults(results)), nil
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list