Documentation
¶
Overview ¶
Package web hosts web tools: web_search (Tavily-backed) and web_fetch (HTTP GET + readable-text extraction).
Both stateless — package-level singletons. They read configuration (TAVILY_API_KEY, FETCH_MAX_BYTES) lazily from configs.Get() inside Execute, so a host that rotates env mid-session picks it up.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Fetch tools.Tool = &FetchTool{} Search tools.Tool = &SearchTool{} )
Functions ¶
Types ¶
type FetchTool ¶
type FetchTool struct{}
FetchTool implements web_fetch — GET a URL, render readable text. Stateless.
func (*FetchTool) Description ¶
func (*FetchTool) Schema ¶
func (t *FetchTool) Schema() json.RawMessage
type SearchTool ¶
type SearchTool struct{}
SearchTool implements web_search via the Tavily API. Stateless — the Tavily API key is read from config on each Execute so a host that rotates the key mid-session picks up the new value on the next call.
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
Click to show internal directories.
Click to hide internal directories.