pub struct CreateMessageRequestBuilder { /* private fields */ }
Expand description
Builder for CreateMessageRequest
.
Implementations§
Source§impl CreateMessageRequestBuilder
impl CreateMessageRequestBuilder
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 CreateMessageRequestBuilder
impl Clone for CreateMessageRequestBuilder
Source§fn clone(&self) -> CreateMessageRequestBuilder
fn clone(&self) -> CreateMessageRequestBuilder
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 CreateMessageRequestBuilder
impl Debug for CreateMessageRequestBuilder
Auto Trait Implementations§
impl Freeze for CreateMessageRequestBuilder
impl RefUnwindSafe for CreateMessageRequestBuilder
impl Send for CreateMessageRequestBuilder
impl Sync for CreateMessageRequestBuilder
impl Unpin for CreateMessageRequestBuilder
impl UnwindSafe for CreateMessageRequestBuilder
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