-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTF file not supported by the API (UploadFile) #71
Comments
Hi @BartRennes Thanks for reporting this. I'm going to extend it to support the latest ones. Next release, probably in a few hours, will resolve the issue. Do you have a source / link regarding the currently allowed MIME types? There are probably more than RTF... Thanks. |
Hi @BartRennes Quickly checking the guarding method reveals that the MIME type I was using Google's documentation: https://ai.google.dev/gemini-api/docs/document-processing Cheers. |
Hi @BartRennes The issue has been resolved in release v2.2.6 Thanks again! |
Wow! Great, thank you, i will test it. |
Just tested with 2.2.6, and it still doesn't work, here the error message: |
Hi @BartRennes OK, but this is now the response from the Gemini API. Well, this means that v2.2.6 just introduced a regression issue and should be reverted. Hmm, silly me not writing a test case... You have to use "text/rtf" and it should work. Cheers. |
Hi @BartRennes The File API doesn't care about the MIME type and excepts both. However, running tests with the identical file using either MIME type produces different HTTP responses. shows the response you reported in case of "application/rtf" whereas "text/rtf" is accepted and processed. It's an issue in the Gemini API itself, not the SDK. Cheers. |
Hi @BartRennes Just pushed release v2.2.7 to provide a workaround to the deficit in the Gemini API. Cheers. |
Thank you for workaround in 2.2.7, good job ;) |
Hi @BartRennes Either use v2.2.7 or extend your line of code
with the second parameter Your code should look like this:
Hope this helps. |
Hello @BartRennes Thanks for the positive feedback and glad it works for you now. However, the root cause of this issue lies with the Gemini API not accepting the (more) correct MIME type Again, thanks for reporting this and I'm happy to have it analysed and resolved. Cheers |
Hello,
The Gemini SDK supports RTF file, but when using generative-ai with UpLoadFile, i receive this error:
System.NotSupportedException : 'The mime type
application/rtf
is not supported by the API.'Do you plan to support RTF file in Upload?
Here the code used:
Regards,
Jc
The text was updated successfully, but these errors were encountered: