pub struct ModelCapability {
pub reasoning: Option<ReasoningCapability>,
}Expand description
Capability metadata for a single model on a route, supplied by the host.
Fields§
§reasoning: Option<ReasoningCapability>Implementations§
Source§impl ModelCapability
impl ModelCapability
pub fn is_empty(&self) -> bool
Sourcepub fn resolve_effort(&self, requested: &str) -> Option<String>
pub fn resolve_effort(&self, requested: &str) -> Option<String>
Resolve a requested effort to its canonical form: alias-map first
(input lowercased/trimmed), then direct membership in efforts.
Returns None when the request maps to nothing this model exposes.
Sourcepub fn validate_effort(
&self,
model: &str,
provider_kind: &str,
requested: Option<&str>,
) -> Result<Option<String>, ModelEffortValidationError>
pub fn validate_effort( &self, model: &str, provider_kind: &str, requested: Option<&str>, ) -> Result<Option<String>, ModelEffortValidationError>
Validate a requested effort against this capability and return the
canonical (alias-normalized) effort to send on the wire. Ok(None)
means no effort is configured on the request.
Trait Implementations§
Source§impl Clone for ModelCapability
impl Clone for ModelCapability
Source§fn clone(&self) -> ModelCapability
fn clone(&self) -> ModelCapability
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 ModelCapability
impl Debug for ModelCapability
Source§impl Default for ModelCapability
impl Default for ModelCapability
Source§fn default() -> ModelCapability
fn default() -> ModelCapability
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelCapability
impl<'de> Deserialize<'de> for ModelCapability
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelCapability
Source§impl From<RemoteModelCapability> for ModelCapability
impl From<RemoteModelCapability> for ModelCapability
Source§fn from(value: RemoteModelCapability) -> ModelCapability
fn from(value: RemoteModelCapability) -> ModelCapability
Converts to this type from the input type.
Source§impl JsonSchema for ModelCapability
impl JsonSchema for ModelCapability
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ModelCapability
impl PartialEq for ModelCapability
Source§impl Serialize for ModelCapability
impl Serialize for ModelCapability
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
impl StructuralPartialEq for ModelCapability
Auto Trait Implementations§
impl Freeze for ModelCapability
impl RefUnwindSafe for ModelCapability
impl Send for ModelCapability
impl Sync for ModelCapability
impl Unpin for ModelCapability
impl UnsafeUnpin for ModelCapability
impl UnwindSafe for ModelCapability
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