pub struct MessageChunk {
pub role: Option<Role>,
pub content: String,
pub tool_call_chunks: Vec<ToolCallChunk>,
pub usage: Option<TokenUsage>,
}Expand description
Streaming message chunk
Represents incremental data from streaming LLM responses. Chunks must be accumulated to reconstruct the complete message.
Fields§
§role: Option<Role>Message role (may be empty in early chunks)
content: StringText content delta
tool_call_chunks: Vec<ToolCallChunk>Tool call chunks (using args_delta field name from stream module)
usage: Option<TokenUsage>Token usage (only in final chunk)
Trait Implementations§
Source§impl Clone for MessageChunk
impl Clone for MessageChunk
Source§fn clone(&self) -> MessageChunk
fn clone(&self) -> MessageChunk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MessageChunk
impl RefUnwindSafe for MessageChunk
impl Send for MessageChunk
impl Sync for MessageChunk
impl Unpin for MessageChunk
impl UnsafeUnpin for MessageChunk
impl UnwindSafe for MessageChunk
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