pub enum Modality {
Text,
Image,
Audio,
Video,
Pdf,
}Expand description
Input/output modality supported by a model.
Closed set covering the modalities present in major provider APIs
(Anthropic, OpenAI, Google Gemini, Vertex) as of the 2026-Q1
reference window: text, images, audio, video, and PDF documents.
Adding a variant is a breaking change for exhaustive match consumers;
removing one is a breaking serde change.
Variants§
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<Modality, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Modality, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Modality
Source§impl JsonSchema for Modality
impl JsonSchema for Modality
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 inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for Modality
impl Serialize for Modality
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 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,
Source§impl<B, K> ContainerWithHash<B> for K
impl<B, K> ContainerWithHash<B> for K
fn as_dyn_hash(&self) -> &(dyn DynHash + 'static)
fn as_container(&self) -> &<B as Bounds>::Container
fn as_mut_container(&mut self) -> &mut <B as Bounds>::Container
fn into_box_container(self: Box<K>) -> Box<<B as Bounds>::Container>
impl<B, K> ContainerWithHashAndClone<B> for K
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.