Signature Modality Resolver
Utility class for resolving a model signature's declared encoding into a corresponding high-level DataModality. This resolver operates at the container level, meaning that encodings such as "mp4", "avi", "mp3", or "png" indicate the broader data type being represented, rather than low-level frame encodings. The mapping determines how signature parameters should be interpreted when constructing invocation requests.
Methods
resolve(encoding) staticmethod
Resolve a signature parameter encoding string into its corresponding DataModality.
Encodings are matched case-insensitively and may include container-level formats such as "mp4" or "avi" for video, "wav" for audio, or "txt" for text.
Parameters
encoding (
str) A non-empty encoding identifier (e.g.,"mp4","png","utf-8"). The value is lowercased and stripped before lookup.
Returns
DataModality The identified modality associated with the encoding, such as
DataModality.Audio,DataModality.Image, orDataModality.Video.
Raises
ValueError Raised if:
The encoding is
NoneThe encoding is not a string
The encoding is not recognized in the modality mapping