Skip to content

feat(gemini): support mixing provider tools with custom function tools#976

Open
cainydev wants to merge 1 commit intoprism-php:mainfrom
cainydev:feat/gemini-mix-provider-tools
Open

feat(gemini): support mixing provider tools with custom function tools#976
cainydev wants to merge 1 commit intoprism-php:mainfrom
cainydev:feat/gemini-mix-provider-tools

Conversation

@cainydev
Copy link

Closes #972

Gemini 3+ models support mixing built-in provider tools (e.g. google_search, url_context) with custom function declarations in the same request via toolConfig.includeServerSideToolInvocations. Previously Prism threw an exception in all three handlers when this was attempted.

Changes

  • Remove the exception thrown when provider tools and custom tools are used together
  • Automatically set includeServerSideToolInvocations: true in tool_config when both tool types are present
  • Apply the same fix to the searchGrounding provider option in the Stream handler, which is the same scenario
  • Extract a ToolConfigMap to centralise tool_config building across Text, Structured, and Stream handlers

@jamsouf
Copy link

jamsouf commented Mar 25, 2026

+1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini: Support mixing provider tools with custom function tools

2 participants