web

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 15 Imported by: 0

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

func Names

func Names() []tools.ToolName

Names lists every tool name this package contributes.

Types

type FetchTool

type FetchTool struct{}

FetchTool implements web_fetch — GET a URL, render readable text. Stateless.

func (*FetchTool) Description

func (t *FetchTool) Description() string

func (*FetchTool) Execute

func (t *FetchTool) Execute(ctx context.Context, logger *slog.Logger, input json.RawMessage) (tools.Result, error)

func (*FetchTool) Name

func (t *FetchTool) Name() string

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

Jump to

Keyboard shortcuts

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