feat(genai): add migrated functionCallingStreamContent sample from generative-ai#4367
feat(genai): add migrated functionCallingStreamContent sample from generative-ai#4367angelcaamal wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new sample script and its corresponding test file to demonstrate function calling with streaming content using the @google/genai SDK. The review feedback highlights critical corrections and improvements: the role for the function response turn must be changed from 'user' to 'tool' to prevent API validation errors, and redundant nesting in the function response structure should be simplified. Additionally, the test file should default to 'us-central1' instead of 'global' since Gemini models are regional on Vertex AI, and the script path in the test should be resolved dynamically using the path module to ensure directory-independent execution.
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
Description
This PR introduces
tool-func-calling-stream-content.js, which is the version already migrated from Vertex AI to the newgenaistandard, applying the proper name change and region tag following the naming convention of the samples undergenai.The primary reason for this migration is to phase out the legacy
functionCallingStreamContent.jssample and decommission its old region tag on Devsite, replacing it with this updated implementation.Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.