pub struct DefaultCompaction;Expand description
Default 3-level compaction: truncate tool outputs → summarize turns → drop middle.
This is used automatically when no custom CompactionStrategy is set.
You can also compose it inside a custom strategy — run your logic first,
then delegate to compact_messages() for the actual reduction.
Trait Implementations§
Source§impl CompactionStrategy for DefaultCompaction
impl CompactionStrategy for DefaultCompaction
Source§fn compact(
&self,
messages: Vec<AgentMessage>,
config: &ContextConfig,
) -> Vec<AgentMessage>
fn compact( &self, messages: Vec<AgentMessage>, config: &ContextConfig, ) -> Vec<AgentMessage>
Compact messages to fit within the token budget defined by
config. Read moreAuto Trait Implementations§
impl Freeze for DefaultCompaction
impl RefUnwindSafe for DefaultCompaction
impl Send for DefaultCompaction
impl Sync for DefaultCompaction
impl Unpin for DefaultCompaction
impl UnsafeUnpin for DefaultCompaction
impl UnwindSafe for DefaultCompaction
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