{"record":{"id":"9541fc8e67116ce3","repo":"BerriAI/litellm","slug":"no-supported-extensions-for-mime-type-mime-type","errorCode":null,"errorMessage":"No supported extensions for MIME type: {mime_type}. Supported formats: {supported_doc_formats}","messagePattern":"No supported extensions for MIME type: (.+?)\\. Supported formats: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/prompt_templates/factory.py","lineNumber":3516,"sourceCode":"        potential_extensions: Final = mimetypes.guess_all_extensions(mime_type, strict=False)\n        valid_extensions = [ext[1:] for ext in potential_extensions if ext[1:] in supported_doc_formats]\n\n        # Fallback to types/files.py if mimetypes doesn't return valid extensions\n        #################\n        # litellm runs on docker containers and `mimetypes` depends on the installed mimetypes of the OS\n        # we fallback to well known mime types in types/files.py if mimetypes doesn't return valid extensions\n        if not valid_extensions:\n            try:\n                fallback_extension: Final = get_file_extension_from_mime_type(mime_type)\n                if fallback_extension in supported_doc_formats:\n                    valid_extensions = [fallback_extension]\n            except ValueError:\n                # Neither mimetypes nor files.py could handle this MIME type\n                # get_file_extension_from_mime_type raises ValueError if the mime type is not supported\n                pass\n\n        if not valid_extensions:\n            raise ValueError(\n                f\"No supported extensions for MIME type: {mime_type}. Supported formats: {supported_doc_formats}\"\n            )\n\n        # Use first valid extension instead of provided image_format\n        return valid_extensions[0]\n\n    @staticmethod\n    def _create_bedrock_block(image_bytes: str, mime_type: str, image_format: str) -> BedrockContentBlock:\n        \"\"\"Create appropriate Bedrock content block based on mime type.\"\"\"\n        _blob: Final = BedrockSourceBlock(bytes=image_bytes)\n\n        document_types: Final = [\"application\", \"text\"]\n        is_document: Final = any(mime_type.startswith(doc_type) for doc_type in document_types)\n\n        supported_video_formats: Final = litellm.AmazonConverseConfig().get_supported_video_types()\n        is_video: Final = any(image_format.startswith(video_type) for video_type in supported_video_formats)\n\n        HASH_SAMPLE_BYTES: Final = 64 * 1024  # hash up to 64 KB of data","sourceCodeStart":3498,"sourceCodeEnd":3534,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/prompt_templates/factory.py#L3498-L3534","documentation":"Bedrock document conversion guard: the supplied MIME type maps to no extension among the supported document formats (pdf, csv, doc(x), etc.), so the content block cannot be converted to a Bedrock Converse document block. Fires when a user passes an unsupported document type.","triggerScenarios":"Thrown at litellm/litellm_core_utils/prompt_templates/factory.py:3516 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the document to one of the supported formats for the model before sending.","Check the MIME type of the file you are passing."],"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-23T08:17:48.524Z"}