pub struct FallbackChain {
pub models: Vec<String>,
}Expand description
Ordered fallback chain that tries models sequentially.
Fields§
§models: Vec<String>Ordered list of "provider/model-id" fallback targets.
Implementations§
Source§impl FallbackChain
impl FallbackChain
Sourcepub async fn try_models(
&self,
registry: &Arc<ProviderRegistry>,
context: &Context,
options: Option<StreamOptions>,
) -> Result<BoxStream, ProviderError>
pub async fn try_models( &self, registry: &Arc<ProviderRegistry>, context: &Context, options: Option<StreamOptions>, ) -> Result<BoxStream, ProviderError>
Try each model in sequence using a ProviderRegistry.
Sourcepub async fn try_models_with_resolver<F>(
&self,
resolver: F,
context: &Context,
options: Option<StreamOptions>,
) -> Result<BoxStream, ProviderError>
pub async fn try_models_with_resolver<F>( &self, resolver: F, context: &Context, options: Option<StreamOptions>, ) -> Result<BoxStream, ProviderError>
Try each model using a generic resolver closure.
Trait Implementations§
Source§impl Clone for FallbackChain
impl Clone for FallbackChain
Source§fn clone(&self) -> FallbackChain
fn clone(&self) -> FallbackChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FallbackChain
impl Debug for FallbackChain
Source§impl Default for FallbackChain
impl Default for FallbackChain
Source§fn default() -> FallbackChain
fn default() -> FallbackChain
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FallbackChain
impl RefUnwindSafe for FallbackChain
impl Send for FallbackChain
impl Sync for FallbackChain
impl Unpin for FallbackChain
impl UnsafeUnpin for FallbackChain
impl UnwindSafe for FallbackChain
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