pub struct ModelCapabilities {
pub model_id: String,
pub provider: String,
pub name: String,
pub task_scores: HashMap<TaskType, f64>,
pub context_window: usize,
pub supports_vision: bool,
pub supports_functions: bool,
pub supports_streaming: bool,
pub cost_per_1k_input: f64,
pub cost_per_1k_output: f64,
pub avg_latency_ms: u32,
pub available: bool,
}Expand description
Model capability profile
Fields§
§model_id: StringModel identifier
provider: StringProvider (e.g., “openai”, “anthropic”, “google”)
name: StringDisplay name
task_scores: HashMap<TaskType, f64>Task type scores (0.0 - 1.0)
context_window: usizeContext window size
supports_vision: boolWhether supports vision/images
supports_functions: boolWhether supports function calling
supports_streaming: boolWhether supports streaming
cost_per_1k_input: f64Cost per 1K input tokens (USD)
cost_per_1k_output: f64Cost per 1K output tokens (USD)
avg_latency_ms: u32Average latency in ms
available: boolWhether model is available
Implementations§
Source§impl ModelCapabilities
impl ModelCapabilities
Sourcepub fn new(model_id: &str, provider: &str, name: &str) -> Self
pub fn new(model_id: &str, provider: &str, name: &str) -> Self
Create a new model capabilities profile
Sourcepub fn with_task_score(self, task: TaskType, score: f64) -> Self
pub fn with_task_score(self, task: TaskType, score: f64) -> Self
Set task score
Sourcepub fn with_context_window(self, size: usize) -> Self
pub fn with_context_window(self, size: usize) -> Self
Set context window
Sourcepub fn with_vision(self, supports: bool) -> Self
pub fn with_vision(self, supports: bool) -> Self
Set vision support
Sourcepub fn with_functions(self, supports: bool) -> Self
pub fn with_functions(self, supports: bool) -> Self
Set function calling support
Sourcepub fn with_latency(self, ms: u32) -> Self
pub fn with_latency(self, ms: u32) -> Self
Set latency
Sourcepub fn score_for_task(&self, task: TaskType) -> f64
pub fn score_for_task(&self, task: TaskType) -> f64
Get score for a task type
Trait Implementations§
Source§impl Clone for ModelCapabilities
impl Clone for ModelCapabilities
Source§fn clone(&self) -> ModelCapabilities
fn clone(&self) -> ModelCapabilities
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 ModelCapabilities
impl Debug for ModelCapabilities
Source§impl<'de> Deserialize<'de> for ModelCapabilities
impl<'de> Deserialize<'de> for ModelCapabilities
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelCapabilities
impl RefUnwindSafe for ModelCapabilities
impl Send for ModelCapabilities
impl Sync for ModelCapabilities
impl Unpin for ModelCapabilities
impl UnsafeUnpin for ModelCapabilities
impl UnwindSafe for ModelCapabilities
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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