pub struct ProgressiveCompressor { /* private fields */ }Expand description
Progressive compression controller.
Implementations§
Source§impl ProgressiveCompressor
impl ProgressiveCompressor
Sourcepub fn new(config: ProgressiveConfig) -> Self
pub fn new(config: ProgressiveConfig) -> Self
Create a new progressive compressor.
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration.
Sourcepub fn adaptive_create(messages: &[Message]) -> Self
pub fn adaptive_create(messages: &[Message]) -> Self
创建自适应配置的压缩器(基于对话复杂度)
Sourcepub fn set_focus_manager(&mut self, manager: FocusManager)
pub fn set_focus_manager(&mut self, manager: FocusManager)
Set focus manager.
Sourcepub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
pub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
Set custom hardcode config.
Sourcepub async fn compress(
&mut self,
messages: &[Message],
provider: Option<&dyn Provider>,
) -> Result<Vec<Message>>
pub async fn compress( &mut self, messages: &[Message], provider: Option<&dyn Provider>, ) -> Result<Vec<Message>>
Compress messages using progressive strategy.
Sourcepub fn compress_segments(
&self,
segments: Vec<Vec<Message>>,
focus: &ConversationFocus,
coherence: &CoherenceDetector,
) -> Result<Vec<Message>>
pub fn compress_segments( &self, segments: Vec<Vec<Message>>, focus: &ConversationFocus, coherence: &CoherenceDetector, ) -> Result<Vec<Message>>
Compress segments while maintaining coherence and focus priority.
This method is designed to work with the integrated processor, compressing pre-segmented messages while considering focus relevance.
§Arguments
segments- Pre-segmented message groups from CoherenceDetector.focus- Current conversation focus.coherence- Coherence detector for scoring.
§Returns
Compressed messages with focus-aware prioritization.
Trait Implementations§
Source§impl Clone for ProgressiveCompressor
impl Clone for ProgressiveCompressor
Source§fn clone(&self) -> ProgressiveCompressor
fn clone(&self) -> ProgressiveCompressor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProgressiveCompressor
impl RefUnwindSafe for ProgressiveCompressor
impl Send for ProgressiveCompressor
impl Sync for ProgressiveCompressor
impl Unpin for ProgressiveCompressor
impl UnsafeUnpin for ProgressiveCompressor
impl UnwindSafe for ProgressiveCompressor
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