pub struct ContextConfig {
pub max_context_tokens: usize,
pub reserve_output_tokens: usize,
}Expand description
Configuration for context window management.
Fields§
§max_context_tokens: usizeMaximum estimated tokens for the context window. Messages will be compacted when approaching this limit.
reserve_output_tokens: usizeReserve this many tokens for the model’s response. Context budget = max_context_tokens - reserve_output_tokens.
Implementations§
Source§impl ContextConfig
impl ContextConfig
Sourcepub fn input_budget(&self) -> usize
pub fn input_budget(&self) -> usize
Context budget available for input messages.
Trait Implementations§
Source§impl Clone for ContextConfig
impl Clone for ContextConfig
Source§fn clone(&self) -> ContextConfig
fn clone(&self) -> ContextConfig
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 moreSource§impl Debug for ContextConfig
impl Debug for ContextConfig
Auto Trait Implementations§
impl Freeze for ContextConfig
impl RefUnwindSafe for ContextConfig
impl Send for ContextConfig
impl Sync for ContextConfig
impl Unpin for ContextConfig
impl UnsafeUnpin for ContextConfig
impl UnwindSafe for ContextConfig
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