pub enum MessageBlock {
Text(String),
ToolUse {
id: String,
name: String,
input: Value,
},
ToolResult {
id: String,
content: String,
is_error: bool,
},
}Expand description
消息内容块 — 用于表示结构化的工具调用/结果
简单的纯文本消息可以只用 ConversationMessage.content,
当涉及工具调用时,使用 blocks 字段携带结构化数据。
Variants§
Trait Implementations§
Source§impl Clone for MessageBlock
impl Clone for MessageBlock
Source§fn clone(&self) -> MessageBlock
fn clone(&self) -> MessageBlock
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 MessageBlock
impl RefUnwindSafe for MessageBlock
impl Send for MessageBlock
impl Sync for MessageBlock
impl Unpin for MessageBlock
impl UnsafeUnpin for MessageBlock
impl UnwindSafe for MessageBlock
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