pub trait Compactor: Send + Sync {
// Required method
fn summarize<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
messages: &'life2 [ChatMessage],
operation_id: &'life3 str,
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,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided method
fn name(&self) -> &str { ... }
}Expand description
Produces the summary that replaces old transcript when the context overflows.
Required Methods§
Sourcefn summarize<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
messages: &'life2 [ChatMessage],
operation_id: &'life3 str,
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,
'life2: 'async_trait,
'life3: 'async_trait,
fn summarize<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
messages: &'life2 [ChatMessage],
operation_id: &'life3 str,
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,
'life2: 'async_trait,
'life3: 'async_trait,
Summarize transcript, returning the summary and the usage it cost.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".