pub struct ModalityCapabilities {
pub category: ModelCategory,
pub input_modalities: Vec<Modality>,
pub output_modalities: Vec<Modality>,
pub max_image_resolution: Option<(u32, u32)>,
pub max_video_duration: Option<u32>,
pub max_audio_duration: Option<u32>,
pub max_images_per_request: Option<u32>,
pub supported_image_formats: Vec<ImageFormat>,
pub supports_streaming: bool,
pub supports_interleaved: bool,
}Expand description
Describes what modalities a model can accept and produce
Fields§
§category: ModelCategoryModel category
input_modalities: Vec<Modality>Supported input modalities
output_modalities: Vec<Modality>Supported output modalities
max_image_resolution: Option<(u32, u32)>Maximum image resolution (width, height)
max_video_duration: Option<u32>Maximum video duration in seconds
max_audio_duration: Option<u32>Maximum audio duration in seconds
max_images_per_request: Option<u32>Maximum images per request
supported_image_formats: Vec<ImageFormat>Supported image formats
supports_streaming: boolSupports real-time streaming
supports_interleaved: boolSupports interleaved multi-turn with images
Implementations§
Source§impl ModalityCapabilities
impl ModalityCapabilities
Sourcepub fn multimodal() -> Self
pub fn multimodal() -> Self
Create capabilities for a multimodal model (like GPT-4o or Gemini)
Sourcepub fn supports_input(&self, modality: Modality) -> bool
pub fn supports_input(&self, modality: Modality) -> bool
Check if this model supports a given input modality
Sourcepub fn supports_output(&self, modality: Modality) -> bool
pub fn supports_output(&self, modality: Modality) -> bool
Check if this model supports a given output modality
Sourcepub fn supports_vision(&self) -> bool
pub fn supports_vision(&self) -> bool
Check if this model supports vision input
Sourcepub fn supports_actions(&self) -> bool
pub fn supports_actions(&self) -> bool
Check if this model supports action output
Trait Implementations§
Source§impl Clone for ModalityCapabilities
impl Clone for ModalityCapabilities
Source§fn clone(&self) -> ModalityCapabilities
fn clone(&self) -> ModalityCapabilities
Returns a duplicate of the value. Read more
1.0.0 · 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 ModalityCapabilities
impl Debug for ModalityCapabilities
Source§impl Default for ModalityCapabilities
impl Default for ModalityCapabilities
Source§impl<'de> Deserialize<'de> for ModalityCapabilities
impl<'de> Deserialize<'de> for ModalityCapabilities
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
Auto Trait Implementations§
impl Freeze for ModalityCapabilities
impl RefUnwindSafe for ModalityCapabilities
impl Send for ModalityCapabilities
impl Sync for ModalityCapabilities
impl Unpin for ModalityCapabilities
impl UnwindSafe for ModalityCapabilities
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more