pub struct CompressionPipeline;Expand description
Pipeline de compresión reversible para contenido de memorias. Inspirado por Headroom (CCR — Context Compression & Retrieval).
Implementations§
Source§impl CompressionPipeline
impl CompressionPipeline
Sourcepub fn compress(
memory: &Memory,
strategy: CompressionStrategy,
) -> CompressedMemory
pub fn compress( memory: &Memory, strategy: CompressionStrategy, ) -> CompressedMemory
Comprime una memoria usando la estrategia especificada.
Sourcepub fn extract_keywords(content: &str) -> Vec<String>
pub fn extract_keywords(content: &str) -> Vec<String>
Extrae keywords relevantes del contenido.
Sourcepub fn compress_context_block(
memories: &[Memory],
strategy: CompressionStrategy,
max_memories: usize,
) -> String
pub fn compress_context_block( memories: &[Memory], strategy: CompressionStrategy, max_memories: usize, ) -> String
Genera un bloque de contexto comprimido para inyección en prompts.
Versión comprimida de MemoryStore::inject_context.
Auto Trait Implementations§
impl Freeze for CompressionPipeline
impl RefUnwindSafe for CompressionPipeline
impl Send for CompressionPipeline
impl Sync for CompressionPipeline
impl Unpin for CompressionPipeline
impl UnsafeUnpin for CompressionPipeline
impl UnwindSafe for CompressionPipeline
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more