websearch

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package websearch provides a tool for searching the web via DuckDuckGo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	// Query is the search query string.
	Query string `json:"query" jsonschema:"required,description=Search query" validate:"required"`
	// MaxResults is the number of results to return (default 5, max 20).
	MaxResults int `json:"max_results,omitempty" jsonschema:"description=Number of results (default 5, max 20)"`
}

Inputs defines the parameters for the WebSearch tool.

type Tool

type Tool struct {
	tool.Base
	// contains filtered or unexported fields
}

Tool implements web search via DuckDuckGo Lite.

func New

func New() *Tool

New creates a WebSearch tool.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args map[string]any) (string, error)

Execute performs a DuckDuckGo Lite search and returns formatted results.

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool's identifier.

func (*Tool) Sandboxable

func (t *Tool) Sandboxable() bool

Sandboxable returns false because the tool makes network calls.

func (*Tool) Schema

func (t *Tool) Schema() tool.Schema

Schema returns the provider-agnostic tool definition.

Jump to

Keyboard shortcuts

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