pub struct ModelPool {
pub models: Vec<Model>,
/* private fields */
}Expand description
Model pool - manages available models
Fields§
§models: Vec<Model>Implementations§
Source§impl ModelPool
impl ModelPool
pub fn new(configs: Vec<ModelConfig>) -> Self
pub fn get(&self, id: &str) -> Option<&Model>
pub fn get_all(&self) -> &[Model]
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn get_by_capability(&self, capability: &str) -> Vec<&Model>
pub fn get_cheapest(&self) -> Option<&Model>
pub fn get_medium(&self) -> Option<&Model>
pub fn get_best(&self) -> Option<&Model>
pub fn get_fastest(&self) -> Option<&Model>
pub fn get_best_quality(&self) -> Option<&Model>
Sourcepub fn get_sorted_by_cost(&self) -> Vec<&Model>
pub fn get_sorted_by_cost(&self) -> Vec<&Model>
Get models sorted by cost (ascending)
Sourcepub fn get_sorted_by_quality(&self) -> Vec<&Model>
pub fn get_sorted_by_quality(&self) -> Vec<&Model>
Get models sorted by quality (descending)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelPool
impl RefUnwindSafe for ModelPool
impl Send for ModelPool
impl Sync for ModelPool
impl Unpin for ModelPool
impl UnwindSafe for ModelPool
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more