google-gemini / generative-ai-js

The official Node.js / Typescript library for the Google Gemini API
https://ai.google.dev/
Apache License 2.0
502 stars 96 forks source link

usageMetadata not present on generateContentStream response #174

Closed jdoucy closed 1 week ago

jdoucy commented 1 week ago

Description of the bug:

When using generateContentStream, the provided response promise contains generated text, but not usageMetadata

Actual vs expected behavior:

Response promise must contains usageMetadata

Any other information you'd like to share?

It worked when using generateContent (without streaming)

jdoucy commented 1 week ago

I fixed it locally, currently creating a clean merge request 😊