pub struct NoCompaction;Expand description
A no-op context strategy that never compacts.
Useful for short conversations or when the provider handles truncation natively.
Trait Implementations§
Source§impl ContextStrategy for NoCompaction
impl ContextStrategy for NoCompaction
Source§fn token_estimate(&self, messages: &[ProviderMessage]) -> usize
fn token_estimate(&self, messages: &[ProviderMessage]) -> usize
Estimate token count for a message list.
Source§fn should_compact(&self, _messages: &[ProviderMessage], _limit: usize) -> bool
fn should_compact(&self, _messages: &[ProviderMessage], _limit: usize) -> bool
Whether compaction should run given the current messages and limit.
Source§fn compact(&self, messages: Vec<ProviderMessage>) -> Vec<ProviderMessage>
fn compact(&self, messages: Vec<ProviderMessage>) -> Vec<ProviderMessage>
Compact the message list. Returns a shorter list.
Auto Trait Implementations§
impl Freeze for NoCompaction
impl RefUnwindSafe for NoCompaction
impl Send for NoCompaction
impl Sync for NoCompaction
impl Unpin for NoCompaction
impl UnsafeUnpin for NoCompaction
impl UnwindSafe for NoCompaction
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