pub struct MessageCreateBuilder { /* private fields */ }
Expand description
Builder for creating message requests ergonomically
Implementations§
Source§impl MessageCreateBuilder
impl MessageCreateBuilder
Sourcepub fn message(self, role: Role, content: impl Into<MessageContent>) -> Self
pub fn message(self, role: Role, content: impl Into<MessageContent>) -> Self
Add a message to the conversation
Sourcepub fn user(self, content: impl Into<MessageContent>) -> Self
pub fn user(self, content: impl Into<MessageContent>) -> Self
Add a user message
Sourcepub fn assistant(self, content: impl Into<MessageContent>) -> Self
pub fn assistant(self, content: impl Into<MessageContent>) -> Self
Add an assistant message
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set the temperature
Sourcepub fn stop_sequences(self, stop_sequences: Vec<String>) -> Self
pub fn stop_sequences(self, stop_sequences: Vec<String>) -> Self
Set custom stop sequences
Sourcepub fn tool_choice(self, tool_choice: ToolChoice) -> Self
pub fn tool_choice(self, tool_choice: ToolChoice) -> Self
Set tool choice strategy
Sourcepub fn build(self) -> MessageCreateParams
pub fn build(self) -> MessageCreateParams
Build the message creation parameters
Trait Implementations§
Source§impl Clone for MessageCreateBuilder
impl Clone for MessageCreateBuilder
Source§fn clone(&self) -> MessageCreateBuilder
fn clone(&self) -> MessageCreateBuilder
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 moreAuto Trait Implementations§
impl Freeze for MessageCreateBuilder
impl RefUnwindSafe for MessageCreateBuilder
impl Send for MessageCreateBuilder
impl Sync for MessageCreateBuilder
impl Unpin for MessageCreateBuilder
impl UnwindSafe for MessageCreateBuilder
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