pub struct RoutingProvider { /* private fields */ }Expand description
A provider that acts as a router, delegating to other providers based on the model name.
Model names must be in the format provider/model (e.g., openai/gpt-4).
Implementations§
Source§impl RoutingProvider
impl RoutingProvider
Sourcepub fn new(registry: ProviderRegistry) -> Self
pub fn new(registry: ProviderRegistry) -> Self
Create a new routing provider with the given registry
Trait Implementations§
Source§impl Clone for RoutingProvider
impl Clone for RoutingProvider
Source§fn clone(&self) -> RoutingProvider
fn clone(&self) -> RoutingProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoutingProvider
impl Debug for RoutingProvider
Source§impl Provider for RoutingProvider
impl Provider for RoutingProvider
Source§fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a chat completion
Source§fn chat_completion_stream(
&self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionStream, LlmError>> + Send + '_>>
fn chat_completion_stream( &self, request: ChatCompletionRequest, ) -> Pin<Box<dyn Future<Output = Result<ChatCompletionStream, LlmError>> + Send + '_>>
Stream a chat completion
Source§fn embeddings<'life0, 'async_trait>(
&'life0 self,
request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embeddings<'life0, 'async_trait>(
&'life0 self,
request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for text
Source§fn supported_models(&self) -> Vec<String>
fn supported_models(&self) -> Vec<String>
Get the list of models supported by this provider
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider name
Auto Trait Implementations§
impl Freeze for RoutingProvider
impl !RefUnwindSafe for RoutingProvider
impl Send for RoutingProvider
impl Sync for RoutingProvider
impl Unpin for RoutingProvider
impl UnsafeUnpin for RoutingProvider
impl !UnwindSafe for RoutingProvider
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