pub enum CompactionScope {
FixedCount(usize),
TokenBudget,
}Expand description
Controls how many earlier loops are included in compaction and context loading.
Variants§
FixedCount(usize)
Compact a fixed number of earlier loops on the active chain.
TokenBudget
Walk the chain backward, accumulating per-loop token estimates,
and stop when max_context_tokens would be exceeded.
NOTE: The scope can include loops whose raw messages EXCEED
max_context_tokens. This is intentional — the compacted summaries
of those loops will fit in the window, even though the originals
did not. This enables richer context for summarisation strategies
(e.g. LLM summarisers) that compress large loops into compact
representations that then fit within the budget.
Trait Implementations§
Source§impl Clone for CompactionScope
impl Clone for CompactionScope
Source§fn clone(&self) -> CompactionScope
fn clone(&self) -> CompactionScope
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 CompactionScope
impl Debug for CompactionScope
Source§impl Default for CompactionScope
impl Default for CompactionScope
Source§impl<'de> Deserialize<'de> for CompactionScope
impl<'de> Deserialize<'de> for CompactionScope
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
Auto Trait Implementations§
impl Freeze for CompactionScope
impl RefUnwindSafe for CompactionScope
impl Send for CompactionScope
impl Sync for CompactionScope
impl Unpin for CompactionScope
impl UnsafeUnpin for CompactionScope
impl UnwindSafe for CompactionScope
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