webfetch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolName = "web_fetch"
)

Variables

This section is empty.

Functions

func Register

func Register(registry *tool.Registry, opts ...Option) error

Types

type Option

type Option func(*Tool)

func WithAllowPrivateNetwork

func WithAllowPrivateNetwork(allow bool) Option

WithAllowPrivateNetwork lifts the default block on loopback / private / link-local / unspecified / multicast destinations. Off by default — turn it on only for trusted, internal-only deployments where SSRF risk is acceptable.

func WithAllowedDomains

func WithAllowedDomains(domains ...string) Option

func WithBlockedDomains

func WithBlockedDomains(domains ...string) Option

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

func WithMaxContentChars

func WithMaxContentChars(n int) Option

func WithMaxResponseBytes

func WithMaxResponseBytes(n int64) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Tool

func (*Tool) Handler

func (t *Tool) Handler() tool.ToolHandler

func (*Tool) ToolDef

func (t *Tool) ToolDef() schema.ToolDef

Jump to

Keyboard shortcuts

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