{"record":{"id":"ce331d7b68514f03","repo":"BerriAI/litellm","slug":"unsupported-image-type-expected-either-image-url","errorCode":null,"errorMessage":"Unsupported image type. Expected either image url or base64 encoded string","messagePattern":"Unsupported image type\\. Expected either image url or base64 encoded string","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/prompt_templates/factory.py","lineNumber":3582,"sourceCode":"                    name=document_name,\n                )\n            )\n        elif is_video:\n            return BedrockContentBlock(video=BedrockVideoBlock(source=_blob, format=image_format))\n        else:\n            return BedrockContentBlock(image=BedrockImageBlock(source=_blob, format=image_format))\n\n    @classmethod\n    def process_image_sync(cls, image_url: str, format: str | None = None) -> BedrockContentBlock:\n        \"\"\"Synchronous image processing.\"\"\"\n\n        if \"base64\" in image_url:\n            img_bytes, mime_type, image_format = cls._parse_base64_image(image_url)\n        elif \"http://\" in image_url or \"https://\" in image_url:\n            img_bytes, mime_type = BedrockImageProcessor.get_image_details(image_url)\n            image_format = mime_type.split(\"/\")[1]\n        else:\n            raise ValueError(\"Unsupported image type. Expected either image url or base64 encoded string\")\n\n        if format:\n            mime_type = format\n            image_format = mime_type.split(\"/\")[1]\n\n        image_format = cls._validate_format(mime_type, image_format)\n        return cls._create_bedrock_block(img_bytes, mime_type, image_format)\n\n    @classmethod\n    async def process_image_async(cls, image_url: str, format: str | None) -> BedrockContentBlock:\n        \"\"\"Asynchronous image processing.\"\"\"\n\n        if \"base64\" in image_url:\n            img_bytes, mime_type, image_format = cls._parse_base64_image(image_url)\n        elif \"http://\" in image_url or \"https://\" in image_url:\n            img_bytes, mime_type = await BedrockImageProcessor.get_image_details_async(image_url)\n            image_format = mime_type.split(\"/\")[1]\n        else:","sourceCodeStart":3564,"sourceCodeEnd":3600,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/prompt_templates/factory.py#L3564-L3600","documentation":"BedrockImageProcessor.process_image_sync guard: the image_url is neither a base64 data URI nor a URL the processor can handle, so no Bedrock image block can be built. Fires when the content block's image source is an unrecognized string shape.","triggerScenarios":"Thrown at litellm/litellm_core_utils/prompt_templates/factory.py:3582 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the image as an image URL or a base64-encoded data string.","Use the format {\"image_url\": \"data:image/jpeg;base64,...\"}."],"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"}