Documentation
¶
Index ¶
- func SetDelegateFn(fn func(ctx context.Context, role, request string) (string, error))
- func SetSandboxProvider(sp sandbox.Provider)
- func WithChromePath(path string) func(*browserTool)
- func WithHeadless(headless bool) func(*browserTool)
- func WithTabTimeout(d time.Duration) func(*browserTool)
- type Base
- type Tool
- func AskAgentTool() Tool
- func AskHumanTool() Tool
- func BrowserTool(headless bool, opts ...func(*browserTool)) Tool
- func CalculatorTool() Tool
- func CodeInterpreterTool() Tool
- func DelegateToAgentTool() Tool
- func DelegateWorkTool() Tool
- func New(name, description string, params map[string]any, ...) Tool
- func ReadFileTool() Tool
- func ShellTool() Tool
- func WebSearchTool(apiKey string) Tool
- func WriteFileTool() Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDelegateFn ¶ added in v0.2.0
SetDelegateFn sets the delegate function used by DelegateToAgentTool.
func SetSandboxProvider ¶ added in v0.3.0
SetSandboxProvider sets the sandbox provider used by CodeInterpreterTool.
func WithChromePath ¶ added in v0.4.0
func WithChromePath(path string) func(*browserTool)
WithChromePath sets a custom Chrome/Chromium binary path.
func WithHeadless ¶ added in v0.4.0
func WithHeadless(headless bool) func(*browserTool)
WithHeadless overrides the headless mode after construction. Pass false to show the browser window (useful for debugging).
func WithTabTimeout ¶ added in v0.4.0
WithTabTimeout sets the per-action timeout (default 30s).
Types ¶
type Base ¶
type Base struct {
ToolName string
Desc string
Params map[string]any
ExecuteFn func(ctx context.Context, args map[string]any) (string, error)
}
Base provides a default implementation of the Tool interface.
func (*Base) Description ¶
Description returns the tool's description.
func (*Base) Parameters ¶
Parameters returns the tool's JSON schema parameters.
type Tool ¶
type Tool interface {
Name() string
Description() string
Parameters() map[string]any
Execute(ctx context.Context, args map[string]any) (string, error)
}
Tool is the interface that all tools must implement.
func AskAgentTool ¶ added in v0.2.0
func AskAgentTool() Tool
AskAgentTool creates a tool that asks another agent a question via A2A.
func AskHumanTool ¶
func AskHumanTool() Tool
AskHumanTool creates a tool that asks a human for input or approval.
func BrowserTool ¶ added in v0.4.0
BrowserTool creates a new browser automation tool. headless=false enables visible Chrome mode for debugging. Options: WithChromePath, WithTabTimeout, WithHeadless. Actions: navigate(url), click(selector), type(selector,text), extract_text(selector), extract_html(selector), screenshot(), scroll(direction=down|up).
func CalculatorTool ¶
func CalculatorTool() Tool
CalculatorTool creates a tool that evaluates mathematical expressions.
func CodeInterpreterTool ¶ added in v0.3.0
func CodeInterpreterTool() Tool
CodeInterpreterTool creates a tool that executes code using the configured sandbox.
func DelegateToAgentTool ¶ added in v0.2.0
func DelegateToAgentTool() Tool
DelegateToAgentTool creates a tool that delegates a task to another agent via A2A.
func DelegateWorkTool ¶
func DelegateWorkTool() Tool
DelegateWorkTool creates a tool that delegates a task to another agent.
func New ¶
func New(name, description string, params map[string]any, fn func(ctx context.Context, args map[string]any) (string, error)) Tool
New creates a new Tool with the given name, description, parameters, and execute function.
func ReadFileTool ¶
func ReadFileTool() Tool
ReadFileTool creates a tool that reads the contents of a file.
func ShellTool ¶
func ShellTool() Tool
ShellTool creates a tool that executes shell commands on the local system.
func WebSearchTool ¶
WebSearchTool creates a tool that searches the web for current information.
func WriteFileTool ¶
func WriteFileTool() Tool
WriteFileTool creates a tool that writes content to a file.