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 reported the end of this completion call. Record it (see
AgentRun::record_streamed_completion_call);
when emit_final is set, the turn streamed text and the driver should
run its stream-finish hook and forward the final item.
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 moreAuto Trait Implementations§
impl Freeze for StreamedTurnEvent
impl RefUnwindSafe for StreamedTurnEvent
impl Send for StreamedTurnEvent
impl Sync for StreamedTurnEvent
impl Unpin for StreamedTurnEvent
impl UnsafeUnpin for StreamedTurnEvent
impl UnwindSafe for StreamedTurnEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
impl<T> DebuggableStorage for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more