<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>agent - Sharur</title><link>https://goppydae.github.io/sharur/reference/agent/index.html</link><description>agent import "github.com/goppydae/sharur/internal/agent" Package agent provides the stateful agent with transcript, tools, and events.
Index Constants func EstimateMessageTokens(m Message) int type Agent func New(provider llm.Provider, registry *tools.ToolRegistry) *Agent func (a *Agent) Abort() func (a *Agent) Compact(ctx context.Context, keepRecentTokens int) func (a *Agent) Continue(ctx context.Context) error func (a *Agent) EstimateContextTokens() int func (a *Agent) EventBus() *events.EventBus func (a *Agent) FollowUp(text string, images …Image) func (a *Agent) GetInfo() llm.ProviderInfo func (a *Agent) GetSession() *types.Session func (a *Agent) GetStats() AgentStats func (a *Agent) Idle() &lt;-chan struct{} func (a *Agent) InvokeTool(ctx context.Context, name string, args string) error func (a *Agent) IsRunning() bool func (a *Agent) LifecycleState() string func (a *Agent) Messages() []Message func (a *Agent) Prompt(ctx context.Context, text string, images …Image) error func (a *Agent) Reset() func (a *Agent) ResetSession(id string) func (a *Agent) Session() *session.Session func (a *Agent) SetCompactionConfig(enabled bool, reserve, keepRecent int) func (a *Agent) SetDryRun(dry bool) func (a *Agent) SetExtensions(exts []Extension) func (a *Agent) SetMaxTokens(n int) func (a *Agent) SetModel(model string) func (a *Agent) SetProvider(provider llm.Provider) func (a *Agent) SetSession(mgr *session.Manager, sess *session.Session) func (a *Agent) SetSessionName(name string) func (a *Agent) SetSystemPrompt(prompt string) func (a *Agent) SetThinkingLevel(level ThinkingLevel) func (a *Agent) State() *AgentState func (a *Agent) Steer(text string, images …Image) func (a *Agent) Subscribe(fn func(Event)) func() func (a *Agent) ToolRegistry() *tools.ToolRegistry type AgentState type AgentStats type CompactionPrep type CompactionResult type Event type EventType type Extension type Image type InputAction type InputResult type LifecycleState type Message type NoopExtension func (n *NoopExtension) AfterCompact(_ context.Context, _ int) func (n *NoopExtension) AfterProviderResponse(_ context.Context, _ string, _ int) func (n *NoopExtension) AfterToolCall(_ context.Context, _ *ToolCall, result *tools.ToolResult) *tools.ToolResult func (n *NoopExtension) AgentEnd(_ context.Context) func (n *NoopExtension) AgentStart(_ context.Context) func (n *NoopExtension) BeforeCompact(_ context.Context, _ CompactionPrep) *CompactionResult func (n *NoopExtension) BeforePrompt(_ context.Context, state *AgentState) *AgentState func (n *NoopExtension) BeforeProviderRequest(_ context.Context, req *llm.CompletionRequest) *llm.CompletionRequest func (n *NoopExtension) BeforeToolCall(_ context.Context, _ *ToolCall, _ json.RawMessage) (*tools.ToolResult, bool) func (n *NoopExtension) ModifyContext(_ context.Context, messages []types.Message) []types.Message func (n *NoopExtension) ModifyInput(_ context.Context, _ string) InputResult func (n *NoopExtension) ModifySystemPrompt(prompt string) string func (n *NoopExtension) Name() string func (n *NoopExtension) SessionEnd(_ context.Context, _ string, _ SessionEndReason) func (n *NoopExtension) SessionStart(_ context.Context, _ string, _ SessionStartReason) func (n *NoopExtension) Tools() []tools.Tool func (n *NoopExtension) TurnEnd(_ context.Context) func (n *NoopExtension) TurnStart(_ context.Context) type Session type SessionEndReason type SessionStartReason type StateMachine func NewStateMachine(initial LifecycleState, onTransition func(StateTransition)) *StateMachine func (s *StateMachine) Current() LifecycleState func (s *StateMachine) Transition(to LifecycleState) error type StateTransition type ThinkingLevel type ToolCall type ToolInfo type ToolOutput Constants</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://goppydae.github.io/sharur/reference/agent/index.xml" rel="self" type="application/rss+xml"/></channel></rss>