pub struct AiCompressor { /* private fields */ }Expand description
AI-based compressor using a Provider.
Implementations§
Source§impl AiCompressor
impl AiCompressor
pub fn new(provider: Box<dyn Provider>, model: String) -> Self
Sourcepub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
pub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
Set custom hardcode config
Trait Implementations§
Source§impl Compressor for AiCompressor
impl Compressor for AiCompressor
Source§fn summarize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
_config: &'life2 CompressionConfig,
) -> Pin<Box<dyn Future<Output = Result<SummarizedSegment>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn summarize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
_config: &'life2 CompressionConfig,
) -> Pin<Box<dyn Future<Output = Result<SummarizedSegment>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compress messages using AI summarization.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name used.
Auto Trait Implementations§
impl !RefUnwindSafe for AiCompressor
impl !UnwindSafe for AiCompressor
impl Freeze for AiCompressor
impl Send for AiCompressor
impl Sync for AiCompressor
impl Unpin for AiCompressor
impl UnsafeUnpin for AiCompressor
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