pub struct Message {
pub role: Role,
pub content: String,
pub tool_calls: Vec<ToolCall>,
pub tool_call_id: Option<String>,
pub images: Vec<ImageAttachment>,
pub thinking: Option<String>,
}Fields§
§role: Role§content: String§tool_calls: Vec<ToolCall>§tool_call_id: Option<String>OpenAI tool_call_id for Role::Tool messages — links the result back
to the originating assistant tool call. Required by OpenAI-compatible
servers. None is allowed for round-trips with providers that don’t
use it, but the OpenAI-compatible serialiser will substitute a
synthetic id when missing.
images: Vec<ImageAttachment>Optional images attached to the message (multimodal models).
Only meaningful for User role messages.
thinking: Option<String>Thinking/reasoning chain from the model, captured during streaming and persisted for debugging. Not sent to the provider in API requests (skipped in serialization for request types; only stored in sessions).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Forget for Message
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