anthropic.internal._anth_supported_image_mime

(internal) One media part -> its `{type, source}` block. `resolve_media(_, false)` passes an ordinary http(s) URL straight through as `source.type: "url"` (Anthropic fetches it itself) and inlines everything else as base64 — sys_llm's `send_url` default for this provider. The four image media types the Messages API accepts on a base64 source. It validates the declared `media_type` against the actual bytes, so anything else is a 400 — including `image/svg+xml` (which `ai.internal._media_mime_type` produces for an `.svg` source) and `image/png` guessed for an unknown extension. Checking here keeps the error client-side and specific; the check is per-provider because the allowed set is.

Reference version

Signature

function anthropic.internal._anth_supported_image_mime(mime: string) -> bool

(internal) One media part -> its {type, source} block. resolve_media(_, false) passes an ordinary http(s) URL straight through as source.type: "url" (Anthropic fetches it itself) and inlines everything else as base64 — sys_llm's send_url default for this provider. The four image media types the Messages API accepts on a base64 source. It validates the declared media_type against the actual bytes, so anything else is a 400 — including image/svg+xml (which ai.internal._media_mime_type produces for an .svg source) and image/png guessed for an unknown extension. Checking here keeps the error client-side and specific; the check is per-provider because the allowed set is.

Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 1179111969