MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / mime_to_modality

Function mime_to_modality

crates/opencode-provider/src/transform.rs:463–475  ·  view source on GitHub ↗
(mime: &str)

Source from the content-addressed store, hash-verified

461}
462
463pub fn mime_to_modality(mime: &str) -> Option<Modality> {
464 if mime.starts_with("image/") {
465 Some(Modality::Image)
466 } else if mime.starts_with("audio/") {
467 Some(Modality::Audio)
468 } else if mime.starts_with("video/") {
469 Some(Modality::Video)
470 } else if mime == "application/pdf" {
471 Some(Modality::Pdf)
472 } else {
473 None
474 }
475}
476
477// ---------------------------------------------------------------------------
478// unsupported_parts

Callers 1

unsupported_partsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected