pub struct Message {
pub role: Role,
pub content: String,
pub tool_call_id: Option<String>,
}Expand description
A single message in a completion conversation.
Fields§
§role: RoleThe role of the message sender.
content: StringThe text content of the message.
tool_call_id: Option<String>Provider call identifier for tool results.
Set by ToolRegistry::result_to_message when role == Role::Tool.
Anthropic places this as tool_use_id inside a tool_result content block.
OpenAI places this as the top-level tool_call_id field.
None for all non-tool messages.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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