#[ allow( clippy::missing_inline_in_public_items ) ]
mod private
{
use serde::{ Serialize, Deserialize };
use std::time::Duration;
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelInfo
{
pub id : String,
pub display_name : String,
pub name : String,
pub max_tokens : u32,
pub context_length : u32,
pub created_at : Option< String >,
pub supports_tools : bool,
pub supports_vision : bool,
pub version : Option< String >,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelCapabilities
{
pub supports_tools : bool,
pub supports_vision : bool,
pub max_context_length : u32,
pub max_tool_calls : Option< u32 >,
pub input_modalities : Vec< String >,
pub output_modalities : Vec< String >,
}
#[ derive( Debug, Clone, Default ) ]
pub struct ModelRequirements
{
pub requires_vision : bool,
pub requires_tools : bool,
pub min_context_length : u32,
pub max_cost_tier : u32,
pub prefer_speed : bool,
}
#[ derive( Debug, Default ) ]
pub struct ModelRequirementsBuilder
{
requires_vision : bool,
requires_tools : bool,
min_context_length : u32,
max_cost_tier : u32,
prefer_speed : bool,
}
impl ModelRequirementsBuilder
{
#[ must_use ]
pub fn new() -> Self
{
Self::default()
}
#[ must_use ]
pub fn requires_vision( mut self, requires : bool ) -> Self
{
self.requires_vision = requires;
self
}
#[ must_use ]
pub fn requires_tools( mut self, requires : bool ) -> Self
{
self.requires_tools = requires;
self
}
#[ must_use ]
pub fn min_context_length( mut self, length : u32 ) -> Self
{
self.min_context_length = length;
self
}
#[ must_use ]
pub fn max_cost_tier( mut self, tier : u32 ) -> Self
{
self.max_cost_tier = tier;
self
}
#[ must_use ]
pub fn prefer_speed( mut self, prefer : bool ) -> Self
{
self.prefer_speed = prefer;
self
}
#[ must_use ]
pub fn build( self ) -> ModelRequirements
{
ModelRequirements
{
requires_vision : self.requires_vision,
requires_tools : self.requires_tools,
min_context_length : self.min_context_length,
max_cost_tier : self.max_cost_tier,
prefer_speed : self.prefer_speed,
}
}
}
impl ModelRequirements
{
#[ must_use ]
pub fn builder() -> ModelRequirementsBuilder
{
ModelRequirementsBuilder::new()
}
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelAvailability
{
pub is_available : bool,
pub estimated_wait_time : Option< Duration >,
pub load_factor : f32,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelLimits
{
pub max_tokens : u32,
pub temperature_range : TemperatureRange,
pub max_tool_calls : Option< u32 >,
pub rate_limits : RateLimits,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct TemperatureRange
{
pub min : f32,
pub max : f32,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct RateLimits
{
pub requests_per_minute : u32,
pub tokens_per_minute : u32,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelPerformance
{
pub model : String,
pub tokens_per_second : f32,
pub latency_ms : u32,
pub throughput_score : f32,
pub speed_score : f32,
pub cost_tier : String,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelStatus
{
pub is_deprecated : bool,
pub deprecation_date : Option< String >,
pub sunset_date : Option< String >,
pub replacement_model : String,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct MigrationPath
{
pub recommended_replacement : String,
pub migration_steps : Vec< String >,
pub breaking_changes : Option< Vec< String > >,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelPricing
{
pub input_cost_per_token : f64,
pub output_cost_per_token : f64,
pub currency : String,
pub usage_tier : String,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct EstimatedUsage
{
pub input_tokens : u32,
pub output_tokens : u32,
pub model : String,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct CostEstimate
{
pub total_cost : f64,
pub input_cost : f64,
pub output_cost : f64,
pub currency : String,
}
#[ derive( Debug, Clone, Default ) ]
pub struct ModelFilter
{
pub supports_tools : Option< bool >,
pub supports_vision : Option< bool >,
pub max_cost_tier : Option< u32 >,
pub min_context_length : Option< u32 >,
}
#[ derive( Debug, Default ) ]
pub struct ModelFilterBuilder
{
supports_tools : Option< bool >,
supports_vision : Option< bool >,
max_cost_tier : Option< u32 >,
min_context_length : Option< u32 >,
}
impl ModelFilterBuilder
{
#[ must_use ]
pub fn new() -> Self
{
Self::default()
}
#[ must_use ]
pub fn supports_tools( mut self, supports : bool ) -> Self
{
self.supports_tools = Some( supports );
self
}
#[ must_use ]
pub fn supports_vision( mut self, supports : bool ) -> Self
{
self.supports_vision = Some( supports );
self
}
#[ must_use ]
pub fn max_cost_tier( mut self, tier : u32 ) -> Self
{
self.max_cost_tier = Some( tier );
self
}
#[ must_use ]
pub fn min_context_length( mut self, length : u32 ) -> Self
{
self.min_context_length = Some( length );
self
}
#[ must_use ]
pub fn build( self ) -> ModelFilter
{
ModelFilter
{
supports_tools : self.supports_tools,
supports_vision : self.supports_vision,
max_cost_tier : self.max_cost_tier,
min_context_length : self.min_context_length,
}
}
}
impl ModelFilter
{
#[ must_use ]
pub fn builder() -> ModelFilterBuilder
{
ModelFilterBuilder::new()
}
}
#[ derive( Debug, Clone ) ]
pub enum UseCase
{
CodeGeneration
{
programming_language : String,
complexity : CodeComplexity,
requires_explanation : bool,
},
CreativeWriting
{
genre : String,
length : ContentLength,
tone : WritingTone,
},
}
#[ derive( Debug, Clone ) ]
pub enum CodeComplexity
{
Low,
Medium,
High,
}
#[ derive( Debug, Clone ) ]
pub enum ContentLength
{
Short,
Medium,
Long,
}
#[ derive( Debug, Clone ) ]
pub enum WritingTone
{
Professional,
Casual,
Creative,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct ModelRecommendation
{
pub recommended_model : String,
pub confidence_score : f32,
pub reasoning : String,
}
#[ derive( Debug, Clone, Serialize, Deserialize ) ]
pub struct FeatureCompatibility
{
pub is_compatible : bool,
pub feature_version : Option< String >,
pub alternative_models : Option< Vec< String > >,
}
}
crate::mod_interface!
{
exposed use ModelInfo;
exposed use ModelCapabilities;
exposed use ModelRequirements;
exposed use ModelRequirementsBuilder;
exposed use ModelAvailability;
exposed use ModelLimits;
exposed use TemperatureRange;
exposed use RateLimits;
exposed use ModelPerformance;
exposed use ModelStatus;
exposed use MigrationPath;
exposed use ModelPricing;
exposed use EstimatedUsage;
exposed use CostEstimate;
exposed use ModelFilter;
exposed use ModelFilterBuilder;
exposed use UseCase;
exposed use CodeComplexity;
exposed use ContentLength;
exposed use WritingTone;
exposed use ModelRecommendation;
exposed use FeatureCompatibility;
}