pub enum StreamEvent {
Show 17 variants
Start {
partial: AssistantMessage,
},
TextStart {
content_index: usize,
partial: AssistantMessage,
},
TextDelta {
content_index: usize,
delta: String,
partial: AssistantMessage,
},
TextEnd {
content_index: usize,
content: String,
partial: AssistantMessage,
},
ThinkingStart {
content_index: usize,
partial: AssistantMessage,
},
ThinkingDelta {
content_index: usize,
delta: String,
partial: AssistantMessage,
},
ThinkingEnd {
content_index: usize,
content: String,
partial: AssistantMessage,
},
ToolcallStart {
content_index: usize,
partial: AssistantMessage,
},
ToolcallDelta {
content_index: usize,
delta: String,
partial: AssistantMessage,
},
ToolcallEnd {
content_index: usize,
tool_call: ToolCall,
partial: AssistantMessage,
},
ToolOutputDelta {
tool_call_id: String,
delta: String,
},
ToolResult {
tool_call_id: String,
tool_name: String,
is_error: bool,
content: String,
summary: Option<String>,
},
Done {
reason: StopReason,
message: AssistantMessage,
},
Error {
reason: StopReason,
error: AssistantMessage,
},
SteerMessage {
message: UserMessage,
},
Phase {
phase: AgentPhase,
turn_started_at_ms: Option<u64>,
phase_started_at_ms: Option<u64>,
},
Status {
message: String,
},
}Variants§
Start
Fields
partial: AssistantMessageTextStart
TextDelta
TextEnd
ThinkingStart
ThinkingDelta
ThinkingEnd
ToolcallStart
ToolcallDelta
ToolcallEnd
ToolOutputDelta
Incremental tool output line (streaming, e.g. bash).
ToolResult
Tool execution completed.
Fields
Done
Error
SteerMessage
A steering message was injected mid-loop.
Fields
message: UserMessagePhase
Agent phase transition. Only sent for phases that have no implicit stream event (Waiting, Preparing, Connecting, Compacting). Other phases are derived by the TUI from existing events:
- ThinkingStart/ThinkingDelta → Thinking
- TextStart/TextDelta → Responding
- ToolcallStart → Responding (still LLM output)
- ToolResult → ToolExec
- Start → transition from Connecting (but phase already set)
- AgentDone/Cancelled/Error → Idle
turn_started_at_ms is the server-stamped wall-clock (Unix ms)
when the current non-Idle turn began. It is preserved across
phase→phase transitions within a single turn and cleared on
transition to Idle. Used by clients to anchor the “Working… Xs”
counter so it survives UI mode flicker and late subscribe.
phase_started_at_ms is the server-stamped wall-clock (Unix ms)
when the current phase began. Re-stamped on every phase
transition (Idle→Thinking, Thinking→ToolExec, etc.) and cleared
on Idle. Used by clients to render a per-phase elapsed counter
alongside the total turn elapsed so a slow tool call doesn’t
keep climbing once the LLM resumes responding.
Status
Informational status message (e.g. retry notices).
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more