Documentation ¶
Overview ¶
Package tool provides tools that agents can use to perform various operations.
Index ¶
- func Run(ctx context.Context, t schema.Tool, input *schema.ToolInput, ...) (string, error)
- func ToFunction(t schema.Tool) (*schema.FunctionDefinition, error)
- type CurrentPage
- type ExtractText
- type Human
- type HumanOptions
- type InputFunc
- type NavigateBrowser
- func (t *NavigateBrowser) ArgsType() reflect.Type
- func (t *NavigateBrowser) Callbacks() []schema.Callback
- func (t *NavigateBrowser) Description() string
- func (t *NavigateBrowser) Name() string
- func (t *NavigateBrowser) Run(ctx context.Context, input any) (string, error)
- func (t *NavigateBrowser) Verbose() bool
- type Options
- type PromptFunc
- type Sleep
- type Wikipedia
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToFunction ¶ added in v0.0.26
func ToFunction(t schema.Tool) (*schema.FunctionDefinition, error)
ToFunction formats a tool into a function API
Types ¶
type CurrentPage ¶ added in v0.0.24
type CurrentPage struct {
// contains filtered or unexported fields
}
func NewCurrentPage ¶ added in v0.0.24
func NewCurrentPage(browser playwright.Browser) *CurrentPage
func (*CurrentPage) ArgsType ¶ added in v0.0.29
func (t *CurrentPage) ArgsType() reflect.Type
ArgsType returns the type of the input argument expected by the tool.
func (*CurrentPage) Callbacks ¶ added in v0.0.30
func (t *CurrentPage) Callbacks() []schema.Callback
Callbacks returns the registered callbacks of the tool.
func (*CurrentPage) Description ¶ added in v0.0.24
func (t *CurrentPage) Description() string
Description returns the description of the tool.
func (*CurrentPage) Name ¶ added in v0.0.24
func (t *CurrentPage) Name() string
Name returns the name of the tool.
func (*CurrentPage) Run ¶ added in v0.0.24
Run executes the tool with the given input and returns the output.
func (*CurrentPage) Verbose ¶ added in v0.0.30
func (t *CurrentPage) Verbose() bool
Verbose returns the verbosity setting of the tool.
type ExtractText ¶ added in v0.0.24
type ExtractText struct {
// contains filtered or unexported fields
}
func NewExtractText ¶ added in v0.0.24
func NewExtractText(browser playwright.Browser) *ExtractText
func (*ExtractText) ArgsType ¶ added in v0.0.29
func (t *ExtractText) ArgsType() reflect.Type
ArgsType returns the type of the input argument expected by the tool.
func (*ExtractText) Callbacks ¶ added in v0.0.30
func (t *ExtractText) Callbacks() []schema.Callback
Callbacks returns the registered callbacks of the tool.
func (*ExtractText) Description ¶ added in v0.0.24
func (t *ExtractText) Description() string
Description returns the description of the tool.
func (*ExtractText) Name ¶ added in v0.0.24
func (t *ExtractText) Name() string
Name returns the name of the tool.
func (*ExtractText) Run ¶ added in v0.0.24
Run executes the tool with the given input and returns the output.
func (*ExtractText) Verbose ¶ added in v0.0.30
func (t *ExtractText) Verbose() bool
Verbose returns the verbosity setting of the tool.
type Human ¶ added in v0.0.35
type Human struct {
// contains filtered or unexported fields
}
Human is a tool that allows interaction with a human user.
func NewHuman ¶ added in v0.0.35
func NewHuman(optFns ...func(o *HumanOptions)) *Human
NewHuman creates a new instance of the Human tool with the provided options.
func (*Human) ArgsType ¶ added in v0.0.35
ArgsType returns the type of the input argument expected by the tool.
func (*Human) Description ¶ added in v0.0.35
Description returns the description of the tool.
type HumanOptions ¶ added in v0.0.35
type HumanOptions struct { // Function for displaying prompts. PromptFunc PromptFunc // Function for retrieving user input. InputFunc InputFunc }
HumanOptions contains options for configuring the Human tool.
type NavigateBrowser ¶ added in v0.0.24
type NavigateBrowser struct {
// contains filtered or unexported fields
}
func NewNavigateBrowser ¶ added in v0.0.24
func NewNavigateBrowser(browser playwright.Browser) *NavigateBrowser
func (*NavigateBrowser) ArgsType ¶ added in v0.0.29
func (t *NavigateBrowser) ArgsType() reflect.Type
ArgsType returns the type of the input argument expected by the tool.
func (*NavigateBrowser) Callbacks ¶ added in v0.0.30
func (t *NavigateBrowser) Callbacks() []schema.Callback
Callbacks returns the registered callbacks of the tool.
func (*NavigateBrowser) Description ¶ added in v0.0.24
func (t *NavigateBrowser) Description() string
Description returns the description of the tool.
func (*NavigateBrowser) Name ¶ added in v0.0.24
func (t *NavigateBrowser) Name() string
Name returns the name of the tool.
func (*NavigateBrowser) Run ¶ added in v0.0.24
Run executes the tool with the given input and returns the output.
func (*NavigateBrowser) Verbose ¶ added in v0.0.30
func (t *NavigateBrowser) Verbose() bool
Verbose returns the verbosity setting of the tool.
type PromptFunc ¶ added in v0.0.35
type PromptFunc = func(query string)
PromptFunc is a function type for displaying a prompt.
type Sleep ¶ added in v0.0.15
type Sleep struct{}
Sleep is a tool that makes the agent sleep for a specified number of seconds.
func NewSleep ¶ added in v0.0.15
func NewSleep() *Sleep
NewSleep creates a new instance of the Sleep tool.
func (*Sleep) ArgsType ¶ added in v0.0.29
ArgsType returns the type of the input argument expected by the tool.
func (*Sleep) Description ¶ added in v0.0.15
Description returns the description of the tool.
type Wikipedia ¶
type Wikipedia struct {
// contains filtered or unexported fields
}
func NewWikipedia ¶
func NewWikipedia(client *integration.Wikipedia) *Wikipedia
func (*Wikipedia) ArgsType ¶ added in v0.0.29
ArgsType returns the type of the input argument expected by the tool.
func (*Wikipedia) Callbacks ¶ added in v0.0.30
Callbacks returns the registered callbacks of the tool.
func (*Wikipedia) Description ¶
Description returns the description of the tool.