pub struct ModelDefinition {
pub id: String,
pub name: Option<String>,
pub base_url: Option<String>,
pub reasoning: Option<bool>,
pub thinking_level_map: Option<BTreeMap<ThinkingLevel, Option<String>>>,
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<BTreeMap<ThinkingLevel, Option<String>>>§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§fn clone(&self) -> ModelDefinition
fn clone(&self) -> ModelDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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<ModelDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ModelDefinition
impl Serialize for ModelDefinition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ModelDefinition
impl RefUnwindSafe for ModelDefinition
impl Send for ModelDefinition
impl Sync for ModelDefinition
impl Unpin for ModelDefinition
impl UnsafeUnpin for ModelDefinition
impl UnwindSafe for ModelDefinition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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