pub enum StreamEvent {
TextDelta {
text: String,
},
ToolCall {
id: String,
name: String,
arguments: String,
},
ToolResult {
id: String,
result: String,
},
TurnComplete {
turn: ConversationTurn,
},
}Expand description
A stream event from an AI generation request.
Emitted by
RequestBuilder::generate_stream_events,
which assembles low-level provider events into this higher-level shape.
Variants§
TextDelta
An incremental piece of assistant text.
ToolCall
A tool call that has finished streaming its arguments.
Fields
ToolResult
The result of executing a tool call.
TurnComplete
The turn is finished; carries the assembled conversation turn.
Fields
§
turn: ConversationTurnThe complete turn, ready to be stored as history.
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamEvent
impl Debug for StreamEvent
Source§impl<'de> Deserialize<'de> for StreamEvent
impl<'de> Deserialize<'de> for StreamEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<StreamEvent> for WireStreamEvent
impl From<StreamEvent> for WireStreamEvent
Source§fn from(event: StreamEvent) -> Self
fn from(event: StreamEvent) -> Self
Forward a high-level StreamEvent onto the wire without loss.
Every StreamEvent has an exact counterpart here, and
TryFrom<WireStreamEvent> converts it back to the
same value.
Source§impl PartialEq for StreamEvent
impl PartialEq for StreamEvent
Source§impl Serialize for StreamEvent
impl Serialize for StreamEvent
impl StructuralPartialEq for StreamEvent
Source§impl TryFrom<WireStreamEvent> for StreamEvent
impl TryFrom<WireStreamEvent> for StreamEvent
Source§type Error = UnrepresentableWireEvent
type Error = UnrepresentableWireEvent
The type returned in the event of a conversion error.
Source§fn try_from(event: WireStreamEvent) -> Result<Self, UnrepresentableWireEvent>
fn try_from(event: WireStreamEvent) -> Result<Self, UnrepresentableWireEvent>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin for StreamEvent
impl UnwindSafe for StreamEvent
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
Mutably borrows from an owned value. Read more