Versions in this module Expand all Collapse all v0 v0.2.4 Oct 25, 2026 Changes in this version + const FinishToolName + const StateDone + const StateError + const StateIdle + const StateRunning + const StateStopped + func NewToolInfo(name, desc string, params map[string]any) (*schema.ToolInfo, error) + type CallOptionsBuilder interface + Build func(temperature float32) []model.Option + type Config struct + AutoNudgeText string + CallOptions CallOptionsBuilder + CostEstimator CostEstimator + DisableAutoNudge bool + DisableIterationTimeoutDecoupling bool + DisableStreaming bool + DoneDeliveryGrace time.Duration + ErrorClassifier ErrorClassifier + EventBuffer int + EventSink EventSink + FinishReviewPrompt string + HistoryCompactor HistoryCompactor + IdleChunkTimeout time.Duration + IterationReviewPrompt string + IterationTimeout time.Duration + MaxIterations int + MaxReopens int + ModelIdentity ModelIdentifier + Pauses map[string]pause.Handler + Reflect ReflectCondition + RetryMaxAttempts int + StopCondition StopCondition + StopInstructions string + StreamEvents bool + Temperature float64 + TotalTimeout time.Duration + TranscriptLogLevel slog.Level + func DefaultConfig() Config + type ConfigChange = state.Change + type CostEstimator interface + Estimate func(provider, model string, inputTokens, outputTokens int) float64 + type ErrorClassifier interface + IsTransient func(err error) bool + type EventSink interface + Write func(evt event.Event) + type HistoryCompactor interface + Compact func(msgs []*schema.Message) []*schema.Message + type Loop struct + func New(cfg Config, llm model.ToolCallingChatModel, tools []*schema.ToolInfo, ...) (*Loop, error) + func (l *Loop) Events() <-chan event.Event + func (l *Loop) Inject(message string) bool + func (l *Loop) Iteration() int + func (l *Loop) Messages() []*schema.Message + func (l *Loop) ModifyConfig(c ConfigChange) bool + func (l *Loop) Result() (event.DoneData, bool) + func (l *Loop) Start(ctx context.Context, messages []*schema.Message) <-chan event.Event + func (l *Loop) State() State + func (l *Loop) Stop() + func (l *Loop) Wait() + type ModelIdentifier interface + Identity func() (provider, model string) + type ReflectCondition int + const ReflectOff + const ReflectOnFinish + const ReflectOnIteration + type State = state.Status + type StopCondition int + const StopOnExternal + const StopOnFinishTool + const StopOnNoToolFinish + type ToolExecutor interface + ExecuteTool func(ctx context.Context, name, arguments string) (string, error)