Documentation
¶
Index ¶
- func ToolToSchema(tool Tool) map[string]interface{}
- type AppendFileTool
- type ContextualTool
- type CronTool
- func (t *CronTool) Description() string
- func (t *CronTool) Execute(ctx context.Context, args map[string]interface{}) (string, error)
- func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string
- func (t *CronTool) Name() string
- func (t *CronTool) Parameters() map[string]interface{}
- func (t *CronTool) SetContext(channel, chatID string)
- type EditFileTool
- type ExecTool
- func (t *ExecTool) Description() string
- func (t *ExecTool) Execute(ctx context.Context, args map[string]interface{}) (string, error)
- func (t *ExecTool) Name() string
- func (t *ExecTool) Parameters() map[string]interface{}
- func (t *ExecTool) SetAllowPatterns(patterns []string) error
- func (t *ExecTool) SetRestrictToWorkspace(restrict bool)
- func (t *ExecTool) SetTimeout(timeout time.Duration)
- type FunctionCall
- type JobExecutor
- type LLMProvider
- type LLMResponse
- type ListDirTool
- type Message
- type MessageTool
- func (t *MessageTool) Description() string
- func (t *MessageTool) Execute(ctx context.Context, args map[string]interface{}) (string, error)
- func (t *MessageTool) Name() string
- func (t *MessageTool) Parameters() map[string]interface{}
- func (t *MessageTool) SetContext(channel, chatID string)
- func (t *MessageTool) SetSendCallback(callback SendCallback)
- type ReadFileTool
- type SendCallback
- type SpawnTool
- type SubagentManager
- type SubagentTask
- type Tool
- type ToolCall
- type ToolDefinition
- type ToolFunctionDefinition
- type ToolRegistry
- func (r *ToolRegistry) Count() int
- func (r *ToolRegistry) Execute(ctx context.Context, name string, args map[string]interface{}) (string, error)
- func (r *ToolRegistry) ExecuteWithContext(ctx context.Context, name string, args map[string]interface{}, ...) (string, error)
- func (r *ToolRegistry) Get(name string) (Tool, bool)
- func (r *ToolRegistry) GetDefinitions() []map[string]interface{}
- func (r *ToolRegistry) GetSummaries() []string
- func (r *ToolRegistry) List() []string
- func (r *ToolRegistry) Register(tool Tool)
- type UsageInfo
- type WebFetchTool
- type WebSearchTool
- type WriteFileTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToolToSchema ¶
Types ¶
type AppendFileTool ¶
type AppendFileTool struct {
// contains filtered or unexported fields
}
func NewAppendFileTool ¶
func NewAppendFileTool(workspace string, restrict bool) *AppendFileTool
func (*AppendFileTool) Description ¶
func (t *AppendFileTool) Description() string
func (*AppendFileTool) Name ¶
func (t *AppendFileTool) Name() string
func (*AppendFileTool) Parameters ¶
func (t *AppendFileTool) Parameters() map[string]interface{}
type ContextualTool ¶ added in v0.1.1
ContextualTool is an optional interface that tools can implement to receive the current message context (channel, chatID)
type CronTool ¶ added in v0.1.1
type CronTool struct {
// contains filtered or unexported fields
}
CronTool provides scheduling capabilities for the agent
func NewCronTool ¶ added in v0.1.1
func NewCronTool(cronService *cron.CronService, executor JobExecutor, msgBus *bus.MessageBus, workspace string) *CronTool
NewCronTool creates a new CronTool
func (*CronTool) Description ¶ added in v0.1.1
Description returns the tool description
func (*CronTool) ExecuteJob ¶ added in v0.1.1
ExecuteJob executes a cron job through the agent
func (*CronTool) Parameters ¶ added in v0.1.1
Parameters returns the tool parameters schema
func (*CronTool) SetContext ¶ added in v0.1.1
SetContext sets the current session context for job creation
type EditFileTool ¶
type EditFileTool struct {
// contains filtered or unexported fields
}
EditFileTool edits a file by replacing old_text with new_text. The old_text must exist exactly in the file.
func NewEditFileTool ¶
func NewEditFileTool(allowedDir string, restrict bool) *EditFileTool
NewEditFileTool creates a new EditFileTool with optional directory restriction.
func (*EditFileTool) Description ¶
func (t *EditFileTool) Description() string
func (*EditFileTool) Name ¶
func (t *EditFileTool) Name() string
func (*EditFileTool) Parameters ¶
func (t *EditFileTool) Parameters() map[string]interface{}
type ExecTool ¶
type ExecTool struct {
// contains filtered or unexported fields
}
func NewExecTool ¶
func (*ExecTool) Description ¶
func (*ExecTool) Parameters ¶
func (*ExecTool) SetAllowPatterns ¶
func (*ExecTool) SetRestrictToWorkspace ¶
func (*ExecTool) SetTimeout ¶
type FunctionCall ¶
type JobExecutor ¶ added in v0.1.1
type JobExecutor interface {
ProcessDirectWithChannel(ctx context.Context, content, sessionKey, channel, chatID string) (string, error)
}
JobExecutor is the interface for executing cron jobs through the agent
type LLMProvider ¶
type LLMProvider interface {
Chat(ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]interface{}) (*LLMResponse, error)
GetDefaultModel() string
}
type LLMResponse ¶
type ListDirTool ¶
type ListDirTool struct {
// contains filtered or unexported fields
}
func NewListDirTool ¶ added in v0.1.1
func NewListDirTool(workspace string, restrict bool) *ListDirTool
func (*ListDirTool) Description ¶
func (t *ListDirTool) Description() string
func (*ListDirTool) Name ¶
func (t *ListDirTool) Name() string
func (*ListDirTool) Parameters ¶
func (t *ListDirTool) Parameters() map[string]interface{}
type MessageTool ¶
type MessageTool struct {
// contains filtered or unexported fields
}
func NewMessageTool ¶
func NewMessageTool() *MessageTool
func (*MessageTool) Description ¶
func (t *MessageTool) Description() string
func (*MessageTool) Name ¶
func (t *MessageTool) Name() string
func (*MessageTool) Parameters ¶
func (t *MessageTool) Parameters() map[string]interface{}
func (*MessageTool) SetContext ¶
func (t *MessageTool) SetContext(channel, chatID string)
func (*MessageTool) SetSendCallback ¶
func (t *MessageTool) SetSendCallback(callback SendCallback)
type ReadFileTool ¶
type ReadFileTool struct {
// contains filtered or unexported fields
}
func NewReadFileTool ¶ added in v0.1.1
func NewReadFileTool(workspace string, restrict bool) *ReadFileTool
func (*ReadFileTool) Description ¶
func (t *ReadFileTool) Description() string
func (*ReadFileTool) Name ¶
func (t *ReadFileTool) Name() string
func (*ReadFileTool) Parameters ¶
func (t *ReadFileTool) Parameters() map[string]interface{}
type SendCallback ¶
type SpawnTool ¶
type SpawnTool struct {
// contains filtered or unexported fields
}
func NewSpawnTool ¶
func NewSpawnTool(manager *SubagentManager) *SpawnTool
func (*SpawnTool) Description ¶
func (*SpawnTool) Parameters ¶
func (*SpawnTool) SetContext ¶
type SubagentManager ¶
type SubagentManager struct {
// contains filtered or unexported fields
}
func NewSubagentManager ¶
func NewSubagentManager(provider providers.LLMProvider, workspace string, bus *bus.MessageBus) *SubagentManager
func (*SubagentManager) GetTask ¶
func (sm *SubagentManager) GetTask(taskID string) (*SubagentTask, bool)
func (*SubagentManager) ListTasks ¶
func (sm *SubagentManager) ListTasks() []*SubagentTask
type SubagentTask ¶
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function *FunctionCall `json:"function,omitempty"`
Name string `json:"name,omitempty"`
Arguments map[string]interface{} `json:"arguments,omitempty"`
}
type ToolDefinition ¶
type ToolDefinition struct {
Type string `json:"type"`
Function ToolFunctionDefinition `json:"function"`
}
type ToolFunctionDefinition ¶
type ToolRegistry ¶
type ToolRegistry struct {
// contains filtered or unexported fields
}
func NewToolRegistry ¶
func NewToolRegistry() *ToolRegistry
func (*ToolRegistry) Count ¶ added in v0.1.1
func (r *ToolRegistry) Count() int
Count returns the number of registered tools.
func (*ToolRegistry) ExecuteWithContext ¶ added in v0.1.1
func (*ToolRegistry) GetDefinitions ¶
func (r *ToolRegistry) GetDefinitions() []map[string]interface{}
func (*ToolRegistry) GetSummaries ¶ added in v0.1.1
func (r *ToolRegistry) GetSummaries() []string
GetSummaries returns human-readable summaries of all registered tools. Returns a slice of "name - description" strings.
func (*ToolRegistry) List ¶ added in v0.1.1
func (r *ToolRegistry) List() []string
List returns a list of all registered tool names.
func (*ToolRegistry) Register ¶
func (r *ToolRegistry) Register(tool Tool)
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
func NewWebFetchTool ¶
func NewWebFetchTool(maxChars int) *WebFetchTool
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
func (*WebFetchTool) Parameters ¶
func (t *WebFetchTool) Parameters() map[string]interface{}
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
func NewWebSearchTool ¶
func NewWebSearchTool(apiKey string, maxResults int) *WebSearchTool
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
func (*WebSearchTool) Parameters ¶
func (t *WebSearchTool) Parameters() map[string]interface{}
type WriteFileTool ¶
type WriteFileTool struct {
// contains filtered or unexported fields
}
func NewWriteFileTool ¶ added in v0.1.1
func NewWriteFileTool(workspace string, restrict bool) *WriteFileTool
func (*WriteFileTool) Description ¶
func (t *WriteFileTool) Description() string
func (*WriteFileTool) Name ¶
func (t *WriteFileTool) Name() string
func (*WriteFileTool) Parameters ¶
func (t *WriteFileTool) Parameters() map[string]interface{}