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

[TypeScript] full support ✨🤖 #6

Closed Mimikkk closed 1 month ago

Mimikkk commented 6 months ago

I've been working for a couple of hours to add typescript support to the project. It encompasses tests, utils and so on. Bumped vitest to 1.1.1 and did a few minor tweaks due to typing.

Changes:

Added scripts:

I moved the dynamically created class Chat outside the Gemini class and added exported createGemini function for the ease of creation multiple instances.

yoroshikun commented 5 months ago

This is great 👍 Hope it gets merged soon.

yoroshikun commented 5 months ago

You may also want to remove the old fullCoverage.test.js in this PR

kcoderhtml commented 4 months ago

hey @EvanZhouDev can you merge this? I would love to have full typescript support on the official package.

kcoderhtml commented 4 months ago

I might be dumb but how do you build and publish the package @Mimikkk? I've tried with npm publish and vite build but they don't seem to work.

EvanZhouDev commented 1 month ago

Hello @yoroshikun @kcoderhtml @Mimikkk, sorry for the super late response.

I know most likely you're not using this package anymore, but I thought I'd still update you on what's going on. I've been extremely busy for the past few months on work and other projects, so I haven't been able to catch up with gemini-ai recently. Furthermore, I have not decided to merge this branch because of a few refactors I've been doing, as well as the fact that it has seemed to stray a bit too far from the original.

However, seeing as Google has released Gemini 1.5 Flash today, I will be coming back to this project. Expect a relatively large update in the next few weeks, featuring types, updated streaming support, as well as better support by default for the new models.

As for this,

I might be dumb but how do you build and publish the package @Mimikkk? I've tried with npm publish and vite build but they don't seem to work.

only the original publisher can update the package to NPM 😅

kcoderhtml commented 1 month ago

Thanks! Looking forward to trying the updated package!

only the original publisher can update the package to NPM 😅

I believe I was trying to rebuild the package and deploy to my NPM account, but I can't remember at this point what I was trying to do :)

EvanZhouDev commented 1 month ago

I have finished the initial rewrite in TypeScript, which is now available on the v2 branch. It supports a bunch of improvements and some new features, which I will have to document 😅... it is still completely backward compatible, but I thought a ground-up rewrite deserves a major version bump.

Edit: PR now available at #9

kcoderhtml commented 1 month ago

Thank you!!! Looking forward to trying it out!

EvanZhouDev commented 1 month ago

Full TypeScript support, along with a bunch of great new features are now available on NPM. Will be closing this for now. Feel free to continue on this thread (or start a new issue) if anything needs to be fixed!