fix(live): honor explicit None for audio transcription - #6830
Open
donggyun112 wants to merge 1 commit into
Open
Conversation
_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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6827
_new_invocation_context_for_livetreated explicitNoneas unset and wroteAudioTranscriptionConfig()into the caller'sRunConfig.Noneis the only off-switch — both fields default to a truthydefault_factory.Fill only fields not in
model_fields_set, and only on amodel_copy. Unset stays on; explicitNonestaysNone; the caller is not mutated.Testing Plan
Unit tests
Four tests in
tests/unittests/test_runners.py(-k live_context): explicitNonestaysNoneon the run and the caller; defaults stay on; nosub_agentspasses the config through; opt-out still holds whenresponse_modalitiesis unset.Manual E2E
The write happens while building the invocation context, before any model connection. Repro from #6827 against this branch:
input_audio_transcriptionstaysNoneon both the caller andic.run_config.