pub struct CacheConfig {
pub max_entries: usize,
pub ttl: Duration,
pub cache_completions: bool,
pub cache_embeddings: bool,
}Expand description
Configuration for the LLM cache.
Fields§
§max_entries: usizeMaximum number of entries in the cache.
ttl: DurationTime-to-live for cache entries.
cache_completions: boolWhether to cache completions.
cache_embeddings: boolWhether to cache embeddings.
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn with_completion_caching(self, enabled: bool) -> Self
pub fn with_completion_caching(self, enabled: bool) -> Self
Enable or disable completion caching.
Sourcepub fn with_embedding_caching(self, enabled: bool) -> Self
pub fn with_embedding_caching(self, enabled: bool) -> Self
Enable or disable embedding caching.
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheConfig
impl Debug for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnsafeUnpin for CacheConfig
impl UnwindSafe for CacheConfig
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