Versions in this module Expand all Collapse all v0 v0.1.3 Aug 22, 2026 v0.1.2 Jul 27, 2026 v0.1.1 Jun 11, 2026 Changes in this version type AgentToolResult + Meta map[string]string v0.1.0 Jun 10, 2026 Changes in this version type AgentLoopConfig + GetAPIKey func(provider string) (string, error) type AgentOptions + GetAPIKey func(provider string) (string, error) v0.0.2 Jun 9, 2026 v0.0.1 Jun 9, 2026 Changes in this version + const AutoResumeMarker + const ThinkingHigh + const ThinkingLow + const ThinkingMax + const ThinkingMedium + const ThinkingMinimal + const ThinkingOff + const ThinkingXHigh + var CanonicalThinkingLadder = []ThinkingLevel + var DefaultStreamFn func(ctx context.Context) StreamFn + func DefaultConvertToLLM(messages []AgentMessage) ([]core.Message, error) + func IsCanonicalThinkingLevel(l ThinkingLevel) bool + func ToAIThinkingLevel(t ThinkingLevel) core.ThinkingLevel + func ValidPriority(p string) bool + func ValidStatus(s string) bool + type Agent struct + func NewAgent(opts AgentOptions) *Agent + func (a *Agent) Abort() + func (a *Agent) AppendMessage(m AgentMessage) + func (a *Agent) ClearAllQueues() + func (a *Agent) ClearFollowUpQueue() + func (a *Agent) ClearMessages() + func (a *Agent) ClearSteeringQueue() + func (a *Agent) Continue() error + func (a *Agent) FollowUp(m AgentMessage) + func (a *Agent) FollowUpQueueLen() int + func (a *Agent) GetAndClearFollowUpQueue() []AgentMessage + func (a *Agent) GetFollowUpMode() string + func (a *Agent) GetMaxRetryDelayMs() *int + func (a *Agent) GetSessionID() string + func (a *Agent) GetSteeringMode() string + func (a *Agent) GetThinkingBudgets() *core.ThinkingBudgets + func (a *Agent) GetTransport() core.Transport + func (a *Agent) HasQueuedMessages() bool + func (a *Agent) IdleChan() <-chan struct{} + func (a *Agent) PeekFollowUpQueue() []AgentMessage + func (a *Agent) Prompt(input string) error + func (a *Agent) PromptMessages(messages []AgentMessage) error + func (a *Agent) RemoveFollowUp(index int) (AgentMessage, bool) + func (a *Agent) ReplaceMessages(msgs []AgentMessage) + func (a *Agent) Reset() + func (a *Agent) SetCompaction(c *core.AnthropicCompaction) + func (a *Agent) SetFollowUpMode(mode string) + func (a *Agent) SetMaxRetryDelayMs(ms *int) + func (a *Agent) SetModel(m *core.Model) + func (a *Agent) SetServerTools(tools []core.AnthropicServerTool) + func (a *Agent) SetSessionID(id string) + func (a *Agent) SetSteeringMode(mode string) + func (a *Agent) SetStreamFn(fn StreamFn) + func (a *Agent) SetSystemPrompt(prompt string) + func (a *Agent) SetThinkingBudgets(tb *core.ThinkingBudgets) + func (a *Agent) SetThinkingLevel(level ThinkingLevel) + func (a *Agent) SetTransport(t core.Transport) + func (a *Agent) SimplePrompt(ctx context.Context, messages []AgentMessage, opts *SimplePromptOptions) (string, error) + func (a *Agent) SimplePromptStream(ctx context.Context, messages []AgentMessage, opts *SimplePromptOptions, ...) (string, *core.AssistantMessage, error) + func (a *Agent) State() AgentState + func (a *Agent) Steer(m AgentMessage) + func (a *Agent) Subscribe(fn func(AgentEvent)) func() + func (a *Agent) UpdateTools(fn func(ts *ToolSet)) + func (a *Agent) WaitForIdle() + type AgentContext struct + Messages []AgentMessage + SystemPrompt string + Tools *ToolSet + type AgentEvent struct + Args any + AssistantMessageEvent *core.AssistantMessageEvent + DisplayHint *ToolDisplayHint + ErrorMessage string + IsError bool + Message *AgentMessage + Messages []AgentMessage + PartialResult any + Result any + RetryAttempt int + StatusMessage string + ToolCallID string + ToolName string + ToolResults []core.ToolResultMessage + TurnMessage *AgentMessage + Type AgentEventType + type AgentEventType string + const EventAgentEnd + const EventAgentStart + const EventAutoResume + const EventMessageEnd + const EventMessageStart + const EventMessageUpdate + const EventStreamRetry + const EventToolExecutionEnd + const EventToolExecutionStart + const EventToolExecutionUpdate + const EventTurnEnd + const EventTurnStart + type AgentLoopConfig struct + Compaction *core.AnthropicCompaction + ConvertToLLM func(messages []AgentMessage) ([]core.Message, error) + GetApiKey func(provider string) (string, error) + GetFollowUpMessages func() ([]AgentMessage, error) + GetSteeringMessages func() ([]AgentMessage, error) + MaxRetryDelayMs *int + Model *core.Model + OnPayload func(payload any, model *core.Model) any + OnRetry func(attempt int, delaySeconds float64, errMsg string) + Reasoning core.ThinkingLevel + ServerTools []core.AnthropicServerTool + SessionID string + ShouldStopAfterTurn func(ctx ShouldStopAfterTurnContext) bool + ThinkingBudgets *core.ThinkingBudgets + TransformContext func(ctx context.Context, messages []AgentMessage) ([]AgentMessage, error) + Transport core.Transport + type AgentMessage struct + Custom any + func AgentLoop(ctx context.Context, prompts []AgentMessage, agentCtx *AgentContext, ...) []AgentMessage + func AgentLoopContinue(ctx context.Context, agentCtx *AgentContext, config *AgentLoopConfig, ...) ([]AgentMessage, error) + func NewAgentMessage(msg core.Message) AgentMessage + func StripUnmatchedToolCalls(msgs []AgentMessage) []AgentMessage + func (m *AgentMessage) Text() string + type AgentOptions struct + Compaction *core.AnthropicCompaction + ConvertToLLM func(messages []AgentMessage) ([]core.Message, error) + FollowUpMode string + GetApiKey func(provider string) (string, error) + InitialState *AgentState + MaxRetryDelayMs *int + Model *core.Model + OnPayload func(payload any, model *core.Model) any + OnRetry func(attempt int, delaySeconds float64, errMsg string) + ServerTools []core.AnthropicServerTool + SessionID string + SteeringMode string + StreamFn StreamFn + SystemPrompt string + ThinkingBudgets *core.ThinkingBudgets + ThinkingLevel ThinkingLevel + Tools *ToolSet + TransformContext func(ctx context.Context, messages []AgentMessage) ([]AgentMessage, error) + Transport core.Transport + type AgentState struct + Error string + IsStreaming bool + Messages []AgentMessage + Model *core.Model + PendingToolCalls map[string]bool + StreamMessage *AgentMessage + SystemPrompt string + ThinkingLevel ThinkingLevel + Tools *ToolSet + type AgentTool struct + DisplayHint *ToolDisplayHint + Execute func(ctx context.Context, toolCallID string, params map[string]any, ...) (AgentToolResult, error) + ExecutionMode ToolExecutionMode + Label string + type AgentToolResult struct + Content []core.ToolResultContent + Details any + IsError bool + StatusMessage string + Terminate bool + type AgentToolUpdateCallback func(partialResult AgentToolResult) + type BlockSummary struct + Len int + SigLen int + Type string + func SummarizeBlocks(content []core.AssistantContent) []BlockSummary + type PlanEntry struct + Content string + Priority PlanEntryPriority + Status PlanEntryStatus + type PlanEntryPriority string + const PlanEntryPriorityHigh + const PlanEntryPriorityLow + const PlanEntryPriorityMedium + type PlanEntryStatus string + const PlanEntryStatusCompleted + const PlanEntryStatusInProgress + const PlanEntryStatusPending + type ShouldStopAfterTurnContext struct + Context AgentContext + Message *core.AssistantMessage + NewMessages []AgentMessage + ToolResults []core.ToolResultMessage + type SimplePromptOptions struct + Model *core.Model + Reasoning core.ThinkingLevel + type StreamFn func(model *core.Model, ctx core.Context, options *core.SimpleStreamOptions) *core.AssistantMessageEventStream + type ThinkingLevel = core.ThinkingLevel + func ClampThinkingLevel(requested ThinkingLevel, available []ThinkingLevel) ThinkingLevel + type TitleArg struct + Label string + Name string + Style string + type ToolClassification struct + Builtin []string + Extensions map[string][]string + type ToolDisplayHint struct + ResultMaxLines int + TitleArgs []TitleArg + UseBox bool + type ToolExecutionMode string + const ToolExecutionParallel + const ToolExecutionSequential + type ToolSet struct + func NewToolSet() *ToolSet + func ToolSetFrom(tools []AgentTool) *ToolSet + func (ts *ToolSet) Add(t AgentTool) + func (ts *ToolSet) ClassifyTools(extensionTools map[string][]string) ToolClassification + func (ts *ToolSet) Clone() *ToolSet + func (ts *ToolSet) Get(name string) (AgentTool, bool) + func (ts *ToolSet) Has(name string) bool + func (ts *ToolSet) Len() int + func (ts *ToolSet) Names() []string + func (ts *ToolSet) Remove(name string) + func (ts *ToolSet) Slice() []AgentTool