pub enum AgentEvent {
Show 15 variants
UserInput {
text: String,
},
ToolResult {
segments: Vec<DisplaySegment>,
},
SubscriptionEvent {
name: String,
text: String,
},
OAuthRequired {
auth_url: String,
},
CompactionApplied,
CompletionStarted,
TextChunk {
text: String,
},
ThinkingStarted,
ThinkingChunk {
text: String,
},
ThinkingEnded,
ToolCall {
name: String,
args: Value,
display_as: Option<String>,
},
CompletionFinished {
usage: Option<Usage>,
},
UserChoiceRequired {
choice: UserChoice,
},
UserChoiceDismissed {
choice_id: ChoiceId,
},
Info {
text: String,
},
}Expand description
A single observable event from a thread’s execution.
This type is Clone and carries no
provider-specific generics, so embeddings can fan events out to multiple
subscribers or buffer them freely.
Variants§
UserInput
A user text input was accepted into the thread’s history.
ToolResult
A tool result (from an asynchronously dispatched tool call) was
accepted into the thread’s history, or a synchronous tool produced a
result inline. Clients should render the first segment type they
support; the raw text is always included as a trailing Text segment.
Fields
segments: Vec<DisplaySegment>SubscriptionEvent
A subscription event or thread report was injected into this thread.
OAuthRequired
A tool server requires OAuth authorization before it can proceed.
CompactionApplied
A compaction summary replaced the beginning of the in-memory history.
CompletionStarted
A completion round is about to stream.
TextChunk
A chunk of assistant text.
ThinkingStarted
The model started reasoning.
ThinkingChunk
A chunk of reasoning text.
ThinkingEnded
The model finished reasoning.
ToolCall
The model called a tool. display_as is the pretty-printed form from
the tool’s display script, when available.
CompletionFinished
The completion round finished (its turn is synced to the store by the
time this event is observed). usage is the token usage reported by
the provider, if any.
UserChoiceRequired
A tool server requested a user choice. The choice has already been persisted when this event is emitted.
Fields
choice: UserChoiceUserChoiceDismissed
A pending user choice became moot and has already been removed from persistent state.
Info
Human-readable progress/diagnostic information (retries, warnings).