pub struct CacheExtractor { /* private fields */ }Expand description
Extracts important KV cache entries
Implementations§
Source§impl CacheExtractor
impl CacheExtractor
Sourcepub fn new(config: CacheExtractorConfig) -> Self
pub fn new(config: CacheExtractorConfig) -> Self
Create a new cache extractor
Sourcepub fn add_custom_pattern(&mut self, name: String, pattern: Regex)
pub fn add_custom_pattern(&mut self, name: String, pattern: Regex)
Add a custom pattern
Sourcepub fn extract_entries(
&self,
entries: &[KVEntry],
scorer: &impl CacheEntryScorer,
) -> Vec<ExtractedCacheEntry>
pub fn extract_entries( &self, entries: &[KVEntry], scorer: &impl CacheEntryScorer, ) -> Vec<ExtractedCacheEntry>
Extract important entries from KV cache
Sourcepub fn filter_preserved_entries(
&self,
entries: &[ExtractedCacheEntry],
min_importance: f32,
preserve_system: bool,
preserve_code: bool,
) -> Vec<ExtractedCacheEntry>
pub fn filter_preserved_entries( &self, entries: &[ExtractedCacheEntry], min_importance: f32, preserve_system: bool, preserve_code: bool, ) -> Vec<ExtractedCacheEntry>
Filter entries that should be preserved
Auto Trait Implementations§
impl Freeze for CacheExtractor
impl RefUnwindSafe for CacheExtractor
impl Send for CacheExtractor
impl Sync for CacheExtractor
impl Unpin for CacheExtractor
impl UnsafeUnpin for CacheExtractor
impl UnwindSafe for CacheExtractor
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
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