pub struct MessageBuilder { /* private fields */ }Implementations§
Source§impl MessageBuilder
impl MessageBuilder
pub fn new() -> Self
pub fn id(self, id: MessageId) -> Self
pub fn role(self, role: Role) -> Self
pub fn system(self) -> Self
pub fn user(self) -> Self
pub fn assistant(self) -> Self
pub fn text(self, text: impl Into<String>) -> Self
pub fn image(self, image: ImageContent) -> Self
pub fn content(self, block: ContentBlock) -> Self
pub fn contents(self, blocks: Vec<ContentBlock>) -> Self
pub fn metadata<K: Into<String>, V: Serialize>(self, key: K, value: V) -> Self
pub fn build(self) -> Result<Message, &'static str>
Trait Implementations§
Source§impl Default for MessageBuilder
impl Default for MessageBuilder
Source§fn default() -> MessageBuilder
fn default() -> MessageBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageBuilder
impl RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnwindSafe for MessageBuilder
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