pub struct PriorityQueueProvider<P> { /* private fields */ }Expand description
Priority queue provider that wraps any LLM provider
Implementations§
Source§impl<P: LlmProvider + 'static> PriorityQueueProvider<P>
impl<P: LlmProvider + 'static> PriorityQueueProvider<P>
Sourcepub fn new(provider: P, config: PriorityQueueConfig) -> Self
pub fn new(provider: P, config: PriorityQueueConfig) -> Self
Create a new priority queue provider
Sourcepub async fn complete_with_priority(
&self,
request: LlmRequest,
priority: RequestPriority,
) -> Result<LlmResponse>
pub async fn complete_with_priority( &self, request: LlmRequest, priority: RequestPriority, ) -> Result<LlmResponse>
Submit a request with specified priority
Sourcepub async fn stats(&self) -> PriorityQueueStats
pub async fn stats(&self) -> PriorityQueueStats
Get current queue statistics
Trait Implementations§
Source§impl<P: LlmProvider + 'static> LlmProvider for PriorityQueueProvider<P>
impl<P: LlmProvider + 'static> LlmProvider for PriorityQueueProvider<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 PriorityQueueProvider<P>
impl<P> !RefUnwindSafe for PriorityQueueProvider<P>
impl<P> Send for PriorityQueueProvider<P>where
P: Send,
impl<P> Sync for PriorityQueueProvider<P>where
P: Sync,
impl<P> Unpin for PriorityQueueProvider<P>where
P: Unpin,
impl<P> !UnwindSafe for PriorityQueueProvider<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