pub struct LlmStreamChunk {
pub delta: Option<String>,
pub tool_calls: Option<Vec<ToolCall>>,
pub finish_reason: Option<FinishReason>,
pub usage: Option<Usage>,
}Expand description
Streaming chunk from an LLM
Fields§
§delta: Option<String>Delta content
tool_calls: Option<Vec<ToolCall>>Tool calls in this chunk
finish_reason: Option<FinishReason>Finish reason if this is the last chunk
usage: Option<Usage>Usage statistics (usually only in the last chunk)
Trait Implementations§
Source§impl Clone for LlmStreamChunk
impl Clone for LlmStreamChunk
Source§fn clone(&self) -> LlmStreamChunk
fn clone(&self) -> LlmStreamChunk
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 LlmStreamChunk
impl Debug for LlmStreamChunk
Source§impl<'de> Deserialize<'de> for LlmStreamChunk
impl<'de> Deserialize<'de> for LlmStreamChunk
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 LlmStreamChunk
impl RefUnwindSafe for LlmStreamChunk
impl Send for LlmStreamChunk
impl Sync for LlmStreamChunk
impl Unpin for LlmStreamChunk
impl UnwindSafe for LlmStreamChunk
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