Skip to main content

CompactionStrategy

Trait CompactionStrategy 

Source
pub trait CompactionStrategy: Send + Sync {
    // Required methods
    fn micro_compact(
        &self,
        messages: &mut Vec<ModelMessage>,
        gap_threshold_minutes: u64,
    ) -> usize;
    fn auto_compact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        state: &'life1 mut CompactState,
        messages: &'life2 mut Vec<ModelMessage>,
        provider: &'life3 dyn ModelProvider,
        model: &'life4 str,
        config: &'life5 HarnessConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CompactOutcome>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait;

    // Provided method
    fn force_compact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        state: &'life1 mut CompactState,
        messages: &'life2 mut Vec<ModelMessage>,
        provider: &'life3 dyn ModelProvider,
        model: &'life4 str,
        config: &'life5 HarnessConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CompactOutcome>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait { ... }
}

Required Methods§

Source

fn micro_compact( &self, messages: &mut Vec<ModelMessage>, gap_threshold_minutes: u64, ) -> usize

Source

fn auto_compact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, state: &'life1 mut CompactState, messages: &'life2 mut Vec<ModelMessage>, provider: &'life3 dyn ModelProvider, model: &'life4 str, config: &'life5 HarnessConfig, ) -> Pin<Box<dyn Future<Output = Result<Option<CompactOutcome>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Provided Methods§

Source

fn force_compact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, state: &'life1 mut CompactState, messages: &'life2 mut Vec<ModelMessage>, provider: &'life3 dyn ModelProvider, model: &'life4 str, config: &'life5 HarnessConfig, ) -> Pin<Box<dyn Future<Output = Result<Option<CompactOutcome>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Force full compaction with the session model (manual Compact).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§