Skip to content

fix(gemini): set IncludeServerSideToolInvocations when using built-in tools with function calling#762

Open
jredl-va wants to merge 2 commits intocloudwego:mainfrom
jredl-va:fix/gemini-server-side-tool-invocations
Open

fix(gemini): set IncludeServerSideToolInvocations when using built-in tools with function calling#762
jredl-va wants to merge 2 commits intocloudwego:mainfrom
jredl-va:fix/gemini-server-side-tool-invocations

Conversation

@jredl-va
Copy link
Copy Markdown

@jredl-va jredl-va commented Apr 6, 2026

What type of PR is this?

fix: A bug fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level.

(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.IncludeServerSideToolInvocations to be set to true. Without this, the API returns INVALID_ARGUMENT: Please enable tool_config.include_server_side_tool_invocations to use Built-in tools with Function calling.

This PR:

  1. Bumps google.golang.org/genai from v1.36.0 to v1.52.1 (the IncludeServerSideToolInvocations field was added in v1.51.0)
  2. Automatically sets IncludeServerSideToolInvocations = true in the ToolConfig when any built-in tool is present alongside function declarations

(Optional) Which issue(s) this PR fixes:

Fixes #761

… 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
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.

@jredl-va
Copy link
Copy Markdown
Author

jredl-va commented Apr 6, 2026

cc @meguminnnnnnnnn @N3kox @JonXSnow — tagging for visibility as top contributors to the gemini component.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Gemini: INVALID_ARGUMENT when using built-in tools (GoogleSearch, etc.) with function calling

2 participants