#[non_exhaustive]pub enum ChatEvent {
Delta {
text: String,
},
Finished {
usage: Option<LlmUsage>,
model: Option<String>,
finish_reason: Option<FinishReason>,
metadata: Map<String, Value>,
},
ToolCall {
id: String,
name: String,
arguments: String,
},
}Expand description
An event in a chat completion stream.
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.
Delta
A partial text delta from the stream.
Finished
The stream has finished.
Fields
§
finish_reason: Option<FinishReason>Why the stream finished.
ToolCall
An intermediate tool call emitted during streaming.
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