pub struct SemanticCachedProvider<P> { /* private fields */ }Expand description
Provider wrapper that adds semantic caching
Implementations§
Source§impl<P> SemanticCachedProvider<P>
impl<P> SemanticCachedProvider<P>
Sourcepub fn new(provider: P, cache: SemanticCache) -> Self
pub fn new(provider: P, cache: SemanticCache) -> Self
Create a new semantic cached provider
Sourcepub async fn cache_stats(&self) -> SemanticCacheStats
pub async fn cache_stats(&self) -> SemanticCacheStats
Get cache statistics
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear the cache
Trait Implementations§
Source§impl<P: LlmProvider> LlmProvider for SemanticCachedProvider<P>
impl<P: LlmProvider> LlmProvider for SemanticCachedProvider<P>
fn complete<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<P> Freeze for SemanticCachedProvider<P>
impl<P> !RefUnwindSafe for SemanticCachedProvider<P>
impl<P> Send for SemanticCachedProvider<P>
impl<P> Sync for SemanticCachedProvider<P>
impl<P> Unpin for SemanticCachedProvider<P>
impl<P> !UnwindSafe for SemanticCachedProvider<P>
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