Skip to content

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