NewAgent creates a new agent from the given configuration.
type CompactionPrep
CompactionPrep describes the state passed to BeforeCompact.
typeCompactionPrep=agent.CompactionPrep
type CompactionResult
CompactionResult can be returned by BeforeCompact to provide a custom summary.
typeCompactionResult=agent.CompactionResult
type Config
Config holds the options for creating a new agent.
typeConfigstruct{// Provider selects the LLM backend: "ollama" (default), "openai", or "anthropic".Providerstring// Model is the model name to use (e.g. "llama3", "gpt-4o", "claude-sonnet-4-6").Modelstring// OllamaURL overrides the Ollama base URL (default: http://localhost:11434).OllamaURLstring// OpenAIURL overrides the OpenAI-compatible base URL.OpenAIURLstring// OpenAIKey is the API key for OpenAI or any compatible provider.OpenAIKeystring// AnthropicKey is the Anthropic API key.AnthropicKeystring// SystemPrompt sets the agent's system prompt.SystemPromptstring// ThinkingLevel controls reasoning depth.ThinkingLevelThinkingLevel// MaxTokens caps the response length (0 = provider default).MaxTokensint// DryRun mode prevents tools from performing destructive actions.DryRunbool// Tools registers additional tools beyond the builtins.// Pass tools.Read{}, tools.Write{}, tools.Bash{}, etc.Tools[]Tool// Extensions registers active extensions (gRPC plugins or Skills).Extensions[]Extension}
type Event
Event is an agent lifecycle event emitted to subscribers.
typeEvent=agent.Event
type EventType
EventType identifies the kind of event.
typeEventType=agent.EventType
type Extension
Extension is the interface for agent extensions (gRPC plugins, skills, etc.).
typeExtension=agent.Extension
type InputAction
InputAction controls how ModifyInput’s result is applied.