generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

fix: Correctly handle Gemini parallel function calls in sample notebook

Open koverholt opened this issue 1 year ago • 1 comments

Description

The Gemini API now returns an error when the number of function call responses does not match the requested number of function calls, as reported in https://www.googlecloudcommunity.com/gc/AI-ML/Reasoning-Engine-Error/m-p/789436:

400 Please ensure that function response turn comes immediately after a function call turn. And the number of function response parts should be equal to number of function call parts of the function call turn.

This PR fixes how the sample notebook for Parallel Function Calling handles multiple function call responses.

  • [x] Follow the CONTRIBUTING Guide.
  • [x] You are listed as the author in your notebook or README file.
    • [x] Your account is listed in CODEOWNERS for the file(s).
  • [x] Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
  • [x] Ensure the tests and linter pass (Run nox -s format from the repository root to format).
  • [x] Appropriate docs were updated (if necessary)

koverholt avatar Aug 09 '24 16:08 koverholt

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Much appreciated!

koverholt avatar Aug 12 '24 17:08 koverholt