Documentation
¶
Index ¶
- type CalculatorTool
- func (t *CalculatorTool) Execute(ctx context.Context, args string) (string, error)
- func (t *CalculatorTool) GetConfig() map[string]interface{}
- func (t *CalculatorTool) GetDefinition() llm.ToolDefinition
- func (t *CalculatorTool) GetDescription() string
- func (t *CalculatorTool) GetName() string
- func (t *CalculatorTool) SetConfig(config map[string]interface{}) error
- func (t *CalculatorTool) Validate(args string) error
- type FileListTool
- func (t *FileListTool) Execute(ctx context.Context, args string) (string, error)
- func (t *FileListTool) GetConfig() map[string]interface{}
- func (t *FileListTool) GetDefinition() llm.ToolDefinition
- func (t *FileListTool) GetDescription() string
- func (t *FileListTool) GetName() string
- func (t *FileListTool) SetConfig(config map[string]interface{}) error
- func (t *FileListTool) Validate(args string) error
- type FileReadTool
- func (t *FileReadTool) Execute(ctx context.Context, args string) (string, error)
- func (t *FileReadTool) GetConfig() map[string]interface{}
- func (t *FileReadTool) GetDefinition() llm.ToolDefinition
- func (t *FileReadTool) GetDescription() string
- func (t *FileReadTool) GetName() string
- func (t *FileReadTool) SetConfig(config map[string]interface{}) error
- func (t *FileReadTool) Validate(args string) error
- type FileWriteTool
- func (t *FileWriteTool) Execute(ctx context.Context, args string) (string, error)
- func (t *FileWriteTool) GetConfig() map[string]interface{}
- func (t *FileWriteTool) GetDefinition() llm.ToolDefinition
- func (t *FileWriteTool) GetDescription() string
- func (t *FileWriteTool) GetName() string
- func (t *FileWriteTool) SetConfig(config map[string]interface{}) error
- func (t *FileWriteTool) Validate(args string) error
- type HTTPTool
- func (t *HTTPTool) Execute(ctx context.Context, args string) (string, error)
- func (t *HTTPTool) GetConfig() map[string]interface{}
- func (t *HTTPTool) GetDefinition() llm.ToolDefinition
- func (t *HTTPTool) GetDescription() string
- func (t *HTTPTool) GetName() string
- func (t *HTTPTool) SetConfig(config map[string]interface{}) error
- func (t *HTTPTool) Validate(args string) error
- type ShellTool
- func (t *ShellTool) Execute(ctx context.Context, args string) (string, error)
- func (t *ShellTool) GetConfig() map[string]interface{}
- func (t *ShellTool) GetDefinition() llm.ToolDefinition
- func (t *ShellTool) GetDescription() string
- func (t *ShellTool) GetName() string
- func (t *ShellTool) SetConfig(config map[string]interface{}) error
- func (t *ShellTool) Validate(args string) error
- type TimeTool
- func (t *TimeTool) Execute(ctx context.Context, args string) (string, error)
- func (t *TimeTool) GetConfig() map[string]interface{}
- func (t *TimeTool) GetDefinition() llm.ToolDefinition
- func (t *TimeTool) GetDescription() string
- func (t *TimeTool) GetName() string
- func (t *TimeTool) SetConfig(config map[string]interface{}) error
- func (t *TimeTool) Validate(args string) error
- type Tool
- type ToolRegistry
- func (tr *ToolRegistry) GetAllDefinitions() []llm.ToolDefinition
- func (tr *ToolRegistry) GetDefinitions(toolNames []string) []llm.ToolDefinition
- func (tr *ToolRegistry) GetTool(name string) (Tool, bool)
- func (tr *ToolRegistry) ListTools() []string
- func (tr *ToolRegistry) RegisterTool(tool Tool) error
- func (tr *ToolRegistry) UnregisterTool(name string) error
- type WebSearchTool
- func (t *WebSearchTool) Execute(ctx context.Context, args string) (string, error)
- func (t *WebSearchTool) GetConfig() map[string]interface{}
- func (t *WebSearchTool) GetDefinition() llm.ToolDefinition
- func (t *WebSearchTool) GetDescription() string
- func (t *WebSearchTool) GetName() string
- func (t *WebSearchTool) SetConfig(config map[string]interface{}) error
- func (t *WebSearchTool) Validate(args string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalculatorTool ¶
type CalculatorTool struct{}
CalculatorTool implements basic mathematical calculations
func NewCalculatorTool ¶
func NewCalculatorTool() *CalculatorTool
NewCalculatorTool creates a new calculator tool
func (*CalculatorTool) GetConfig ¶
func (t *CalculatorTool) GetConfig() map[string]interface{}
func (*CalculatorTool) GetDefinition ¶
func (t *CalculatorTool) GetDefinition() llm.ToolDefinition
func (*CalculatorTool) GetDescription ¶
func (t *CalculatorTool) GetDescription() string
func (*CalculatorTool) GetName ¶
func (t *CalculatorTool) GetName() string
func (*CalculatorTool) SetConfig ¶
func (t *CalculatorTool) SetConfig(config map[string]interface{}) error
func (*CalculatorTool) Validate ¶
func (t *CalculatorTool) Validate(args string) error
type FileListTool ¶
type FileListTool struct {
// contains filtered or unexported fields
}
FileListTool implements directory listing functionality
func NewFileListTool ¶
func NewFileListTool() *FileListTool
NewFileListTool creates a new file list tool
func (*FileListTool) GetConfig ¶
func (t *FileListTool) GetConfig() map[string]interface{}
func (*FileListTool) GetDefinition ¶
func (t *FileListTool) GetDefinition() llm.ToolDefinition
func (*FileListTool) GetDescription ¶
func (t *FileListTool) GetDescription() string
func (*FileListTool) GetName ¶
func (t *FileListTool) GetName() string
func (*FileListTool) SetConfig ¶
func (t *FileListTool) SetConfig(config map[string]interface{}) error
func (*FileListTool) Validate ¶
func (t *FileListTool) Validate(args string) error
type FileReadTool ¶
type FileReadTool struct {
// contains filtered or unexported fields
}
FileReadTool implements file reading functionality
func NewFileReadTool ¶
func NewFileReadTool() *FileReadTool
NewFileReadTool creates a new file read tool
func (*FileReadTool) GetConfig ¶
func (t *FileReadTool) GetConfig() map[string]interface{}
func (*FileReadTool) GetDefinition ¶
func (t *FileReadTool) GetDefinition() llm.ToolDefinition
func (*FileReadTool) GetDescription ¶
func (t *FileReadTool) GetDescription() string
func (*FileReadTool) GetName ¶
func (t *FileReadTool) GetName() string
func (*FileReadTool) SetConfig ¶
func (t *FileReadTool) SetConfig(config map[string]interface{}) error
func (*FileReadTool) Validate ¶
func (t *FileReadTool) Validate(args string) error
type FileWriteTool ¶
type FileWriteTool struct {
// contains filtered or unexported fields
}
FileWriteTool implements file writing functionality
func NewFileWriteTool ¶
func NewFileWriteTool() *FileWriteTool
NewFileWriteTool creates a new file write tool
func (*FileWriteTool) GetConfig ¶
func (t *FileWriteTool) GetConfig() map[string]interface{}
func (*FileWriteTool) GetDefinition ¶
func (t *FileWriteTool) GetDefinition() llm.ToolDefinition
func (*FileWriteTool) GetDescription ¶
func (t *FileWriteTool) GetDescription() string
func (*FileWriteTool) GetName ¶
func (t *FileWriteTool) GetName() string
func (*FileWriteTool) SetConfig ¶
func (t *FileWriteTool) SetConfig(config map[string]interface{}) error
func (*FileWriteTool) Validate ¶
func (t *FileWriteTool) Validate(args string) error
type HTTPTool ¶
type HTTPTool struct {
// contains filtered or unexported fields
}
HTTPTool implements HTTP request functionality
func (*HTTPTool) GetDefinition ¶
func (t *HTTPTool) GetDefinition() llm.ToolDefinition
func (*HTTPTool) GetDescription ¶
type ShellTool ¶
type ShellTool struct {
// contains filtered or unexported fields
}
ShellTool implements shell command execution
func (*ShellTool) GetDefinition ¶
func (t *ShellTool) GetDefinition() llm.ToolDefinition
func (*ShellTool) GetDescription ¶
type TimeTool ¶
type TimeTool struct{}
TimeTool implements time-related functionality
func (*TimeTool) GetDefinition ¶
func (t *TimeTool) GetDefinition() llm.ToolDefinition
func (*TimeTool) GetDescription ¶
type Tool ¶
type Tool interface {
// GetName returns the tool name
GetName() string
// GetDescription returns the tool description
GetDescription() string
// GetDefinition returns the LLM tool definition
GetDefinition() llm.ToolDefinition
// Execute executes the tool with the given arguments
Execute(ctx context.Context, args string) (string, error)
// Validate validates the tool arguments
Validate(args string) error
// GetConfig returns the tool configuration
GetConfig() map[string]interface{}
// SetConfig updates the tool configuration
SetConfig(config map[string]interface{}) error
}
Tool represents a tool that can be executed by agents
type ToolRegistry ¶
type ToolRegistry struct {
// contains filtered or unexported fields
}
ToolRegistry manages a collection of tools
func NewToolRegistry ¶
func NewToolRegistry() *ToolRegistry
NewToolRegistry creates a new tool registry
func (*ToolRegistry) GetAllDefinitions ¶
func (tr *ToolRegistry) GetAllDefinitions() []llm.ToolDefinition
GetAllDefinitions returns all tool definitions for LLM
func (*ToolRegistry) GetDefinitions ¶
func (tr *ToolRegistry) GetDefinitions(toolNames []string) []llm.ToolDefinition
GetDefinitions returns tool definitions for specific tools
func (*ToolRegistry) GetTool ¶
func (tr *ToolRegistry) GetTool(name string) (Tool, bool)
GetTool returns a tool by name
func (*ToolRegistry) ListTools ¶
func (tr *ToolRegistry) ListTools() []string
ListTools returns all registered tool names
func (*ToolRegistry) RegisterTool ¶
func (tr *ToolRegistry) RegisterTool(tool Tool) error
RegisterTool registers a tool
func (*ToolRegistry) UnregisterTool ¶
func (tr *ToolRegistry) UnregisterTool(name string) error
UnregisterTool unregisters a tool
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool implements web search functionality
func NewWebSearchTool ¶
func NewWebSearchTool() *WebSearchTool
NewWebSearchTool creates a new web search tool
func (*WebSearchTool) GetConfig ¶
func (t *WebSearchTool) GetConfig() map[string]interface{}
func (*WebSearchTool) GetDefinition ¶
func (t *WebSearchTool) GetDefinition() llm.ToolDefinition
func (*WebSearchTool) GetDescription ¶
func (t *WebSearchTool) GetDescription() string
func (*WebSearchTool) GetName ¶
func (t *WebSearchTool) GetName() string
func (*WebSearchTool) SetConfig ¶
func (t *WebSearchTool) SetConfig(config map[string]interface{}) error
func (*WebSearchTool) Validate ¶
func (t *WebSearchTool) Validate(args string) error