Gemini AI v2 is completely backward compatible. The only change you may have to be aware of is that configuration settings no longer error when giving a nonexistent field to account for future API changes.
Major Changes:
Library is now in TypeScript for type safety
File Uploads are now dynamically optimized (automatically uses File API for videos/audio, and inline data for images)
MIME types are now detected by the file-type library, so they should be much more reliable
New message format (directly pass an array of buffers/strings into the message parameter)
Ability to change API version
New default model is now gemini-1.5-flash-latest, and optimizations made for Gemini 1.5 models
Streaming is now done through SSE, so it should be much more reliable
Chat is now completely dependent on Gemini's ask() method, ensuring parity
Many improvements have been made under-the-hood from the rewrite!
Gemini AI v2 is completely backward compatible. The only change you may have to be aware of is that configuration settings no longer error when giving a nonexistent field to account for future API changes.
Major Changes:
file-type
library, so they should be much more reliablegemini-1.5-flash-latest
, and optimizations made for Gemini 1.5 modelsask()
method, ensuring parity