pub trait CompactionPolicy:
Debug
+ Send
+ Sync {
// Required method
fn should_compact(
&self,
estimated_input_tokens: usize,
context_window: u64,
) -> bool;
}Expand description
Policy deciding whether a context overflow should trigger automatic compaction before the next model request.
The kernel never generates a summary itself; when this policy allows
compaction, it requests one from a product-supplied CompactionSummarizer.
Required Methods§
Sourcefn should_compact(
&self,
estimated_input_tokens: usize,
context_window: u64,
) -> bool
fn should_compact( &self, estimated_input_tokens: usize, context_window: u64, ) -> bool
Returns whether automatic compaction should run for an overflow.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".