Skip to content

support tool_choice in Gemini adapter for non-live API#4039

Open
omChauhanDev wants to merge 2 commits intopipecat-ai:mainfrom
omChauhanDev:fix/gemini-adapter-tool-choice
Open

support tool_choice in Gemini adapter for non-live API#4039
omChauhanDev wants to merge 2 commits intopipecat-ai:mainfrom
omChauhanDev:fix/gemini-adapter-tool-choice

Conversation

@omChauhanDev
Copy link
Copy Markdown
Contributor

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

Fixes #3994

Change :

Added tool_choice support to GeminiLLMAdapter, converting LLMContext.tool_choice to Gemini's ToolConfig/FunctionCallingConfig format for GoogleLLMService and GoogleVertexLLMService

Note : Google's Live API doesn't support tool_config (upstream issue).

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 40.90909% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/adapters/services/gemini_adapter.py 31.25% 11 Missing ⚠️
src/pipecat/services/google/llm.py 66.66% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/google/llm.py 45.58% <66.66%> (+0.52%) ⬆️
src/pipecat/adapters/services/gemini_adapter.py 48.36% <31.25%> (-1.26%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

tool_choice is not supported by the Google Realtime API.

1 participant