websearch

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTools

func BuildTools() []*agent.Tool

BuildTools returns web search tools that use HTTP-only DuckDuckGo search without requiring a browser session.

Types

type SearchResult

type SearchResult struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	Snippet string `json:"snippet"`
}

SearchResult is a single web search result.

func Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

Search queries DuckDuckGo's HTML endpoint and returns structured results. When the context carries a P2P request flag, result URLs are validated against private/internal network ranges before inclusion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL