pub struct CachedProvider<P: LlmProvider> { /* private fields */ }Expand description
Cached LLM provider wrapper
Implementations§
Source§impl<P: LlmProvider> CachedProvider<P>
impl<P: LlmProvider> CachedProvider<P>
Sourcepub fn new(provider: P, config: LlmCacheConfig) -> Self
pub fn new(provider: P, config: LlmCacheConfig) -> Self
Create a cached wrapper around an LLM provider
Trait Implementations§
Source§impl<P: Debug + LlmProvider> Debug for CachedProvider<P>
impl<P: Debug + LlmProvider> Debug for CachedProvider<P>
Source§impl<P: LlmProvider + 'static> LlmProvider for CachedProvider<P>
impl<P: LlmProvider + 'static> LlmProvider for CachedProvider<P>
Source§fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the provider is available
Auto Trait Implementations§
impl<P> !Freeze for CachedProvider<P>
impl<P> !RefUnwindSafe for CachedProvider<P>
impl<P> Send for CachedProvider<P>
impl<P> Sync for CachedProvider<P>
impl<P> Unpin for CachedProvider<P>where
P: Unpin,
impl<P> !UnwindSafe for CachedProvider<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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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