pub struct ChatBuilder { /* private fields */ }
Expand description
Builds a Chat
struct for initiating a chat session.
Implementations§
Source§impl ChatBuilder
impl ChatBuilder
Sourcepub fn new(model: ChatModel, api_key: String) -> Self
pub fn new(model: ChatModel, api_key: String) -> Self
Creates a new ChatBuilder
with the given model and API key.
Sourcepub fn len(self, len: usize) -> Self
pub fn len(self, len: usize) -> Self
Sets the amount of user messages that are stored in the chat session.
Sourcepub fn system(self, system: ChatMessage) -> Self
pub fn system(self, system: ChatMessage) -> Self
Sets the system message that is sent to the chat API
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Sets the temperature
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Sets the maximum amount of tokens that can be generated by the chat API.
Sourcepub fn presence_penalty(self, presence_penalty: f32) -> Self
pub fn presence_penalty(self, presence_penalty: f32) -> Self
Sets the presence penalty
Sourcepub fn frequency_penalty(self, frequency_penalty: f32) -> Self
pub fn frequency_penalty(self, frequency_penalty: f32) -> Self
Sets the frequency penalty
Auto Trait Implementations§
impl Freeze for ChatBuilder
impl RefUnwindSafe for ChatBuilder
impl Send for ChatBuilder
impl Sync for ChatBuilder
impl Unpin for ChatBuilder
impl UnwindSafe for ChatBuilder
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