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 completion_config(self, config: CompletionConfig) -> Self
pub fn completion_config(self, config: CompletionConfig) -> Self
Set provider controls for every turn, including tool continuations and streams.
Unset controls use provider settings. max_context remains a local history
budget and does not set the provider’s num_ctx.
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set the temperature for generation (default: provider setting)
Sourcepub fn build(self) -> ChatSession
pub fn build(self) -> ChatSession
Build the chat session
Auto Trait Implementations§
impl !RefUnwindSafe for ChatSessionBuilder
impl !UnwindSafe for ChatSessionBuilder
impl Freeze for ChatSessionBuilder
impl Send for ChatSessionBuilder
impl Sync for ChatSessionBuilder
impl Unpin for ChatSessionBuilder
impl UnsafeUnpin 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