pub struct ChatSessionBuilder { /* private fields */ }Expand description
Builder for constructing a ChatSession with custom configuration.
Implementations§
Source§impl ChatSessionBuilder
impl ChatSessionBuilder
Sourcepub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
Set the system prompt (default: “You are a helpful assistant.”)
Sourcepub fn max_context(self, max_context: usize) -> Self
pub fn max_context(self, max_context: usize) -> Self
Set the maximum context window in tokens (default: 32768)
Sourcepub fn tokenizer_gateway(self, gateway: TokenizerGateway) -> Self
pub fn tokenizer_gateway(self, gateway: TokenizerGateway) -> Self
Set a custom tokenizer gateway (default: cl100k_base)
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set the temperature for generation (default: 1.0)
Sourcepub fn build(self) -> ChatSession
pub fn build(self) -> ChatSession
Build the chat session
Auto Trait Implementations§
impl Freeze for ChatSessionBuilder
impl !RefUnwindSafe for ChatSessionBuilder
impl Send for ChatSessionBuilder
impl Sync for ChatSessionBuilder
impl Unpin for ChatSessionBuilder
impl !UnwindSafe for ChatSessionBuilder
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