Skip to content

feat(genai): add migrated functionCallingBasic sample from generative-ai#4366

Open
angelcaamal wants to merge 5 commits into
mainfrom
feat/genai-add-tool-func-calling-basic-sample
Open

feat(genai): add migrated functionCallingBasic sample from generative-ai#4366
angelcaamal wants to merge 5 commits into
mainfrom
feat/genai-add-tool-func-calling-basic-sample

Conversation

@angelcaamal

@angelcaamal angelcaamal commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces tool-func-calling-basic.js, which is a version already migrated from Vertex AI to genai, applying the name change and new region tag following the naming convention of the samples under genai.

The primary reason for this migration is to phase out the legacy functionCallingBasic.js sample and decommission its region tag generativeaionvertexai_function_calling_basic on Devsite, replacing it with the newly updated tool-func-calling-basic.js sample.

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • Required CI tests pass (see CI testing)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

Note: Any check with (dev), (experimental), or (legacy) can be ignored and should not block your PR from merging (see CI testing).

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jun 26, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a basic function calling sample (tools-func-calling-basic.js) using the @google/genai SDK, along with an integration test. The feedback recommends strengthening the test assertion to verify that the model output actually contains the expected function call (get_current_weather), rather than just checking that the output is non-empty.

Comment thread genai/tools/test/tools-func-calling-basic.test.js
@angelcaamal angelcaamal marked this pull request as ready for review June 26, 2026 20:24
@angelcaamal angelcaamal requested review from a team as code owners June 26, 2026 20:24
@snippet-bot

snippet-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@angelcaamal angelcaamal changed the title feat(genai): introduce new sample and region tag for function calling basic feat(genai): Added the migrated functionCallingBasic.js from generative-ai. Jun 26, 2026
@angelcaamal angelcaamal changed the title feat(genai): Added the migrated functionCallingBasic.js from generative-ai. feat(genai): add migrated functionCallingBasic sample from generative-ai Jun 26, 2026

@amcolin amcolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants