pub struct MessageCreateParams {
pub role: String,
pub content: MessageContentInput,
pub attachments: Option<Vec<Value>>,
pub metadata: Option<HashMap<String, String>>,
}Expand description
Request body for POST /threads/{tid}/messages.
Fields§
§role: String"user" or "assistant".
content: MessageContentInput§attachments: Option<Vec<Value>>§metadata: Option<HashMap<String, String>>Implementations§
Source§impl MessageCreateParams
impl MessageCreateParams
pub fn new( role: impl Into<String>, content: impl Into<MessageContentInput>, ) -> Self
Sourcepub fn user(content: impl Into<MessageContentInput>) -> Self
pub fn user(content: impl Into<MessageContentInput>) -> Self
A message with role "user".
Sourcepub fn assistant(content: impl Into<MessageContentInput>) -> Self
pub fn assistant(content: impl Into<MessageContentInput>) -> Self
A message with role "assistant".
pub fn attachments(self, attachments: Vec<Value>) -> Self
pub fn metadata(self, metadata: HashMap<String, String>) -> Self
Trait Implementations§
Source§impl Clone for MessageCreateParams
impl Clone for MessageCreateParams
Source§fn clone(&self) -> MessageCreateParams
fn clone(&self) -> MessageCreateParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MessageCreateParams
impl Debug for MessageCreateParams
Auto Trait Implementations§
impl Freeze for MessageCreateParams
impl RefUnwindSafe for MessageCreateParams
impl Send for MessageCreateParams
impl Sync for MessageCreateParams
impl Unpin for MessageCreateParams
impl UnsafeUnpin for MessageCreateParams
impl UnwindSafe for MessageCreateParams
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