pub enum StreamChunk {
Text(String),
Thinking(String),
ToolCall {
id: String,
name: String,
arguments: String,
},
ToolResult {
id: String,
content: String,
is_error: bool,
},
}Expand description
数据面事件 — 高频、数据透传。
设计原则:只承载“需要实时展示给用户的内容“,不混入状态变更等低频数据。
Variants§
Text(String)
文本输出(LLM 生成的文本 token)
Thinking(String)
思考内容(LLM 的 reasoning/thinking block)
ToolCall
工具调用开始
ToolResult
工具执行结果
Trait Implementations§
Source§impl Clone for StreamChunk
impl Clone for StreamChunk
Source§fn clone(&self) -> StreamChunk
fn clone(&self) -> StreamChunk
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 StreamChunk
impl RefUnwindSafe for StreamChunk
impl Send for StreamChunk
impl Sync for StreamChunk
impl Unpin for StreamChunk
impl UnsafeUnpin for StreamChunk
impl UnwindSafe for StreamChunk
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