When we have a prompt that has part.media, when using OpenAI we're hard-coding type: 'image_url' and image_url parameter.
This is resulting in errors when we try to do OCR with other types of files:
BadRequestError: 400 Invalid MIME type. Only image types are supported..
As we can see in the official docs, OpenAI supports other type of files. We should be able to, for example, send PDF file inputs as Base64-encoded inputs:
"type": "file",
"file": {
"filename": "draconomicon.pdf",
"file_data": "...base64 encoded bytes here..."
}