pub enum StreamedTurnEvent {
EmitIngested,
EmitToolCallDelta {
id: String,
internal_call_id: String,
content: ToolCallDeltaContent,
},
InvalidToolCall(Box<StreamedInvalidToolCall>),
Completed {
usage: Usage,
emit_final: bool,
},
}Expand description
What a driver must do with one ingested stream item.
Deliberately exhaustive: a driver must handle every event, so adding a variant is a breaking change by design.
Variants§
EmitIngested
Forward the ingested item to the consumer as-is (text, reasoning, or reasoning deltas, after accumulation).
EmitToolCallDelta
Forward this tool-call delta. Argument deltas buffered while the tool name awaited validation are replayed through this event.
Fields
content: ToolCallDeltaContentThe (possibly repaired) name or argument delta.
InvalidToolCall(Box<StreamedInvalidToolCall>)
The model emitted an unknown or disallowed tool call. Resolve it via
AgentRun::resolve_streamed_invalid_tool_call,
then apply the outcome with
StreamedTurnAssembler::resolve_pending_invalid.
Completed
The provider supplied its typed final payload. Record its usage (see
AgentRun::record_streamed_completion_call);
this does not establish that the provider stream reached EOF. When
emit_final is set, the turn streamed text and the driver should buffer
the final item until EOF finalizes the turn.
Trait Implementations§
Source§impl Clone for StreamedTurnEvent
impl Clone for StreamedTurnEvent
Source§fn clone(&self) -> StreamedTurnEvent
fn clone(&self) -> StreamedTurnEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more