Route to appropriate handler based on modality.
(self, inputs: List[Any], modality: str)
| 143 | # self.register_modality("audio", self._embed_audio) |
| 144 | |
| 145 | def embed(self, inputs: List[Any], modality: str) -> "np.ndarray": |
| 146 | """Route to appropriate handler based on modality.""" |
| 147 | if modality not in self._modality_handlers: |
| 148 | raise ValueError( |
| 149 | f"Unsupported modality: '{modality}'. " |
| 150 | f"Supported: {self.supported_modalities}" |
| 151 | ) |
| 152 | |
| 153 | handler = self._modality_handlers[modality] |
| 154 | return handler(inputs) |
| 155 | |
| 156 | def get_embedding_dim(self, modality: str) -> Optional[int]: |
| 157 | """ |