Skip to content

fix(core): exclude Gemini 3.5 Live Translate from Gemini 3.x Live routing (adk-python parity) - #922

Merged
kalenkevich merged 3 commits into
google:mainfrom
CodeAlex52:fix/gemini3x-live-exclude-live-translate
Sep 23, 2026
Merged

kalenkevich merged 3 commits into
google:mainfrom
CodeAlex52:fix/gemini3x-live-exclude-live-translate

Conversation

@CodeAlex52

Copy link
Copy Markdown
Contributor

Summary

#912 generalized isGemini3xLive from the -flash-live spelling to the whole
gemini-3.* -live family to fix realtime audio routing (part of #911). That sweep
also caught gemini-3.5-live-translate*, which the adk-python reference deliberately
excludes from its equivalent predicate:

src/google/adk/utils/model_name_utils.py

return (
    model_name.startswith('gemini-3.')
    and '-live' in model_name
    and not is_gemini_3_5_live_translate(model_string)
)

tests/unittests/utils/test_model_name_utils.py

assert _is_gemini_3_x_live('gemini-3.5-live-translate') is False

For Live Translate ids the conversational paths in JS therefore diverge from the
Python SDK after #912:

path after #912 (head) with this PR (= adk-python)
sendContent single text part sendRealtimeInput({text}) sendClientContent
sendHistory turnComplete forced true derived from last role
buffered tool calls flushed immediately on toolCall buffered until turnComplete
audio / video sendRealtimeInput({audio|video}) unchanged (still realtime)

What this PR does

  • adds isGemini35LiveTranslate() (mirrors adk-python's is_gemini_3_5_live_translate,
    including path-prefix extraction) and excludes those ids from isGemini3xLive
  • keeps Live Translate audio/video on the realtime path via an explicit gate in
    sendRealtime (adk-python:
    if self._is_gemini_3_x_live or self._is_gemini_3_5_live_translate:)
  • exports the new predicate from common.ts
  • flips the unit assertion pinned by fix(core): route Gemini 3.x live audio by model family, not the '-flash-live' spelling #912
    (isGemini3xLive('gemini-3.5-live-translate-preview') === true) to the reference
    value false, and adds plain/path-based variants plus a new
    isGemini35LiveTranslate suite, and sendContent/sendRealtime cases for a
    Live Translate id

Notes

Test plan

Updated/added unit tests in core/test/utils/model_name_test.ts and
core/test/models/gemini_llm_connection_test.ts (vitest suites); CI runs the
same suites.

…ting

PR google#912 generalized isGemini3xLive from the '-flash-live' spelling to the
whole gemini-3.* '-live' family to fix realtime audio routing. That sweep
also caught gemini-3.5-live-translate*, which adk-python deliberately
excludes from its equivalent _is_gemini_3_x_live predicate and handles
through a dedicated translate branch (is_gemini_3_5_live_translate,
pinned False in test_model_name_utils.py since 8aff5141, 2026-06-30).

For Live Translate ids the conversational paths currently diverge from
the Python SDK: single-part text goes to sendRealtimeInput({text})
instead of sendClientContent, sendHistory forces turnComplete=true
instead of deriving it from the last role, and buffered tool calls are
flushed on toolCall instead of turnComplete.

This change:
- adds isGemini35LiveTranslate() and excludes those ids from
  isGemini3xLive
- keeps Live Translate audio/video on the realtime path via an explicit
  gate in sendRealtime (adk-python:
  `if self._is_gemini_3_x_live or self._is_gemini_3_5_live_translate:`)
- exports the new predicate and updates the tests that pinned the
  divergent value
@google-cla

google-cla Bot commented Sep 19, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kalenkevich

Copy link
Copy Markdown
Collaborator

could you please fix the CI issues (formatting), thanks?

@CodeAlex52

Copy link
Copy Markdown
Contributor Author

Pushed 1c14d1b — collapsed the model_name.js import to satisfy prettier format:check (80-col). Thanks for the review!

@kalenkevich
kalenkevich merged commit 8e0fa6a into google:main Sep 23, 2026
14 checks passed
@kalenkevich kalenkevich mentioned this pull request Sep 23, 2026
prasanna8585 pushed a commit to prasanna8585/adk-js that referenced this pull request Nov 10, 2026
…ting (adk-python parity) (google#922)

* fix(core): exclude Gemini 3.5 Live Translate from Gemini 3.x Live routing

PR google#912 generalized isGemini3xLive from the '-flash-live' spelling to the
whole gemini-3.* '-live' family to fix realtime audio routing. That sweep
also caught gemini-3.5-live-translate*, which adk-python deliberately
excludes from its equivalent _is_gemini_3_x_live predicate and handles
through a dedicated translate branch (is_gemini_3_5_live_translate,
pinned False in test_model_name_utils.py since 8aff5141, 2026-06-30).

For Live Translate ids the conversational paths currently diverge from
the Python SDK: single-part text goes to sendRealtimeInput({text})
instead of sendClientContent, sendHistory forces turnComplete=true
instead of deriving it from the last role, and buffered tool calls are
flushed on toolCall instead of turnComplete.

This change:
- adds isGemini35LiveTranslate() and excludes those ids from
  isGemini3xLive
- keeps Live Translate audio/video on the realtime path via an explicit
  gate in sendRealtime (adk-python:
  `if self._is_gemini_3_x_live or self._is_gemini_3_5_live_translate:`)
- exports the new predicate and updates the tests that pinned the
  divergent value

* chore: retrigger CLA check after signing

* style: collapse model_name import to satisfy prettier format:check
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.

2 participants