websearch

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Tool)

Option represents an option for configuring the tool

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client for the tool

type Tool

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

Tool implements a web search tool

func New

func New(apiKey, engineID string, options ...Option) *Tool

New creates a new web search tool

func (*Tool) Description

func (t *Tool) Description() string

Description returns a description of what the tool does

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args string) (string, error)

func (*Tool) Name

func (t *Tool) Name() string

Name returns the name of the tool

func (*Tool) Parameters

func (t *Tool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the parameters that the tool accepts

func (*Tool) Run

func (t *Tool) Run(ctx context.Context, input string) (string, error)

Run executes the tool with the given input

Jump to

Keyboard shortcuts

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