Documentation
¶
Overview ¶
Package agent implements the core AI agent loop that powers autopilot. This file defines the Tool type and conversion to the Claude API format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the core orchestrator. It holds configuration, persistent memory, registered tools, and an HTTP client for calling Claude's API. The Run method implements the full agentic loop: prompt -> tool calls -> loop until Claude returns a final text response.
func (*Agent) Notify ¶
Notify logs a message. The router layer can override delivery to Discord/Telegram.
func (*Agent) RegisterTool ¶
RegisterTool adds a single tool the agent can invoke.
func (*Agent) RegisterTools ¶
RegisterTools adds multiple tools at once.
type ParameterDef ¶
type ParameterDef struct {
Type string `json:"type"`
Description string `json:"description"`
Required bool `json:"-"`
Enum []string `json:"enum,omitempty"`
}
ParameterDef describes a single parameter for a tool.
type Tool ¶
type Tool struct {
Name string
Description string
Parameters map[string]ParameterDef
Fn func(ctx context.Context, args map[string]any) (string, error)
}
Tool is a callable function the agent can invoke during a conversation. Modules register tools to give the agent capabilities like sending email, checking calendars, or searching the web.