Skip to content

tool_choice is not supported by the Google Realtime API. #3994

@vicky-sai

Description

@vicky-sai

pipecat version

0.0.104

Python version

3.12.12

Operating System

mac OS Apple M4 Pro

Issue description

  1. set_tool_choice() exists on LLMContext (line 351) and stores the value correctly
  2. OpenAI adapter reads it → context.tool_choice at line 67 → passes to OpenAI API → works
  3. Gemini adapter ignores it → GeminiLLMInvocationParams has no tool_choice field, get_llm_invocation_params() never reads context.tool_choice
  4. Gemini Live _connect() builds LiveConnectConfig from the adapter output → only gets system_instruction and tools → no tool_choice propagated

The set_tool_choice setter method IS real and functional - but the Gemini adapter simply doesn't extract it from context. It's a gap in pipecat's Gemini integration. The OpenAI path uses it; the Gemini path doesn't. Your first_user_turn_done handler-level gate is still the correct workaround for Gemini Live.

Reproduction steps

Just use

Expected behavior

Used 'tool_choice in LLMContext for Gemini Native live audio model

Actual behavior

tool_choice not settable

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions