Cherry pick fixes to v1#5934
Merged
Merged
Conversation
…re safety info Allows clients to capture the safety filter and turn completion reasons when using the Gemini Live API (v3.1+). Previously in Live v2.5, SafetyFilterMetadata was passed back, but with Live v3.1 it has been moved to turn_complete_reason. This change adds support for turn_complete_reason in LlmResponse and populates it from the server content. Change-Id: Ie6d970e65f3937fb1cfa3bf7f01df79f4f1a71d8
In Gemini 3.1 Live, grounding metadata is often emitted early alongside partial chunks or immediately after tool execution, causing the runner to discard it because it is associated with partial=True events. - Retain pending grounding metadata during the turn in GeminiLlmConnection.receive and yield it on the final non-partial event. - Add test_receive_grounding_metadata_pending unit test to verify the fix. Change-Id: I4d8ab1f231a3fed63c4375cbfcd8831d6535721e
Collaborator
|
Response from ADK Triaging Agent Hello @wukath, thank you for creating this PR! To help us review and merge your contribution as quickly as possible, please ensure the pull request follows our contribution guidelines. Currently, we noticed the following details are missing:
Providing this information will help our reviewers understand and verify the changes more efficiently. Thank you! |
Resolves protocol handling discrepancies when connecting to Gemini 3.1 Flash Live models: - Sets initial_history_in_client_content=True when seeding conversation history during connection handshake. - Appends turn_complete=True on the final history turn during setup. - Iterates sequentially through all parts of model_turn to unpack multiplexed audio and text responses. - Prunes unsupported proactivity and affective dialogue configurations when assembling LiveConnectConfig. Change-Id: I2d0ff38d8a6eb40ea17b37f65a4ddd093230842c
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.
Cherry-pick the following commits from main into v1:
9126acb: Support turn_complete_reason in Live responses to capture safety info
e896c62: Prevent grounding metadata loss in Gemini 3.1
e5af12c: Resolve 1007 error and support Gemini 3.1 Flash Live protocol