bocha

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingToken = errors.New("missing the bocha API key, set it in the BOCHA_API_KEY environment variable")

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithAPIKey

func WithAPIKey(apiKey string) Option

WithAPIKey passes the bocha API token to the client. If not set, the token is read from the BOCHA_API_KEY environment variable.

func WithCount

func WithCount(count uint) Option

WithCount set the number of search result

func WithDebug

func WithDebug(debug bool) Option

WithDebug Enable debug mode

type Tool

type Tool struct {
	CallbacksHandler callbacks.Handler
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Tool, error)

New creates a new bocha tool to search on internet.

func (Tool) Call

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

func (Tool) Description

func (t Tool) Description() string

func (Tool) Name

func (t Tool) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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