pub struct ModelDefinition {
pub id: String,
pub name: Option<String>,
pub base_url: Option<String>,
pub reasoning: Option<bool>,
pub thinking_level_map: Option<ThinkingLevelMap>,
pub context_window: Option<u64>,
pub max_tokens: Option<u64>,
pub cost: Option<ModelCost>,
pub input: Option<Vec<String>>,
pub headers: Option<BTreeMap<String, String>>,
pub compat: Option<Value>,
}Expand description
One model under a provider. id is required (mirrors TS ModelDefinition).
Fields§
§id: String§name: Option<String>§base_url: Option<String>§reasoning: Option<bool>§thinking_level_map: Option<ThinkingLevelMap>§context_window: Option<u64>§max_tokens: Option<u64>§cost: Option<ModelCost>USD per million tokens, including optional long-context pricing tiers.
input: Option<Vec<String>>Free-form modality strings (“text”/“image”); unknown values fall back to text-only.
headers: Option<BTreeMap<String, String>>§compat: Option<Value>Trait Implementations§
Source§impl Clone for ModelDefinition
impl Clone for ModelDefinition
Source§impl Debug for ModelDefinition
impl Debug for ModelDefinition
Source§impl<'de> Deserialize<'de> for ModelDefinition
impl<'de> Deserialize<'de> for ModelDefinition
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 Forget for ModelDefinition
impl Freeze for ModelDefinitionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<ThinkingLevel, Option<String>> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(ThinkingLevel, Option<String>)>>: Freeze,
PhantomData<ModelCostTier>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for ModelDefinition
impl RefUnwindSafe for ModelDefinition
impl Send for ModelDefinition
impl Sync for ModelDefinition
impl Unpin for ModelDefinition
impl UnsafeUnpin for ModelDefinitionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<ThinkingLevel, Option<String>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ThinkingLevel, Option<String>)>>: UnsafeUnpin,
PhantomData<ModelCostTier>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for ModelDefinitionwhere
RawVecInner: UnwindSafe,
BTreeMap<ThinkingLevel, Option<String>>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
NonNull<u8>: UnwindSafe,
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