pub trait CompactionStrategy: Send + Sync {
// Required method
fn compact(
&self,
messages: &[Message],
tokenizer: &dyn Tokenizer,
) -> Vec<Message>;
}Expand description
A strategy that reduces a message list to fit some constraint.
Compaction never errors on content — it always returns some retained
subset of messages, in original order. Rust equivalent of upstream
CompactionStrategy.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".