pub enum StreamEvent {
Start {
partial: AgentMessage,
},
Chunk(AssistantStreamChunk),
Done {
message: AgentMessage,
},
Error {
partial: AgentMessage,
kind: StreamErrorKind,
message: String,
},
}Expand description
Streamed event from the provider.
Streaming surface is rich because UIs need to render token-by-token.
The loop folds these into a single StreamResponse at the end.
Variants§
Start
First event. Provider has accepted the request and started generating. Carries the (so-far-empty) partial message so listeners can render an empty assistant placeholder.
Fields
partial: AgentMessageChunk(AssistantStreamChunk)
A streaming chunk. UI listeners render this; the loop folds it into the assembled message.
Done
Final event. Provider finished generating. Carries the assembled final message.
Fields
message: AgentMessageError
Final event. Provider raised an error during streaming. Carries
the partial message produced so far and a human-readable error
description. Stream implementations encode their typed errors
here as strings; callers that need structured detail can parse
kind.
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more