pub struct BasicCompactionRule {
pub tool_result_limit: usize,
pub assistant_content_limit: usize,
pub keep_recent: usize,
}Expand description
A basic compaction rule that compresses large tool results and assistant messages
Fields§
§tool_result_limit: usize§assistant_content_limit: usize§keep_recent: usizeTrait Implementations§
Source§impl CompactionRule for BasicCompactionRule
impl CompactionRule for BasicCompactionRule
Source§fn should_compact(&self, messages: &[ChatMessage]) -> bool
fn should_compact(&self, messages: &[ChatMessage]) -> bool
Determine if compaction should be performed on the given messages
Source§fn select_targets(&self, messages: &[ChatMessage]) -> Vec<usize>
fn select_targets(&self, messages: &[ChatMessage]) -> Vec<usize>
Select which message indices should be targeted for compaction
Source§fn apply_compaction(&self, messages: &mut [ChatMessage], targets: &[usize])
fn apply_compaction(&self, messages: &mut [ChatMessage], targets: &[usize])
Apply the compaction to the selected messages
Auto Trait Implementations§
impl Freeze for BasicCompactionRule
impl RefUnwindSafe for BasicCompactionRule
impl Send for BasicCompactionRule
impl Sync for BasicCompactionRule
impl Unpin for BasicCompactionRule
impl UnsafeUnpin for BasicCompactionRule
impl UnwindSafe for BasicCompactionRule
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