pub struct ChatCompletionAssistantMessage { /* private fields */ }
Expand description
Defines the content of an assistant message.
Implementations§
Source§impl ChatCompletionAssistantMessage
impl ChatCompletionAssistantMessage
Sourcepub fn new(
content: Option<String>,
name: Option<String>,
tool_calls: Option<Vec<ToolCall>>,
) -> Self
pub fn new( content: Option<String>, name: Option<String>, tool_calls: Option<Vec<ToolCall>>, ) -> Self
Creates a new assistant message.
§Arguments
-
content
- The contents of the assistant message. Required unlesstool_calls
is specified. -
name
- An optional name for the participant. Provides the model information to differentiate between participants of the same role. -
tool_calls
- The tool calls generated by the model.
Sourcepub fn role(&self) -> ChatCompletionRole
pub fn role(&self) -> ChatCompletionRole
The role of the messages author, in this case assistant
.
Sourcepub fn content(&self) -> Option<&String>
pub fn content(&self) -> Option<&String>
The contents of the assistant message. If tool_calls
is specified, then content
is None.
Sourcepub fn tool_calls(&self) -> Option<&Vec<ToolCall>>
pub fn tool_calls(&self) -> Option<&Vec<ToolCall>>
The tool calls generated by the model.
Trait Implementations§
Source§impl Clone for ChatCompletionAssistantMessage
impl Clone for ChatCompletionAssistantMessage
Source§fn clone(&self) -> ChatCompletionAssistantMessage
fn clone(&self) -> ChatCompletionAssistantMessage
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<'de> Deserialize<'de> for ChatCompletionAssistantMessage
impl<'de> Deserialize<'de> for ChatCompletionAssistantMessage
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 ChatCompletionAssistantMessage
impl PartialEq for ChatCompletionAssistantMessage
Source§fn eq(&self, other: &ChatCompletionAssistantMessage) -> bool
fn eq(&self, other: &ChatCompletionAssistantMessage) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl Eq for ChatCompletionAssistantMessage
impl StructuralPartialEq for ChatCompletionAssistantMessage
Auto Trait Implementations§
impl Freeze for ChatCompletionAssistantMessage
impl RefUnwindSafe for ChatCompletionAssistantMessage
impl Send for ChatCompletionAssistantMessage
impl Sync for ChatCompletionAssistantMessage
impl Unpin for ChatCompletionAssistantMessage
impl UnwindSafe for ChatCompletionAssistantMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.