pub struct TimeoutProvider<P> { /* private fields */ }Expand description
A wrapper that adds timeout functionality to any LLM provider
Implementations§
Source§impl<P> TimeoutProvider<P>
impl<P> TimeoutProvider<P>
Sourcepub fn with_config(provider: P, config: TimeoutConfig) -> Self
pub fn with_config(provider: P, config: TimeoutConfig) -> Self
Create a new TimeoutProvider with custom timeout configuration
Sourcepub fn with_timeout(provider: P, timeout: Duration) -> Self
pub fn with_timeout(provider: P, timeout: Duration) -> Self
Create a new TimeoutProvider with a uniform timeout
Sourcepub fn config(&self) -> &TimeoutConfig
pub fn config(&self) -> &TimeoutConfig
Get the timeout configuration
Trait Implementations§
Source§impl<P: EmbeddingProvider> EmbeddingProvider for TimeoutProvider<P>
impl<P: EmbeddingProvider> EmbeddingProvider for TimeoutProvider<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 TimeoutProvider<P>
impl<P: LlmProvider> LlmProvider for TimeoutProvider<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 TimeoutProvider<P>
impl<P: StreamingLlmProvider> StreamingLlmProvider for TimeoutProvider<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 TimeoutProvider<P>where
P: Freeze,
impl<P> RefUnwindSafe for TimeoutProvider<P>where
P: RefUnwindSafe,
impl<P> Send for TimeoutProvider<P>where
P: Send,
impl<P> Sync for TimeoutProvider<P>where
P: Sync,
impl<P> Unpin for TimeoutProvider<P>where
P: Unpin,
impl<P> UnwindSafe for TimeoutProvider<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