pub struct ModelSelector<'a> { /* private fields */ }Expand description
Queries a ModelProvider and selects models that meet specified criteria.
Implementations§
Source§impl<'a> ModelSelector<'a>
impl<'a> ModelSelector<'a>
Sourcepub const fn new(models: &'a [ModelInfo]) -> Self
pub const fn new(models: &'a [ModelInfo]) -> Self
Create a selector over a slice of model infos.
Sourcepub fn by_provider(&self, prefix: &str) -> Vec<&ModelInfo>
pub fn by_provider(&self, prefix: &str) -> Vec<&ModelInfo>
Return all models from a provider whose ID starts with prefix.
Sourcepub fn with_tool_calling(&self) -> Vec<&ModelInfo>
pub fn with_tool_calling(&self) -> Vec<&ModelInfo>
Return all models that support tool calling.
Sourcepub fn with_vision(&self) -> Vec<&ModelInfo>
pub fn with_vision(&self) -> Vec<&ModelInfo>
Return all models that support vision (image input).
Sourcepub fn with_streaming(&self) -> Vec<&ModelInfo>
pub fn with_streaming(&self) -> Vec<&ModelInfo>
Return all models that support streaming.
Sourcepub fn with_structured_output(&self) -> Vec<&ModelInfo>
pub fn with_structured_output(&self) -> Vec<&ModelInfo>
Return all models that support native structured output.
Sourcepub fn with_effort_levels(&self) -> Vec<&ModelInfo>
pub fn with_effort_levels(&self) -> Vec<&ModelInfo>
Return all models that support effort levels.
Sourcepub fn by_min_context(&self, min_tokens: u32) -> Vec<&ModelInfo>
pub fn by_min_context(&self, min_tokens: u32) -> Vec<&ModelInfo>
Return all models with a context window at least min_tokens.
Auto Trait Implementations§
impl<'a> Freeze for ModelSelector<'a>
impl<'a> RefUnwindSafe for ModelSelector<'a>
impl<'a> Send for ModelSelector<'a>
impl<'a> Sync for ModelSelector<'a>
impl<'a> Unpin for ModelSelector<'a>
impl<'a> UnsafeUnpin for ModelSelector<'a>
impl<'a> UnwindSafe for ModelSelector<'a>
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