pub struct ModelConstraints {
pub input: Vec<String>,
pub tool_calling: bool,
pub structured_output: bool,
}Expand description
Caller-declared requirements. Listed input modalities and true flags require confirmed
support; an empty input list and false flags impose no requirement.
Adapters must not infer or override these declarations from message content.
Fields§
§input: Vec<String>Closed vocabulary: image, video, audio, file. text and vision are rejected.
tool_calling: boolThe model must support tool calls.
structured_output: boolThe model must support schema-constrained output.
Implementations§
Source§impl ModelConstraints
impl ModelConstraints
Sourcepub fn validate(
&self,
capabilities: &ModelCapabilities,
) -> Result<(), &'static str>
pub fn validate( &self, capabilities: &ModelCapabilities, ) -> Result<(), &'static str>
Checks declarations only, including requirements on requests with no attachments/tools.
Sourcepub fn validate_payload<'a>(
&self,
messages: impl IntoIterator<Item = &'a Message>,
) -> Result<(), &'static str>
pub fn validate_payload<'a>( &self, messages: impl IntoIterator<Item = &'a Message>, ) -> Result<(), &'static str>
Payload modalities must be a subset of the caller-declared input list.
Trait Implementations§
Source§impl Clone for ModelConstraints
impl Clone for ModelConstraints
Source§fn clone(&self) -> ModelConstraints
fn clone(&self) -> ModelConstraints
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 ModelConstraints
impl Debug for ModelConstraints
Source§impl Default for ModelConstraints
impl Default for ModelConstraints
Source§fn default() -> ModelConstraints
fn default() -> ModelConstraints
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelConstraints
impl<'de> Deserialize<'de> for ModelConstraints
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 Eq for ModelConstraints
Source§impl PartialEq for ModelConstraints
impl PartialEq for ModelConstraints
Source§impl Serialize for ModelConstraints
impl Serialize for ModelConstraints
impl StructuralPartialEq for ModelConstraints
Auto Trait Implementations§
impl Freeze for ModelConstraints
impl RefUnwindSafe for ModelConstraints
impl Send for ModelConstraints
impl Sync for ModelConstraints
impl Unpin for ModelConstraints
impl UnsafeUnpin for ModelConstraints
impl UnwindSafe for ModelConstraints
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