Struct async_openai::types::ChatCompletionRequestMessage
source · pub struct ChatCompletionRequestMessage {
pub role: Role,
pub content: Option<String>,
pub name: Option<String>,
pub function_call: Option<FunctionCall>,
}
Fields§
§role: Role
The role of the messages author. One of system
, user
, assistant
, or function
.
content: Option<String>
The contents of the message.
content
is required for all messages except assistant messages with function calls.
name: Option<String>
The name of the author of this message. name
is required if role is function,
and it should be the name of the function whose response is in the content
.
May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
function_call: Option<FunctionCall>
The name and arguments of a function that should be called, as generated by the model.
Trait Implementations§
source§impl Clone for ChatCompletionRequestMessage
impl Clone for ChatCompletionRequestMessage
source§fn clone(&self) -> ChatCompletionRequestMessage
fn clone(&self) -> ChatCompletionRequestMessage
Returns a copy 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 ChatCompletionRequestMessage
impl Debug for ChatCompletionRequestMessage
source§impl Default for ChatCompletionRequestMessage
impl Default for ChatCompletionRequestMessage
source§fn default() -> ChatCompletionRequestMessage
fn default() -> ChatCompletionRequestMessage
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ChatCompletionRequestMessage
impl<'de> Deserialize<'de> for ChatCompletionRequestMessage
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<ChatCompletionRequestMessage> for ChatCompletionRequestMessage
impl PartialEq<ChatCompletionRequestMessage> for ChatCompletionRequestMessage
source§fn eq(&self, other: &ChatCompletionRequestMessage) -> bool
fn eq(&self, other: &ChatCompletionRequestMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ChatCompletionRequestMessage
Auto Trait Implementations§
impl RefUnwindSafe for ChatCompletionRequestMessage
impl Send for ChatCompletionRequestMessage
impl Sync for ChatCompletionRequestMessage
impl Unpin for ChatCompletionRequestMessage
impl UnwindSafe for ChatCompletionRequestMessage
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