pub struct Message {
pub role: Role,
pub content: Vec<ContentPart>,
pub tool_calls: Vec<ToolCall>,
pub tool_call_id: Option<String>,
pub provider_state: Option<Value>,
}Expand description
A chat message.
Fields§
§role: Role§content: Vec<ContentPart>§tool_calls: Vec<ToolCall>Tool calls made by an assistant message.
tool_call_id: Option<String>For tool messages: the call this message answers.
provider_state: Option<Value>Opaque provider state attached to an assistant message (e.g. signed reasoning blocks) that must be sent back verbatim on the next turn.
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
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Message
impl Move 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