Hi,
Following an issue reported for my Gemini SDK for .NET, I’m passing the underlying root cause to the Gemini API. Origin of problem and more info here: RTF file not supported by the API (UploadFile) · Issue #71 · mscraftsman/generative-ai · GitHub
What’s the problem?
The documentation stipulates that RTF content can be processed by Gemini models. See here: Explore document processing capabilities with the Gemini API | Google AI for Developers
However, the specified MIME type is text/rtf
which according to the Mozilla Developer Network is not exactly correct and a lot of MIME type mappings are using the value application/rtf
. See here: Common MIME types - HTTP | MDN
Interestingly, the File API does not care at all for the MIME type and accepts the RTF document. The following ingestion into Gemini gives the following HTTP 400 response.
{
"error": {
"code": 400,
"message": "Unable to submit request because it has a mimeType parameter with value application/rtf, which is not supported. Update the mimeType and try again. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini",
"status": "INVALID_ARGUMENT"
}
}
I wrote a test case for my SDK showing this issue.
The same document has been uploaded twice to the File API - once using text/rtf
and the other time using application/rtf
.
This seems to be a deficit in the Gemini API not accepting the (more) correct MIME type of application/rtf
.
Please have a look and escalate this to the team. Thanks.
Cheers