pub enum ContextStrategyConfig {
Unlimited,
SlidingWindow {
max_tokens: u32,
},
Summarize {
threshold: u32,
},
}Expand description
Context window management strategy.
Variants§
Unlimited
No trimming (default).
SlidingWindow
Sliding window: trim old messages to stay within max_tokens.
Summarize
Summarize: compress old messages when context exceeds threshold tokens.
Trait Implementations§
Source§impl Clone for ContextStrategyConfig
impl Clone for ContextStrategyConfig
Source§fn clone(&self) -> ContextStrategyConfig
fn clone(&self) -> ContextStrategyConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ContextStrategyConfig
impl Debug for ContextStrategyConfig
Source§impl<'de> Deserialize<'de> for ContextStrategyConfig
impl<'de> Deserialize<'de> for ContextStrategyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextStrategyConfig
impl PartialEq for ContextStrategyConfig
Source§fn eq(&self, other: &ContextStrategyConfig) -> bool
fn eq(&self, other: &ContextStrategyConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ContextStrategyConfig
Auto Trait Implementations§
impl Freeze for ContextStrategyConfig
impl RefUnwindSafe for ContextStrategyConfig
impl Send for ContextStrategyConfig
impl Sync for ContextStrategyConfig
impl Unpin for ContextStrategyConfig
impl UnsafeUnpin for ContextStrategyConfig
impl UnwindSafe for ContextStrategyConfig
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