Documentation
¶
Index ¶
- type AgentChoiceEvent
- type AgentContext
- type ErrorEvent
- type Event
- func AgentChoice(agentName string, choice chat.MessageStreamChoice) Event
- func Error(msg string) Event
- func PartialToolCall(toolCall tools.ToolCall, agentName string) Event
- func SessionCompaction(sessionID, status string) Event
- func SessionSummary(sessionID, summary string) Event
- func SessionTitle(sessionID, title string) Event
- func ShellOutput(output string) Event
- func StreamStarted() Event
- func StreamStopped() Event
- func TokenUsage(inputTokens, outputTokens, contextLength, contextLimit int, cost float64) Event
- func ToolCall(toolCall tools.ToolCall, agentName string) Event
- func ToolCallConfirmation(toolCall tools.ToolCall, agentName string) Event
- func ToolCallResponse(toolCall tools.ToolCall, response, agentName string) Event
- func UserMessage(message string) Event
- type Opt
- type PartialToolCallEvent
- type ResumeType
- type Runtime
- func (r *Runtime) CurrentAgent() *agent.Agent
- func (r *Runtime) Resume(_ context.Context, confirmationType string)
- func (r *Runtime) Run(ctx context.Context, sess *session.Session) ([]session.Message, error)
- func (r *Runtime) RunStream(ctx context.Context, sess *session.Session) <-chan Event
- func (r *Runtime) Summarize(ctx context.Context, sess *session.Session, events chan Event)
- func (r *Runtime) Team() *team.Team
- type SessionCompactionEvent
- type SessionSummaryEvent
- type SessionTitleEvent
- type ShellOutputEvent
- type StreamStartedEvent
- type StreamStoppedEvent
- type TokenUsageEvent
- type ToolCallConfirmationEvent
- type ToolCallEvent
- type ToolCallResponseEvent
- type ToolHandler
- type Usage
- type UserMessageEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentChoiceEvent ¶
type AgentChoiceEvent struct {
Type string `json:"type"`
Choice chat.MessageStreamChoice `json:"choice"`
AgentContext
}
type AgentContext ¶
type AgentContext struct {
AgentName string `json:"agent_name,omitempty"`
}
AgentContext carries optional agent attribution for an event.
func (AgentContext) GetAgentName ¶
func (a AgentContext) GetAgentName() string
GetAgentName returns the agent name for events embedding AgentContext.
type ErrorEvent ¶
type ErrorEvent struct {
Type string `json:"type"`
Error string `json:"error"`
AgentContext
}
type Event ¶
type Event interface {
GetAgentName() string
// contains filtered or unexported methods
}
func AgentChoice ¶
func AgentChoice(agentName string, choice chat.MessageStreamChoice) Event
func SessionCompaction ¶
func SessionSummary ¶
func SessionTitle ¶
func ShellOutput ¶ added in v1.0.1
func StreamStarted ¶
func StreamStarted() Event
func StreamStopped ¶
func StreamStopped() Event
func TokenUsage ¶
func ToolCallConfirmation ¶
func ToolCallResponse ¶
func UserMessage ¶
type Opt ¶
type Opt func(*Runtime)
func WithAutoRunTools ¶
func WithCurrentAgent ¶
func WithSessionCompaction ¶
func WithTracer ¶
WithTracer sets a custom OpenTelemetry tracer; if not provided, tracing is disabled (no-op).
type PartialToolCallEvent ¶
type PartialToolCallEvent struct {
Type string `json:"type"`
ToolCall tools.ToolCall `json:"tool_call"`
AgentContext
}
ToolCallEvent is sent when a tool call is received PartialToolCallEvent is sent when a tool call is first received (partial/complete)
type ResumeType ¶
type ResumeType string
const ( ResumeTypeApprove ResumeType = "approve" ResumeTypeApproveSession ResumeType = "approve-session" ResumeTypeReject ResumeType = "reject" )
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime manages the execution of agents
func (*Runtime) CurrentAgent ¶
type SessionCompactionEvent ¶
type SessionCompactionEvent struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
Status string `json:"status"`
AgentContext
}
type SessionSummaryEvent ¶
type SessionSummaryEvent struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
Summary string `json:"summary"`
AgentContext
}
type SessionTitleEvent ¶
type SessionTitleEvent struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
Title string `json:"title"`
AgentContext
}
type ShellOutputEvent ¶ added in v1.0.1
func (*ShellOutputEvent) GetAgentName ¶ added in v1.0.1
func (e *ShellOutputEvent) GetAgentName() string
type StreamStartedEvent ¶
type StreamStartedEvent struct {
Type string `json:"type"`
}
func (*StreamStartedEvent) GetAgentName ¶
func (e *StreamStartedEvent) GetAgentName() string
type StreamStoppedEvent ¶
type StreamStoppedEvent struct {
Type string `json:"type"`
}
func (*StreamStoppedEvent) GetAgentName ¶
func (e *StreamStoppedEvent) GetAgentName() string
type TokenUsageEvent ¶
type TokenUsageEvent struct {
Type string `json:"type"`
Usage *Usage `json:"usage"`
AgentContext
}
type ToolCallConfirmationEvent ¶
type ToolCallConfirmationEvent struct {
Type string `json:"type"`
ToolCall tools.ToolCall `json:"tool_call"`
AgentContext
}
type ToolCallEvent ¶
type ToolCallEvent struct {
Type string `json:"type"`
ToolCall tools.ToolCall `json:"tool_call"`
AgentContext
}
type ToolCallResponseEvent ¶
type ToolCallResponseEvent struct {
Type string `json:"type"`
ToolCall tools.ToolCall `json:"tool_call"`
Response string `json:"response"`
AgentContext
}
type ToolHandler ¶
type ToolHandler func(ctx context.Context, sess *session.Session, toolCall tools.ToolCall, events chan Event) (*tools.ToolCallResult, error)
ToolHandler is a function type for handling tool calls
type UserMessageEvent ¶
UserMessageEvent is sent when a user message is received
func (*UserMessageEvent) GetAgentName ¶
func (e *UserMessageEvent) GetAgentName() string
Click to show internal directories.
Click to hide internal directories.