pub struct ModelSpec { /* private fields */ }Expand description
Validated provider-neutral model specification.
Implementations§
Source§impl ModelSpec
impl ModelSpec
Sourcepub fn new(
model_id: ModelId,
provider_id: ProviderId,
display_name: ModelDisplayName,
context_window_tokens: TokenCount,
max_output_tokens: TokenCount,
capabilities: ModelCapabilities,
) -> Result<Self, ModelSpecError>
pub fn new( model_id: ModelId, provider_id: ProviderId, display_name: ModelDisplayName, context_window_tokens: TokenCount, max_output_tokens: TokenCount, capabilities: ModelCapabilities, ) -> Result<Self, ModelSpecError>
Creates a validated model specification.
§Errors
Returns an error when context/output limits are zero or output exceeds the full context window.
Sourcepub fn with_reasoning_profile(self, profile: ReasoningProfile) -> Self
pub fn with_reasoning_profile(self, profile: ReasoningProfile) -> Self
Replaces the model’s supported/default reasoning metadata.
Sourcepub const fn provider_id(&self) -> &ProviderId
pub const fn provider_id(&self) -> &ProviderId
Returns the owning provider selector.
Sourcepub const fn model_ref(&self) -> &ModelRef
pub const fn model_ref(&self) -> &ModelRef
Returns the complete provider-qualified model identity.
Sourcepub const fn display_name(&self) -> &ModelDisplayName
pub const fn display_name(&self) -> &ModelDisplayName
Returns the human-readable model name.
Sourcepub const fn context_window_tokens(&self) -> TokenCount
pub const fn context_window_tokens(&self) -> TokenCount
Returns the full context-window limit.
Sourcepub const fn max_output_tokens(&self) -> TokenCount
pub const fn max_output_tokens(&self) -> TokenCount
Returns the maximum generated output tokens.
Sourcepub const fn capabilities(&self) -> ModelCapabilities
pub const fn capabilities(&self) -> ModelCapabilities
Returns provider-neutral model capabilities.
Sourcepub const fn reasoning_profile(&self) -> Option<&ReasoningProfile>
pub const fn reasoning_profile(&self) -> Option<&ReasoningProfile>
Returns supported/default reasoning metadata for a reasoning model.
Sourcepub fn resolve_reasoning(
&self,
requested: Option<ReasoningEffort>,
) -> Option<ReasoningResolution>
pub fn resolve_reasoning( &self, requested: Option<ReasoningEffort>, ) -> Option<ReasoningResolution>
Resolves an optional session selection against this model.
A missing selection inherits a reasoning model’s default. A requested
level on a non-reasoning model resolves to explicit off.
Trait Implementations§
impl Eq for ModelSpec
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