{"record":{"id":"e7912348a52eee7d","repo":"BerriAI/litellm","slug":"unsupported-mime-type-for-embedding-media-type","errorCode":null,"errorMessage":"Unsupported MIME type for embedding: {media_type}. Supported types: {', '.join(sorted(SUPPORTED_EMBEDDING_MIME_TYPES))}","messagePattern":"Unsupported MIME type for embedding: (.+?)\\. Supported types: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py","lineNumber":119,"sourceCode":"        ValueError: If data URL format is invalid or MIME type is unsupported\n    \"\"\"\n    if not data_url.startswith(\"data:\"):\n        raise ValueError(f\"Invalid data URL format: {data_url[:50]}...\")\n\n    if \",\" not in data_url:\n        raise ValueError(f\"Invalid data URL format (missing comma): {data_url[:50]}...\")\n\n    metadata, base64_data = data_url.split(\",\", 1)\n\n    metadata = metadata[5:]\n\n    if \";\" in metadata:\n        media_type = metadata.split(\";\")[0]\n    else:\n        media_type = metadata\n\n    if media_type not in SUPPORTED_EMBEDDING_MIME_TYPES:\n        raise ValueError(\n            f\"Unsupported MIME type for embedding: {media_type}. \"\n            f\"Supported types: {', '.join(sorted(SUPPORTED_EMBEDDING_MIME_TYPES))}\"\n        )\n\n    return media_type, base64_data\n\n\ndef _is_multimodal_input(input: GeminiEmbeddingInput) -> bool:\n    \"\"\"\n    Check if the input contains multimodal data (data URIs, file references,\n    GCS URLs, or nested lists for combined embeddings).\n\n    Args:\n        input: GeminiEmbeddingInput — str, List[str], or List[List[str]] for combined embeddings\n\n    Returns:\n        bool: True if any element is multimodal or a nested list\n    \"\"\"","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py#L101-L137","documentation":"Gemini data-URL parser guard: the declared media_type is not within SUPPORTED_EMBEDDING_MIME_TYPES, so the payload cannot be embedded by Gemini multimodal embedding and is rejected with the allowed list.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported MIME types listed in the error (e.g. image/png, image/jpeg) for the media you embed.","Convert the file to a supported format before embedding, or correct the mime_type parameter passed for the media."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}