pub struct ModelSpec {
pub provider: String,
pub model_id: String,
pub thinking_level: ThinkingLevel,
pub thinking_budgets: Option<ThinkingBudgets>,
pub provider_config: Option<Value>,
pub capabilities: Option<ModelCapabilities>,
}Expand description
Identifies the target model for a request.
Fields§
§provider: String§model_id: String§thinking_level: ThinkingLevel§thinking_budgets: Option<ThinkingBudgets>§provider_config: Option<Value>Provider-specific configuration (thinking, parameters, etc.).
capabilities: Option<ModelCapabilities>Per-model capability flags and limits.
Implementations§
Source§impl ModelSpec
impl ModelSpec
Sourcepub fn new(provider: impl Into<String>, model_id: impl Into<String>) -> Self
pub fn new(provider: impl Into<String>, model_id: impl Into<String>) -> Self
Create a new ModelSpec with thinking disabled and no budgets.
pub const fn with_thinking_level(self, level: ThinkingLevel) -> Self
pub fn with_thinking_budgets(self, budgets: ThinkingBudgets) -> Self
pub fn with_provider_config(self, config: Value) -> Self
pub const fn with_capabilities(self, capabilities: ModelCapabilities) -> Self
Sourcepub fn capabilities(&self) -> ModelCapabilities
pub fn capabilities(&self) -> ModelCapabilities
Returns the model capabilities, or a default (all-false) set if none were provided.
Sourcepub fn provider_config_as<T: DeserializeOwned>(&self) -> Option<T>
pub fn provider_config_as<T: DeserializeOwned>(&self) -> Option<T>
Get a typed provider config, deserializing from the stored JSON.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelSpec
impl<'de> Deserialize<'de> for ModelSpec
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 ModelSpec
Auto Trait Implementations§
impl Freeze for ModelSpec
impl RefUnwindSafe for ModelSpec
impl Send for ModelSpec
impl Sync for ModelSpec
impl Unpin for ModelSpec
impl UnsafeUnpin for ModelSpec
impl UnwindSafe for ModelSpec
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