#[non_exhaustive]pub enum StreamEvent {
TextDelta(String),
ReasoningDelta(String),
ToolCallStart {
id: String,
name: String,
},
ToolCallDelta {
id: String,
arguments: String,
},
Done(ChatResponse),
}Expand description
What a stream yields. The last item is always StreamEvent::Done (or an error).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TextDelta(String)
More answer text.
ReasoningDelta(String)
More reasoning text (when the provider shows it).
ToolCallStart
The model started a tool call.
ToolCallDelta
More JSON of a tool call’s arguments.
Done(ChatResponse)
The complete response, the same as a non-streaming call would return.
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§impl Debug for StreamEvent
impl Debug for StreamEvent
Source§impl PartialEq for StreamEvent
impl PartialEq for StreamEvent
impl StructuralPartialEq for StreamEvent
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