pub struct PromptCompressor { /* private fields */ }Expand description
Standalone input prompt compressor.
This is the intended public API for external agents that want to adopt AINL eco-mode compression without pulling runtime-specific crates.
Implementations§
Source§impl PromptCompressor
impl PromptCompressor
pub fn new(mode: EfficientMode) -> Self
pub fn from_natural_language(mode_hint: &str) -> Self
pub fn with_telemetry_callback( mode: EfficientMode, emit_telemetry: Option<Box<dyn Fn(CompressionMetrics) + Send + Sync>>, ) -> Self
pub fn compress(&self, text: &str) -> Compressed
pub fn compress_with_semantic_score( &self, text: &str, semantic_preservation_score: Option<f32>, ) -> Compressed
Auto Trait Implementations§
impl Freeze for PromptCompressor
impl !RefUnwindSafe for PromptCompressor
impl Send for PromptCompressor
impl Sync for PromptCompressor
impl Unpin for PromptCompressor
impl UnsafeUnpin for PromptCompressor
impl !UnwindSafe for PromptCompressor
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