pub struct ChatChunk {
pub delta_content: Option<String>,
pub delta_tool_calls: Vec<ToolCallChunk>,
pub finish_reason: Option<String>,
pub usage: Option<UsageMetadata>,
}Expand description
A single chunk of streaming output from a chat model.
Fields§
§delta_content: Option<String>Incremental text content.
delta_tool_calls: Vec<ToolCallChunk>Incremental tool call data.
finish_reason: Option<String>Finish reason, if generation is complete.
usage: Option<UsageMetadata>Usage statistics, if provided.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChatChunk
impl<'de> Deserialize<'de> for ChatChunk
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
Auto Trait Implementations§
impl Freeze for ChatChunk
impl RefUnwindSafe for ChatChunk
impl Send for ChatChunk
impl Sync for ChatChunk
impl Unpin for ChatChunk
impl UnsafeUnpin for ChatChunk
impl UnwindSafe for ChatChunk
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