Documentation
¶
Overview ¶
Package web hosts web tools: web_search (Tavily-backed) and web_fetch (HTTP GET + readable-text extraction).
Tools hold a *config.Config pointer captured at construction so their Execute methods can read the live FETCH_MAX_BYTES / TAVILY_API_KEY (mutated by the /config form) without falling back to a global singleton.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FetchTool ¶
type FetchTool struct {
// contains filtered or unexported fields
}
FetchTool implements web_fetch — GET a URL, render readable text. The cfg pointer is read at Execute time so runtime mutations of FetchMaxBytes via the /config form take effect on the next call.
func NewFetch ¶
NewFetch builds a fetch tool bound to cfg. cfg may be nil — Execute falls back to the default 100k byte cap.
func (*FetchTool) Description ¶
func (*FetchTool) Schema ¶
func (t *FetchTool) Schema() json.RawMessage
type SearchTool ¶
type SearchTool struct {
// contains filtered or unexported fields
}
SearchTool implements web_search via the Tavily API. The cfg pointer is read at Execute time so the /config form's TavilyAPIKey rotation takes effect on the next call.
func NewSearch ¶
func NewSearch(cfg *config.Config) *SearchTool
NewSearch builds a search tool bound to cfg. cfg may be nil — Execute surfaces a "not configured" error when no API key is reachable.
func (*SearchTool) Description ¶
func (t *SearchTool) Description() string
func (*SearchTool) Execute ¶
func (t *SearchTool) Execute(ctx context.Context, logger *slog.Logger, input json.RawMessage) (tools.Result, error)
func (*SearchTool) Name ¶
func (t *SearchTool) Name() string
func (*SearchTool) Schema ¶
func (t *SearchTool) Schema() json.RawMessage