pub struct RetryProvider<P> { /* private fields */ }Expand description
A wrapper that adds retry functionality to any LLM provider
Implementations§
Source§impl<P> RetryProvider<P>
impl<P> RetryProvider<P>
Sourcepub fn with_config(provider: P, config: RetryConfig) -> Self
pub fn with_config(provider: P, config: RetryConfig) -> Self
Create a new RetryProvider with custom configuration
Sourcepub fn config(&self) -> &RetryConfig
pub fn config(&self) -> &RetryConfig
Get the retry configuration
Trait Implementations§
Source§impl<P: EmbeddingProvider> EmbeddingProvider for RetryProvider<P>
impl<P: EmbeddingProvider> EmbeddingProvider for RetryProvider<P>
fn embed<'life0, 'async_trait>(
&'life0 self,
request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<P: LlmProvider> LlmProvider for RetryProvider<P>
impl<P: LlmProvider> LlmProvider for RetryProvider<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,
Source§impl<P: StreamingLlmProvider> StreamingLlmProvider for RetryProvider<P>
impl<P: StreamingLlmProvider> StreamingLlmProvider for RetryProvider<P>
Source§fn complete_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream completion responses token-by-token
Auto Trait Implementations§
impl<P> Freeze for RetryProvider<P>where
P: Freeze,
impl<P> RefUnwindSafe for RetryProvider<P>where
P: RefUnwindSafe,
impl<P> Send for RetryProvider<P>where
P: Send,
impl<P> Sync for RetryProvider<P>where
P: Sync,
impl<P> Unpin for RetryProvider<P>where
P: Unpin,
impl<P> UnwindSafe for RetryProvider<P>where
P: UnwindSafe,
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