pub struct RateLimit { /* private fields */ }Expand description
Provider produced by RateLimitLayer.
Trait Implementations§
Source§impl LlmProvider for RateLimit
impl LlmProvider for RateLimit
Source§fn chat<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
Single-shot chat completion.
Source§fn chat_stream<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamDelta, LlmError>> + Send>>, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
fn chat_stream<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamDelta, LlmError>> + Send>>, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
Streaming chat completion.
Source§fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RateLimit: 'async_trait,
Generate embeddings.
Source§fn estimate_cost(&self, req: &ChatRequest) -> Option<CostEstimate>
fn estimate_cost(&self, req: &ChatRequest) -> Option<CostEstimate>
Pre-flight cost estimate (no network call).
None if unknown.Auto Trait Implementations§
impl !RefUnwindSafe for RateLimit
impl !UnwindSafe for RateLimit
impl Freeze for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnsafeUnpin for RateLimit
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