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§
Sourcefn 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,
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§
Sourcefn provider_name(&self) -> Option<&str>
fn provider_name(&self) -> Option<&str>
Provider frozen before summarization, or unknown for an unlabelled adapter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".