Documentation
¶
Overview ¶
Package websearch provides a pluggable web search interface with multiple provider backends (DuckDuckGo, Tavily, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuckDuckGo ¶
type DuckDuckGo struct {
// contains filtered or unexported fields
}
DuckDuckGo implements web search using DuckDuckGo's lite HTML interface. This is a free, no-API-key-required provider. It scrapes the lightweight HTML search page (lite.duckduckgo.com) for results.
func NewDuckDuckGo ¶
func NewDuckDuckGo() *DuckDuckGo
NewDuckDuckGo creates a DuckDuckGo search provider.
type Provider ¶
type Provider interface {
Search(ctx context.Context, query string, maxResults int) ([]Result, error)
Name() string
}
Provider performs web searches and returns structured results.
func NewProvider ¶
func NewProvider(cfg config.WebSearchConfig) (Provider, error)
NewProvider creates a search provider based on config.
type Result ¶
type Result struct {
Title string `json:"title"`
URL string `json:"url"`
Snippet string `json:"snippet"`
}
Result represents a single search result.
Click to show internal directories.
Click to hide internal directories.