EvanZhouDev / gemini-ai

The simpler JavaScript Gemini SDK
https://www.npmjs.com/package/gemini-ai
GNU General Public License v3.0
95 stars 16 forks source link

`Gemini.createChat()` Should Also Accept `Message[]` in its `config.messages` #10

Closed EvanZhouDev closed 1 month ago

EvanZhouDev commented 1 month ago

It has been brought to my attention that createChat() accepts [string, string][], instead of Message[], as it's presumably supposed to. This issue is also present in the previous version of Gemini AI, and as such, v2 is still not a breaking change. I will likely change it to make it so that it can take in both the [string, string][] format, or alternatively the Message[] format. For now, a workaround is just to map Message[] to [string, string][].

The reason why Message[] is better is because it can take into account various Part types, including uploaded files and text.

EvanZhouDev commented 1 month ago

Fixed in Gemini AI v2.1.0