Skip to content

feat: add new MIME types supported by latest models #73

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Hugobsan
Copy link

New MIME Types Supported

Since the release of Gemini 2.0 Flash, several new MIME types have been supported. However, they were not yet added to the MimeType enum. Since building a FilePart for a request requires a valid MimeType enum instance, I decided to investigate.

After reviewing the official Gemini model documentation, I wrote a test script to try different file types and included all supported types in the enum.

Notes

Some MIME types like application/x-javascript and application/x-python were rejected by gemini-2.0-flash during testing. However, they have been preserved in the enum to maintain backwards compatibility with existing SDK users.

Output from my tests

MIME_Types_Test.csv

@Hugobsan
Copy link
Author

  • Added support for creating FilePart instances using MIME types or strings. This improves flexibility and prevents issues when new MIME types are introduced before the SDK is updated.
  • Added newly released models to the ModelName enum, based on the official Gemini API documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant