Open geekysam7 opened 10 months ago
You're right, we overlooked this in the documentation. I assume this is for generateContent
(it's covered up by the tooltip in the screenshot). It must have been mixed up with the example for generateContentStream
, where response
is a promise.
You're talking about the documentation example here? https://ai.google.dev/tutorials/node_quickstart#generate-text-from-text-input Are there any other places? Just want to make sure we've got them all covered.
I checked in the source, all consumption (ex: tests) places seem to be written correctly. Only the documentation looks like the place it's missed. So I think only checking in docs should do.
Yes the link is correct, for this example case. Rest places in docs I'm not sure if this is referenced.
Expected Behavior
Check below screenshots:
This is taken from the example provided in the docs. Type information seems to be setup incorrectly.
File: https://github.com/google/generative-ai-js/blob/2be48f8e5427f2f6191f24bcb8000b450715a0de/packages/main/types/responses.ts#L32
Actual Behavior
here we will need to do something like this:
Or update the docs and change:
to
this seems to be more likely as GenerateContentResult has been used without await at many places, which I believe is the expected behaviour.
Steps to Reproduce the Problem
Specifications