pub struct OpenAIMessage {
pub role: String,
pub content: Option<OpenAIContent>,
pub tool_calls: Option<Vec<OpenAIToolCall>>,
pub tool_call_id: Option<String>,
}Fields§
§role: StringMessage role as a string (“system”, “user”, “assistant”, “tool”).
content: Option<OpenAIContent>Message content (string for text-only, array for text+images).
tool_calls: Option<Vec<OpenAIToolCall>>Tool calls requested by the assistant (assistant messages only).
When the model wants to call tools, this field contains the list of tool invocations with their parameters. Only present in assistant messages.
tool_call_id: Option<String>ID of the tool call this message is responding to (tool messages only).
When sending tool results back to the model, this field links the result to the original tool call request. Only present in tool messages.
Trait Implementations§
Source§impl Clone for OpenAIMessage
impl Clone for OpenAIMessage
Source§fn clone(&self) -> OpenAIMessage
fn clone(&self) -> OpenAIMessage
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 moreSource§impl Debug for OpenAIMessage
impl Debug for OpenAIMessage
Source§impl<'de> Deserialize<'de> for OpenAIMessage
impl<'de> Deserialize<'de> for OpenAIMessage
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 OpenAIMessage
impl RefUnwindSafe for OpenAIMessage
impl Send for OpenAIMessage
impl Sync for OpenAIMessage
impl Unpin for OpenAIMessage
impl UnsafeUnpin for OpenAIMessage
impl UnwindSafe for OpenAIMessage
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