pub enum ChatMessage {
Developer {
content: ChatMessageContent,
name: Option<String>,
},
System {
content: ChatMessageContent,
name: Option<String>,
},
User {
content: ChatMessageContent,
name: Option<String>,
},
Assistant {
content: Option<ChatMessageContent>,
reasoning_content: Option<String>,
refusal: Option<String>,
name: Option<String>,
audio: Option<AudioDataIdParameter>,
tool_calls: Option<Vec<ToolCall>>,
},
Tool {
content: ChatMessageContent,
tool_call_id: String,
},
}Variants§
Developer
Fields
§
content: ChatMessageContentThe contents of the developer message.
System
Fields
§
content: ChatMessageContentThe contents of the system message.
User
Fields
§
content: ChatMessageContentThe contents of the user message.
Assistant
Fields
§
content: Option<ChatMessageContent>The contents of the assistant message. Required unless tool_calls is specified.
§
name: Option<String>An optional name for the participant. Provides the model information to differentiate between participants of the same role.
§
audio: Option<AudioDataIdParameter>Data about a previous audio response from the model.
Tool
Fields
§
content: ChatMessageContentThe contents of the tool message.
Implementations§
Trait Implementations§
Source§impl Clone for ChatMessage
impl Clone for ChatMessage
Source§fn clone(&self) -> ChatMessage
fn clone(&self) -> ChatMessage
Returns a duplicate of the value. Read more
1.0.0 · 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 ChatMessage
impl Debug for ChatMessage
Source§impl<'de> Deserialize<'de> for ChatMessage
impl<'de> Deserialize<'de> for ChatMessage
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
Source§impl PartialEq for ChatMessage
impl PartialEq for ChatMessage
Source§impl Serialize for ChatMessage
impl Serialize for ChatMessage
impl StructuralPartialEq for ChatMessage
Auto Trait Implementations§
impl Freeze for ChatMessage
impl RefUnwindSafe for ChatMessage
impl Send for ChatMessage
impl Sync for ChatMessage
impl Unpin for ChatMessage
impl UnwindSafe for ChatMessage
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