Versions in this module Expand all Collapse all v1 v1.1.0 Jun 15, 2026 Changes in this version + func FormatResult(r *AgentResult) string + type AgentLoop struct + func NewAgentLoop(model chatmodel.BaseModel, registry *tools.ToolRegistry, opts ...Option) *AgentLoop + func (al *AgentLoop) Run(ctx context.Context, userMessage string) (*AgentResult, error) + func (al *AgentLoop) RunStream(ctx context.Context, userMessage string, ...) (*AgentResult, error) + type AgentResult struct + Answer string + Rounds int + Steps []*Step + Usage schema.Usage + type ExecStep struct + AgentResult *AgentResult + Duration time.Duration + Error string + PlanStep PlanStep + Status StepStatus + type Option func(*AgentLoop) + func WithMaxMessages(n int) Option + func WithMaxRounds(n int) Option + func WithStepCallback(fn func(step *Step)) Option + func WithSystemPrompt(prompt string) Option + type PlanExecutor struct + func NewPlanExecutor(model chatmodel.BaseModel, registry *tools.ToolRegistry, opts ...PlanOption) *PlanExecutor + func (pe *PlanExecutor) Run(ctx context.Context, goal string) (*PlanResult, error) + type PlanOption func(*PlanExecutor) + func WithPlanCallback(fn func(steps []PlanStep)) PlanOption + func WithPlanMaxPlanRounds(n int) PlanOption + func WithPlanMaxReplans(n int) PlanOption + func WithPlanMaxRoundsPerStep(n int) PlanOption + func WithPlanMaxSteps(n int) PlanOption + func WithPlanPersistPath(path string) PlanOption + func WithPlanStepCallback(fn func(step *ExecStep)) PlanOption + func WithPlanSystemPrompt(prompt string) PlanOption + type PlanResult struct + Answer string + PlanSteps []PlanStep + Replans int + Rounds int + Steps []*ExecStep + Usage schema.Usage + type PlanStep struct + DependsOn []string + Description string + ID string + type Step struct + Duration time.Duration + IsFinal bool + Response string + Round int + Thinking string + ToolCalls []schema.ToolCall + ToolResults []schema.ToolResult + type StepStatus string + const StepFailed + const StepPending + const StepRunning + const StepSkipped + const StepSuccess