MCPcopy Index your code
hub / github.com/anomalyco/opencode / mimeToModality

Function mimeToModality

packages/opencode/src/provider/transform.ts:10–16  ·  view source on GitHub ↗
(mime: string)

Source from the content-addressed store, hash-verified

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

Callers 1

unsupportedPartsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected