pub struct CreateMessageRequestArgs { /* private fields */ }
Expand description
Builder for CreateMessageRequest
.
Implementations§
Source§impl CreateMessageRequestArgs
impl CreateMessageRequestArgs
Sourcepub fn role<VALUE: Into<MessageRole>>(&mut self, value: VALUE) -> &mut Self
pub fn role<VALUE: Into<MessageRole>>(&mut self, value: VALUE) -> &mut Self
The role of the entity that is creating the message. Allowed values include:
user
: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.assistant
: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
Sourcepub fn content<VALUE: Into<CreateMessageRequestContent>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn content<VALUE: Into<CreateMessageRequestContent>>( &mut self, value: VALUE, ) -> &mut Self
The content of the message.
Sourcepub fn attachments<VALUE: Into<Vec<MessageAttachment>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn attachments<VALUE: Into<Vec<MessageAttachment>>>( &mut self, value: VALUE, ) -> &mut Self
A list of files attached to the message, and the tools they should be added to.
pub fn metadata<VALUE: Into<HashMap<String, Value>>>( &mut self, value: VALUE, ) -> &mut Self
Sourcepub fn build(&self) -> Result<CreateMessageRequest, OpenAIError>
pub fn build(&self) -> Result<CreateMessageRequest, OpenAIError>
Trait Implementations§
Source§impl Clone for CreateMessageRequestArgs
impl Clone for CreateMessageRequestArgs
Source§fn clone(&self) -> CreateMessageRequestArgs
fn clone(&self) -> CreateMessageRequestArgs
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 CreateMessageRequestArgs
impl Debug for CreateMessageRequestArgs
Auto Trait Implementations§
impl Freeze for CreateMessageRequestArgs
impl RefUnwindSafe for CreateMessageRequestArgs
impl Send for CreateMessageRequestArgs
impl Sync for CreateMessageRequestArgs
impl Unpin for CreateMessageRequestArgs
impl UnwindSafe for CreateMessageRequestArgs
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