pub struct MultiProvider { /* private fields */ }Expand description
ModelProvider that fans out to every env-configured backend.
Implementations§
Source§impl MultiProvider
impl MultiProvider
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build from the current process environment. Logs configured backends to stderr (stdout is reserved for the socket path).
pub fn from_backends(backends: Vec<ResolvedBackend>) -> Self
Sourcepub fn backends(&self) -> &[ResolvedBackend]
pub fn backends(&self) -> &[ResolvedBackend]
Backends in resolution order (for debugging / tests).
Trait Implementations§
Source§impl ModelProvider for MultiProvider
impl ModelProvider for MultiProvider
Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelEntry>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelEntry>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List the models available from this provider. The first entry is the
provider’s default model.
Source§fn invoke_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelStream, CompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invoke_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelStream, CompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Invoke a model by its provider-scoped id, streaming the completion
response.
Auto Trait Implementations§
impl !RefUnwindSafe for MultiProvider
impl !UnwindSafe for MultiProvider
impl Forget for MultiProvider
impl Freeze for MultiProvider
impl Send for MultiProvider
impl Sync for MultiProvider
impl Unpin for MultiProvider
impl UnsafeUnpin for MultiProvider
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