pub enum Modality {
Text,
Multimodal,
Unknown,
}Expand description
Coarse, factual input/output modality label for a model.
text vs multimodal is derived from the union of stated input/output
modalities. Absent modality metadata is Modality::Unknown, distinct from
a stated text-only model — “we were not told” is not “text only”.
Variants§
Text
Every stated modality is text.
Multimodal
At least one stated modality is non-text (image/audio/video/…).
Unknown
No modality metadata was stated for this row.
Implementations§
Source§impl Modality
impl Modality
Sourcepub fn from_modalities(modalities: Option<&ModelsDevModalities>) -> Self
pub fn from_modalities(modalities: Option<&ModelsDevModalities>) -> Self
Classify the modality from a Models.dev-shaped modality block.
Returns Modality::Unknown for absent metadata or an empty list,
Modality::Multimodal when any stated input/output modality is not
text, and Modality::Text when the only stated modalities are text.
Trait Implementations§
impl Copy for Modality
Source§impl<'de> Deserialize<'de> for Modality
impl<'de> Deserialize<'de> for Modality
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 Modality
impl StructuralPartialEq for Modality
Auto Trait Implementations§
impl Freeze for Modality
impl RefUnwindSafe for Modality
impl Send for Modality
impl Sync for Modality
impl Unpin for Modality
impl UnsafeUnpin for Modality
impl UnwindSafe for Modality
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.