Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BochaOption ¶ added in v0.3.2
type BochaOption func(*BochaSearch)
func WithBochaBaseURL ¶ added in v0.3.2
func WithBochaBaseURL(url string) BochaOption
WithBochaBaseURL sets the base URL for the Bocha API.
func WithBochaCount ¶ added in v0.3.2
func WithBochaCount(count int) BochaOption
WithBochaCount sets the number of results to return.
func WithBochaFreshness ¶ added in v0.3.2
func WithBochaFreshness(freshness string) BochaOption
WithBochaFreshness sets the freshness filter for the search. Valid values: "oneDay", "oneWeek", "oneMonth", "oneYear", "noLimit".
func WithBochaSummary ¶ added in v0.3.2
func WithBochaSummary(summary bool) BochaOption
WithBochaSummary sets whether to return a summary.
type BochaSearch ¶ added in v0.3.2
BochaSearch is a tool that uses the Bocha API to search the web.
func NewBochaSearch ¶ added in v0.3.2
func NewBochaSearch(apiKey string, opts ...BochaOption) (*BochaSearch, error)
NewBochaSearch creates a new BochaSearch tool. If apiKey is empty, it tries to read from BOCHA_API_KEY environment variable.
func (*BochaSearch) Description ¶ added in v0.3.2
func (b *BochaSearch) Description() string
Description returns the description of the tool.
func (*BochaSearch) Name ¶ added in v0.3.2
func (b *BochaSearch) Name() string
Name returns the name of the tool.
type BraveOption ¶ added in v0.3.2
type BraveOption func(*BraveSearch)
func WithBraveBaseURL ¶ added in v0.3.2
func WithBraveBaseURL(baseURL string) BraveOption
WithBraveBaseURL sets the base URL for the Brave Search API.
func WithBraveCount ¶ added in v0.3.2
func WithBraveCount(count int) BraveOption
WithBraveCount sets the number of results to return (1-20).
func WithBraveCountry ¶ added in v0.3.2
func WithBraveCountry(country string) BraveOption
WithBraveCountry sets the country code for search results (e.g., "US", "CN").
func WithBraveLang ¶ added in v0.3.2
func WithBraveLang(lang string) BraveOption
WithBraveLang sets the language code for search results (e.g., "en", "zh").
type BraveSearch ¶ added in v0.3.2
BraveSearch is a tool that uses the Brave Search API to search the web.
func NewBraveSearch ¶ added in v0.3.2
func NewBraveSearch(apiKey string, opts ...BraveOption) (*BraveSearch, error)
NewBraveSearch creates a new BraveSearch tool. If apiKey is empty, it tries to read from BRAVE_API_KEY environment variable.
func (*BraveSearch) Description ¶ added in v0.3.2
func (b *BraveSearch) Description() string
Description returns the description of the tool.
func (*BraveSearch) Name ¶ added in v0.3.2
func (b *BraveSearch) Name() string
Name returns the name of the tool.
type ExaOption ¶
type ExaOption func(*ExaSearch)
func WithExaBaseURL ¶
WithExaBaseURL sets the base URL for the Exa API.
func WithExaNumResults ¶
WithExaNumResults sets the number of results to return.
type ExaSearch ¶
ExaSearch is a tool that uses the Exa API to search the web.
func NewExaSearch ¶
NewExaSearch creates a new ExaSearch tool. If apiKey is empty, it tries to read from EXA_API_KEY environment variable.
func (*ExaSearch) Description ¶
Description returns the description of the tool.
type SearchResult ¶ added in v0.3.2
SearchResult represents a single search result with images
type TavilyOption ¶
type TavilyOption func(*TavilySearch)
func WithTavilyBaseURL ¶
func WithTavilyBaseURL(url string) TavilyOption
WithTavilyBaseURL sets the base URL for the Tavily API.
func WithTavilySearchDepth ¶
func WithTavilySearchDepth(depth string) TavilyOption
WithTavilySearchDepth sets the search depth for the Tavily API. Valid values are "basic" and "advanced".
type TavilySearch ¶
TavilySearch is a tool that uses the Tavily API to search the web.
func NewTavilySearch ¶
func NewTavilySearch(apiKey string, opts ...TavilyOption) (*TavilySearch, error)
NewTavilySearch creates a new TavilySearch tool. If apiKey is empty, it tries to read from TAVILY_API_KEY environment variable.
func (*TavilySearch) CallWithImages ¶ added in v0.3.2
func (t *TavilySearch) CallWithImages(ctx context.Context, input string) (*SearchResult, error)
CallWithImages executes the search and returns both text and images.
func (*TavilySearch) Description ¶
func (t *TavilySearch) Description() string
Description returns the description of the tool.