pub struct Message {
pub role: Role,
pub content: Option<String>,
pub name: Option<String>,
pub tool_call_id: Option<String>,
pub tool_calls: Option<Vec<ToolCall>>,
pub reasoning_content: Option<String>,
pub prefix: Option<bool>,
}Fields§
§role: Roledefault role is User
content: Option<String>The content may be null for assistant messages (only when tool_calls are present)
name: Option<String>Optional name to identify a user or function
tool_call_id: Option<String>Required when role = “tool”; links to the previous tool call ID
tool_calls: Option<Vec<ToolCall>>Present when role = “assistant” and the model requested tool calls
reasoning_content: Option<String>Reasoning content produced by the model (may appear only in responses)
prefix: Option<bool>Beta: if true, forces the model to begin its reply with the prefix content provided in this assistant message
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 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