pub struct ContextConfig {
pub max_tokens: usize,
pub reserve_output_tokens: usize,
pub safety_margin_tokens: usize,
pub bytes_per_token: usize,
pub summary_max_chars: usize,
}Expand description
The token budget of BudgetContextPolicy. Tokens are estimated from
serialized bytes, not counted by a tokenizer.
Fields§
§max_tokens: usizeThe model’s context window.
reserve_output_tokens: usizeRoom kept free for the model’s answer.
safety_margin_tokens: usizeExtra room for estimation error.
bytes_per_token: usizeBytes of serialized text counted as one token.
summary_max_chars: usizeLongest summary note that stands in for compacted history.
Trait Implementations§
Source§impl Clone for ContextConfig
impl Clone for ContextConfig
Source§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