GoogleCloudPlatform / nodejs-docs-samples

Node.js samples for Google Cloud Platform products.
https://cloud.google.com/nodejs
Apache License 2.0
2.78k stars 1.93k forks source link

fix(generative-ai): Use the non stream method instead #3706

Open gericdong opened 1 month ago

gericdong commented 1 month ago

Description

Fixes b/325521336

Streaming method was used incorrectly in a non streaming sample.

Checklist

iennae commented 1 week ago

seems like https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/generative-ai/snippets/nonStreamingMultipartContent.js also is using generateContentStream which seems like the fix you're putting forward here. (I got distracted with the changes to the grounding sample that don't seem to be to do with the nonstream method.