Documentation
¶
Index ¶
- func SetDelegateFn(fn func(ctx context.Context, role, request string) (string, error))
- type Base
- type Tool
- func AskAgentTool() Tool
- func AskHumanTool() Tool
- func CalculatorTool() 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 ¶
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 CalculatorTool ¶
func CalculatorTool() Tool
CalculatorTool creates a tool that evaluates mathematical expressions.
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.