pub struct ChatCompletionRequestMessageArgs { /* private fields */ }
Expand description
Builder for ChatCompletionRequestMessage
.
Implementations§
source§impl ChatCompletionRequestMessageArgs
impl ChatCompletionRequestMessageArgs
sourcepub fn role<VALUE: Into<Role>>(&mut self, value: VALUE) -> &mut Self
pub fn role<VALUE: Into<Role>>(&mut self, value: VALUE) -> &mut Self
The role of the messages author. One of system
, user
, assistant
, or function
.
sourcepub fn content<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn content<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The contents of the message.
content
is required for all messages except assistant messages with function calls.
sourcepub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
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.
sourcepub fn function_call<VALUE: Into<FunctionCall>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn function_call<VALUE: Into<FunctionCall>>( &mut self, value: VALUE ) -> &mut Self
The name and arguments of a function that should be called, as generated by the model.
sourcepub fn build(&self) -> Result<ChatCompletionRequestMessage, OpenAIError>
pub fn build(&self) -> Result<ChatCompletionRequestMessage, OpenAIError>
Trait Implementations§
source§impl Clone for ChatCompletionRequestMessageArgs
impl Clone for ChatCompletionRequestMessageArgs
source§fn clone(&self) -> ChatCompletionRequestMessageArgs
fn clone(&self) -> ChatCompletionRequestMessageArgs
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 moreAuto Trait Implementations§
impl RefUnwindSafe for ChatCompletionRequestMessageArgs
impl Send for ChatCompletionRequestMessageArgs
impl Sync for ChatCompletionRequestMessageArgs
impl Unpin for ChatCompletionRequestMessageArgs
impl UnwindSafe for ChatCompletionRequestMessageArgs
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