pub struct CompactionService { /* private fields */ }Expand description
Compaction service
Implementations§
Source§impl CompactionService
impl CompactionService
pub fn new(config: CompactionConfig) -> Self
Sourcepub fn should_compact(&self, current_tokens: u64, context_window: u64) -> bool
pub fn should_compact(&self, current_tokens: u64, context_window: u64) -> bool
Check if compaction is needed based on current usage
Sourcepub fn summary_prompt(&self) -> &str
pub fn summary_prompt(&self) -> &str
Get the summary prompt
Sourcepub fn update_usage(&mut self, usage: &TokenUsage)
pub fn update_usage(&mut self, usage: &TokenUsage)
Update token usage
Sourcepub fn get_usage(&self) -> &TokenUsage
pub fn get_usage(&self) -> &TokenUsage
Get current usage
Auto Trait Implementations§
impl Freeze for CompactionService
impl RefUnwindSafe for CompactionService
impl Send for CompactionService
impl Sync for CompactionService
impl Unpin for CompactionService
impl UnsafeUnpin for CompactionService
impl UnwindSafe for CompactionService
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