Documentation
¶
Index ¶
- type Instance
- func (i *Instance) Agent() *agent.Agent
- func (i *Instance) Chat(ctx context.Context, message string) (*agent.Response, error)
- func (i *Instance) Memory() memory.Memory
- func (i *Instance) Registry() *tools.Registry
- func (i *Instance) Run(ctx context.Context, prompt string) (*agent.Response, error)
- func (i *Instance) RunWithHandler(ctx context.Context, prompt string, h agent.EventHandler) (*agent.Response, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is an embedded Krew agent ready to be invoked in-process.
type Options ¶
type Options struct {
// Workspace is the working root path for file tools and command execution.
// Defaults to current working directory if empty.
Workspace string
// Persona provides system instructions and role definition.
// Defaults to persona.CodingAssistant if nil.
Persona *persona.Persona
// SystemPrompt optionally overrides the persona instructions.
SystemPrompt string
// Provider is the LLM inference provider (Gemini, OpenAI, Anthropic, Ollama, etc.).
// If nil, New() attempts auto-detection via environment variables.
Provider ai.Provider
// Model specifies the target model name (e.g. "gemini-2.5-flash", "gpt-4o", "claude-3-7-sonnet").
Model string
// MaxSteps is the safety limit on reasoning-action loops per turn. Default: 25.
MaxSteps int
// CustomTools allows adding extra tools beyond the standard workspace tool suite.
CustomTools []tools.Tool
// DisableDefaultTools prevents loading standard filesystem, execution, and web tools.
DisableDefaultTools bool
// Memory optionally overrides the default sliding-window memory buffer.
Memory memory.Memory
// Approver handles interactive approval gates for destructive operations.
Approver agent.Approver
// OnEvent receives streaming lifecycle events (thoughts, tool calls, results).
OnEvent agent.EventHandler
}
Options holds configuration for embedding a Krew agent.
Click to show internal directories.
Click to hide internal directories.