Skip to content

fix(live): honor explicit None for audio transcription - #6830

Open
donggyun112 wants to merge 1 commit into
google:mainfrom
donggyun112:fix/live-transcription-optout
Open

fix(live): honor explicit None for audio transcription#6830
donggyun112 wants to merge 1 commit into
google:mainfrom
donggyun112:fix/live-transcription-optout

Conversation

@donggyun112

Copy link
Copy Markdown

Closes #6827

_new_invocation_context_for_live treated explicit None as unset and wrote AudioTranscriptionConfig() into the caller's RunConfig. None is the only off-switch — both fields default to a truthy default_factory.

Fill only fields not in model_fields_set, and only on a model_copy. Unset stays on; explicit None stays None; the caller is not mutated.

Testing Plan

Unit tests

Four tests in tests/unittests/test_runners.py (-k live_context): explicit None stays None on the run and the caller; defaults stay on; no sub_agents passes the config through; opt-out still holds when response_modalities is unset.

$ pytest tests/unittests/test_runners.py -k live_context -q
4 passed, 96 deselected in 0.59s

$ pytest tests/unittests/test_runners.py -q
100 passed, 17 warnings in 1.24s

Manual E2E

The write happens while building the invocation context, before any model connection. Repro from #6827 against this branch: input_audio_transcription stays None on both the caller and ic.run_config.

_new_invocation_context_for_live treated an explicit None for
input_audio_transcription / output_audio_transcription as unset and
wrote AudioTranscriptionConfig() into the caller's RunConfig. None is
the only off-switch: both fields default to a truthy default_factory,
so the falsy check could only ever fire on a deliberate opt-out.

Fill only fields not in model_fields_set, and only on a model_copy.
Unset stays on; explicit None stays None; the caller's RunConfig is
not mutated.

Fixes google#6827
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.

Live multi-agent runs turn audio transcription back on after the caller disabled it

2 participants