pub struct ModelMetadata {Show 17 fields
pub provider: String,
pub model: String,
pub cost_class: CostClass,
pub typical_latency_ms: u32,
pub quality: f64,
pub has_reasoning: bool,
pub supports_web_search: bool,
pub data_sovereignty: DataSovereignty,
pub compliance: ComplianceLevel,
pub supports_multilingual: bool,
pub context_tokens: usize,
pub supports_tool_use: bool,
pub supports_vision: bool,
pub supports_structured_output: bool,
pub supports_code: bool,
pub country: String,
pub region: String,
}Expand description
Model metadata for selection.
Fields§
§provider: StringProvider name (e.g., “anthropic”, “openai”).
model: StringModel identifier (e.g., “claude-haiku-4-5-20251001”).
cost_class: CostClassCost class of this model.
typical_latency_ms: u32Typical latency in milliseconds.
quality: f64Quality score (0.0-1.0).
has_reasoning: boolWhether this model has strong reasoning capabilities.
supports_web_search: boolWhether this model supports web search.
data_sovereignty: DataSovereigntyData sovereignty region.
compliance: ComplianceLevelCompliance level.
supports_multilingual: boolWhether this model supports multiple languages.
context_tokens: usizeContext window size in tokens.
supports_tool_use: boolWhether this model supports tool/function calling.
supports_vision: boolWhether this model supports vision/images.
supports_structured_output: boolWhether this model supports structured output (JSON mode).
supports_code: boolWhether this model is specialized for code.
country: StringProvider’s country (ISO code, e.g., “US”, “FR”, “CN”).
region: StringProvider’s region (e.g., “US”, “EU”, “CN”, “LOCAL”).
Implementations§
Source§impl ModelMetadata
impl ModelMetadata
Sourcepub fn new(
provider: impl Into<String>,
model: impl Into<String>,
cost_class: CostClass,
typical_latency_ms: u32,
quality: f64,
) -> Self
pub fn new( provider: impl Into<String>, model: impl Into<String>, cost_class: CostClass, typical_latency_ms: u32, quality: f64, ) -> Self
Creates new model metadata.
Sourcepub fn with_reasoning(self, has: bool) -> Self
pub fn with_reasoning(self, has: bool) -> Self
Sets reasoning capability.
Sourcepub fn with_web_search(self, supports: bool) -> Self
pub fn with_web_search(self, supports: bool) -> Self
Sets web search support.
Sourcepub fn with_data_sovereignty(self, sovereignty: DataSovereignty) -> Self
pub fn with_data_sovereignty(self, sovereignty: DataSovereignty) -> Self
Sets data sovereignty.
Sourcepub fn with_compliance(self, compliance: ComplianceLevel) -> Self
pub fn with_compliance(self, compliance: ComplianceLevel) -> Self
Sets compliance level.
Sourcepub fn with_multilingual(self, supports: bool) -> Self
pub fn with_multilingual(self, supports: bool) -> Self
Sets multilingual support.
Sourcepub fn with_context_tokens(self, tokens: usize) -> Self
pub fn with_context_tokens(self, tokens: usize) -> Self
Sets context window size.
Sourcepub fn with_tool_use(self, supports: bool) -> Self
pub fn with_tool_use(self, supports: bool) -> Self
Sets tool/function calling support.
Sourcepub fn with_vision(self, supports: bool) -> Self
pub fn with_vision(self, supports: bool) -> Self
Sets vision support.
Sourcepub fn with_structured_output(self, supports: bool) -> Self
pub fn with_structured_output(self, supports: bool) -> Self
Sets structured output support.
Sourcepub fn with_location(
self,
country: impl Into<String>,
region: impl Into<String>,
) -> Self
pub fn with_location( self, country: impl Into<String>, region: impl Into<String>, ) -> Self
Sets provider location (country and region).
Sourcepub fn satisfies(&self, requirements: &AgentRequirements) -> bool
pub fn satisfies(&self, requirements: &AgentRequirements) -> bool
Checks if this model satisfies the given requirements.
Sourcepub fn fitness_score(&self, requirements: &AgentRequirements) -> f64
pub fn fitness_score(&self, requirements: &AgentRequirements) -> f64
Calculates a fitness score for matching requirements.
Higher score = better match. Considers:
- Cost efficiency (lower cost within allowed range)
- Latency efficiency (faster within allowed range)
- Quality (higher is better)
Sourcepub fn fitness_breakdown(
&self,
requirements: &AgentRequirements,
) -> Option<FitnessBreakdown>
pub fn fitness_breakdown( &self, requirements: &AgentRequirements, ) -> Option<FitnessBreakdown>
Calculates a detailed fitness breakdown for matching requirements.
Returns None if the model doesn’t satisfy requirements.
Sourcepub fn rejection_reason(
&self,
requirements: &AgentRequirements,
) -> Option<RejectionReason>
pub fn rejection_reason( &self, requirements: &AgentRequirements, ) -> Option<RejectionReason>
Determines why this model was rejected for the given requirements.
Returns None if the model satisfies all requirements.
Trait Implementations§
Source§impl Clone for ModelMetadata
impl Clone for ModelMetadata
Source§fn clone(&self) -> ModelMetadata
fn clone(&self) -> ModelMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more