Skip to content

fix(web): handle TEXT modality for native-audio models (#4206)#5662

Open
paulxg12 wants to merge 1 commit into
google:mainfrom
paulxg12:main
Open

fix(web): handle TEXT modality for native-audio models (#4206)#5662
paulxg12 wants to merge 1 commit into
google:mainfrom
paulxg12:main

Conversation

@paulxg12
Copy link
Copy Markdown

Summary

Fixes #4206 — native-audio models fail when TEXT modality is explicitly requested via the ADK web server.

Root Cause

The /run_live WebSocket endpoint accepted modalities from query params without validating against model capabilities. When a user requested TEXT modality for a native-audio model (e.g., gemini-live-2.5-flash-native-audio), the model failed since it only supports AUDIO.

Changes

  • adk_web_server.py: detect native-audio models in WebSocket handler and override modalities to ["AUDIO"]
  • runners.py: extended native-audio check to also correct explicitly-set ["TEXT"] to ["AUDIO"] (previously only handled None case)

Testing

  • Native-audio models with no modality specified → AUDIO (unchanged behavior)
  • Native-audio models with TEXT modality requested → AUDIO (fixed)
  • Non-audio models → respects user's modality choice (unchanged)

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 11, 2026

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.

@paulxg12
Copy link
Copy Markdown
Author

I have read the Google CLA and I hereby sign the CLA

@rohityan rohityan self-assigned this May 12, 2026
@rohityan rohityan added web [Component] This issue will be transferred to adk-web request clarification [Status] The maintainer need clarification or more information from the author labels May 12, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @paulxg12 , Thank you for your contribution! It appears you haven't yet signed the Contributor License Agreement (CLA). Please visit https://cla.developers.google.com/ to complete the signing process. Once the CLA is signed, we'll be able to proceed with the review of your PR. Thank you!

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

Labels

request clarification [Status] The maintainer need clarification or more information from the author web [Component] This issue will be transferred to adk-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adk web: Native-audio models fail when TEXT modality is requested

3 participants