(mime: string)
| 7 | type Modality = NonNullable<ModelsDev.Model["modalities"]>["input"][number] |
| 8 | |
| 9 | function mimeToModality(mime: string): Modality | undefined { |
| 10 | if (mime.startsWith("image/")) return "image" |
| 11 | if (mime.startsWith("audio/")) return "audio" |
| 12 | if (mime.startsWith("video/")) return "video" |
| 13 | if (mime === "application/pdf") return "pdf" |
| 14 | return undefined |
| 15 | } |
| 16 | |
| 17 | export namespace ProviderTransform { |
| 18 |