pub struct ChatCompletionStreamChunk {
pub id: String,
pub object: Option<String>,
pub created: u64,
pub model: Option<String>,
pub choices: Vec<StreamChoice>,
pub usage: Option<Usage>,
}Expand description
Streaming chat completion chunk.
Each chunk contains incremental updates during streaming.
§Fields
id- Response IDobject- Object typecreated- Creation timestampmodel- Model usedchoices- Stream choices with deltasusage- Usage statistics (final chunk only)
Fields§
§id: String§object: Option<String>§created: u64§model: Option<String>§choices: Vec<StreamChoice>§usage: Option<Usage>Usage statistics for the request. Only present if stream_options.include_usage was set to true.
Trait Implementations§
Source§impl Clone for ChatCompletionStreamChunk
impl Clone for ChatCompletionStreamChunk
Source§fn clone(&self) -> ChatCompletionStreamChunk
fn clone(&self) -> ChatCompletionStreamChunk
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatCompletionStreamChunk
impl Debug for ChatCompletionStreamChunk
Source§impl<'de> Deserialize<'de> for ChatCompletionStreamChunk
impl<'de> Deserialize<'de> for ChatCompletionStreamChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ChatCompletionStreamChunk
Auto Trait Implementations§
impl Freeze for ChatCompletionStreamChunk
impl RefUnwindSafe for ChatCompletionStreamChunk
impl Send for ChatCompletionStreamChunk
impl Sync for ChatCompletionStreamChunk
impl Unpin for ChatCompletionStreamChunk
impl UnsafeUnpin for ChatCompletionStreamChunk
impl UnwindSafe for ChatCompletionStreamChunk
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