def __get_img_format_from_image_mimetype(image_mimetype: str) -> str:
    """Get the image format from the image mimetype."""
    mapping = {
        "image/jpeg": "jpeg",
        "image/png": "png",
        "image/gif": "gif",
        "image/webp": "webp",
    }
    img_format = mapping.get(image_mimetype)
    if img_format is None:
        logger.warning(
            f"Unsupported image mimetype: {image_mimetype}. Bedrock Converse API only supports {', '.join(mapping.keys())}, defaulting to png."
        )
        return "png"
    return img_format
Get the image format from the image mimetype.
llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/utils.py