pub struct ModelInfo {
pub provider: String,
pub id: String,
pub context_window: usize,
pub max_output_tokens: Option<usize>,
pub capabilities: ModelCapabilities,
pub price: ModelPrice,
}Expand description
One catalog entry.
Fields§
§provider: StringProvider slug ("openai", "anthropic", "groq", "custom" …).
id: StringModel id as used in API calls.
context_window: usizeMaximum context window in tokens.
max_output_tokens: Option<usize>Maximum output tokens the model accepts; None when undeclared.
capabilities: ModelCapabilitiesCapability flags.
price: ModelPriceUSD price per 1K tokens.
Implementations§
Source§impl ModelInfo
impl ModelInfo
Sourcepub fn new(
provider: impl Into<String>,
id: impl Into<String>,
context_window: usize,
price: ModelPrice,
) -> Self
pub fn new( provider: impl Into<String>, id: impl Into<String>, context_window: usize, price: ModelPrice, ) -> Self
Creates an entry with the given essentials and no capability flags.
Sourcepub fn with_max_output(self, max_output_tokens: usize) -> Self
pub fn with_max_output(self, max_output_tokens: usize) -> Self
Builder-style setter for the output cap.
Sourcepub fn with_capabilities(self, capabilities: ModelCapabilities) -> Self
pub fn with_capabilities(self, capabilities: ModelCapabilities) -> Self
Builder-style setter for capability flags.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelInfo
impl<'de> Deserialize<'de> for ModelInfo
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
impl StructuralPartialEq for ModelInfo
Auto Trait Implementations§
impl Freeze for ModelInfo
impl RefUnwindSafe for ModelInfo
impl Send for ModelInfo
impl Sync for ModelInfo
impl Unpin for ModelInfo
impl UnsafeUnpin for ModelInfo
impl UnwindSafe for ModelInfo
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