pub enum ChatEvent {
Delta(String),
ToolCall(ToolCall),
Done,
Error(String),
}Expand description
Streaming chat event.
Why: replaces the previous “string-only” channel so callers can
distinguish text deltas from tool invocations and from terminal
success/error without parsing magic markers out of the text stream.
What: Delta is a content chunk; ToolCall is a fully-accumulated tool
invocation; Done signals the upstream stream terminated normally;
Error carries a human-readable message for stream-mid failures (the
provider also returns Err from chat_stream, but Error lets the
caller display partial-stream failures inline).
Test: ollama_provider_streams_sse_deltas.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChatEvent
impl RefUnwindSafe for ChatEvent
impl Send for ChatEvent
impl Sync for ChatEvent
impl Unpin for ChatEvent
impl UnsafeUnpin for ChatEvent
impl UnwindSafe for ChatEvent
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