Skip to main content

Compactor

Trait Compactor 

Source
pub trait Compactor: Send + Sync {
    // Required method
    fn summarize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 CompletionRequest,
        cancellation: CancellationToken,
        deadline: Instant,
    ) -> Pin<Box<dyn Future<Output = Result<CompactionResult, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn provider_name(&self) -> Option<&str> { ... }
    fn name(&self) -> &str { ... }
}
Expand description

Produces the summary that replaces old transcript when the context overflows.

Required Methods§

Source

fn summarize<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 CompletionRequest, cancellation: CancellationToken, deadline: Instant, ) -> Pin<Box<dyn Future<Output = Result<CompactionResult, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Summarize transcript, returning the summary and the usage it cost.

Provided Methods§

Source

fn provider_name(&self) -> Option<&str>

Provider frozen before summarization, or unknown for an unlabelled adapter.

Source

fn name(&self) -> &str

Stable name recorded in compaction events.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§