pub enum ProviderStreamEvent {
Text(String),
ToolCallStart {
id: String,
name: String,
},
ToolCallChunk {
id: String,
arguments: String,
},
Done {
finish_reason: Option<String>,
usage: Option<Usage>,
},
}Expand description
A low-level event decoded from a provider’s server-sent event stream.
This is the raw shape yielded by
RequestBuilder::stream. Providers differ
in how they chunk tool calls, so tool arguments arrive as a
ProviderStreamEvent::ToolCallStart followed by any number of
ProviderStreamEvent::ToolCallChunks that must be concatenated. For a
pre-assembled view, use
RequestBuilder::generate_stream_events.
Variants§
Text(String)
A fragment of assistant text to append to the output so far.
ToolCallStart
A tool call has begun; its arguments follow in later chunks.
Fields
ToolCallChunk
A fragment of the JSON argument string for a tool call.
Fields
Done
Generation finished.
Depending on the provider, the finish reason and usage may arrive in
separate Done events.
Trait Implementations§
Source§impl Clone for ProviderStreamEvent
impl Clone for ProviderStreamEvent
Source§fn clone(&self) -> ProviderStreamEvent
fn clone(&self) -> ProviderStreamEvent
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 moreAuto Trait Implementations§
impl Freeze for ProviderStreamEvent
impl RefUnwindSafe for ProviderStreamEvent
impl Send for ProviderStreamEvent
impl Sync for ProviderStreamEvent
impl Unpin for ProviderStreamEvent
impl UnsafeUnpin for ProviderStreamEvent
impl UnwindSafe for ProviderStreamEvent
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