fix(gemini): set IncludeServerSideToolInvocations when using built-in tools with function calling#762
Open
jredl-va wants to merge 2 commits intocloudwego:mainfrom
Open
Conversation
… tools with function calling When built-in tools (GoogleSearch, URLContext, CodeExecution, ComputerUse, FileSearch, GoogleSearchRetrieval, GoogleMaps) are used alongside function calling, the Gemini API requires IncludeServerSideToolInvocations to be enabled in the ToolConfig, otherwise it returns INVALID_ARGUMENT. This bumps google.golang.org/genai to v1.52.1 (field added in v1.51.0) and automatically sets the flag when any built-in tool is present alongside function declarations. Fixes cloudwego#761
Author
|
cc @meguminnnnnnnnn @N3kox @JonXSnow — tagging for visibility as top contributors to the gemini component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
fix: A bug fix
Check the PR title.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
When built-in tools (GoogleSearch, URLContext, CodeExecution, ComputerUse, FileSearch, GoogleSearchRetrieval, GoogleMaps) are used alongside function calling tools, the Gemini API requires
ToolConfig.IncludeServerSideToolInvocationsto be set totrue. Without this, the API returnsINVALID_ARGUMENT: Please enable tool_config.include_server_side_tool_invocations to use Built-in tools with Function calling.This PR:
google.golang.org/genaifrom v1.36.0 to v1.52.1 (theIncludeServerSideToolInvocationsfield was added in v1.51.0)IncludeServerSideToolInvocations = truein theToolConfigwhen any built-in tool is present alongside function declarations(Optional) Which issue(s) this PR fixes:
Fixes #761