Gemini API Error: Unsupported Mimetype: 'text/plain' despite the documentation touting support.

Hey folks, this must be some sort of API bug, as I can't imagine .pdf parsing would be supported, but a plain text document wouldn't be. The documentation here states that it is supported Mimetype, but actually trying to invoke the API via the Python SDK or even the "Vertex AI" playground yields an error. 

SDK ErrorSDK Error

What's the best channel to report this? 

Solved Solved
4 1 369
1 ACCEPTED SOLUTION

Hi @elliottshort

Thank you for joining our community.

I see there's an error code 400 in your screenshot. This can be frustrating, as it often means something went wrong with your request. The message 'Unsupported MIME type' might seem like it's just about the file type, but it could also involve other parts of the request.

The "Parameter" section in your document might hold some clues about the error.

Parts: For gemini-1.5-pro, you can specify any combination and number of text, image, video, and audio files. The token limit is 1,000,000.

MimeType: Text files must be UTF-8 encoded. The contents of the text file count toward the token limit.

I've looked into our service health status and the Vertex AI's open issues but haven't found anything directly related to your situation. If you believe this behavior is a bug, you can submit a ticket in our issue tracking system. This will ensure the engineers are aware of the problem and can investigate further.

I hope I was able to provide you with useful insights.

 

View solution in original post

1 REPLY 1

Hi @elliottshort

Thank you for joining our community.

I see there's an error code 400 in your screenshot. This can be frustrating, as it often means something went wrong with your request. The message 'Unsupported MIME type' might seem like it's just about the file type, but it could also involve other parts of the request.

The "Parameter" section in your document might hold some clues about the error.

Parts: For gemini-1.5-pro, you can specify any combination and number of text, image, video, and audio files. The token limit is 1,000,000.

MimeType: Text files must be UTF-8 encoded. The contents of the text file count toward the token limit.

I've looked into our service health status and the Vertex AI's open issues but haven't found anything directly related to your situation. If you believe this behavior is a bug, you can submit a ticket in our issue tracking system. This will ensure the engineers are aware of the problem and can investigate further.

I hope I was able to provide you with useful insights.