pub enum ProviderStreamEvent {
TextDelta {
delta: String,
opaque: Value,
},
ToolCallStarted {
id: String,
name: String,
opaque: Value,
},
ToolCallArgumentsDelta {
id: String,
delta: String,
opaque: Value,
},
ToolCallCompleted {
call: ToolCall,
opaque: Value,
},
Usage {
usage: TokenUsage,
opaque: Value,
},
Completed {
turn: ProviderTurn,
},
Opaque {
event_type: String,
payload: Value,
},
}Expand description
Provider-neutral events emitted while one model turn is in progress.
Every incrementally normalized event retains the complete provider frame in
opaque. Consumers must treat that value as versioned provider data rather
than infer portable semantics from it.
Variants§
TextDelta
Public assistant text that can be rendered immediately.
Fields
ToolCallStarted
A client-executed tool call whose stable identity and name are known.
Fields
ToolCallArgumentsDelta
A partial JSON string for one tool call’s arguments.
The delta is deliberately not parsed until the provider marks the call complete. Partial JSON is not safe to execute.
Fields
ToolCallCompleted
A fully normalized tool call whose arguments are valid JSON.
Fields
Usage
Provider-reported cumulative token accounting.
Fields
usage: TokenUsageLatest normalized usage counters.
Completed
Canonical terminal result for the provider turn.
Fields
turn: ProviderTurnFully accumulated turn.
Opaque
A well-formed provider event with no lossless canonical equivalent.
Trait Implementations§
Source§impl Clone for ProviderStreamEvent
impl Clone for ProviderStreamEvent
Source§fn clone(&self) -> ProviderStreamEvent
fn clone(&self) -> ProviderStreamEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more