fix interactions SSE ids for function calls #5177
Open
kshirajahere wants to merge 3 commits intogoogle:mainfrom
Open
fix interactions SSE ids for function calls #5177kshirajahere wants to merge 3 commits intogoogle:mainfrom
kshirajahere wants to merge 3 commits intogoogle:mainfrom
Conversation
Fixes google#5169 by reading interaction IDs from the actual GenAI SDK SSE event fields and carrying them through streaming function-call responses. Also adds regression coverage for interaction.complete events and streaming interaction.start chaining.
Rename the thought-content temporary variable so the repo's mypy new-errors workflow does not treat a shifted baseline no-redef diagnostic as a newly introduced error.
Author
|
I validated the latest head |
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.
What changed
interaction.id,interaction_id,event_id) instead of onlyevent.idinteraction.completeas the final full interaction event during streaming conversioninteraction.completehandling and for SSE function-call streams that must retain the interaction ID before the tool round-tripWhy
Issue #5169 reports that
StreamingMode.SSEbreaks Interactions API function calling because the second model call cannot find the previousinteraction_idin session history.The root cause is that ADK's SSE adapter was keyed to older/generic event shapes (
event.idandevent_type == "interaction"), whilegoogle-genai1.70.0 emitsinteraction.start,interaction.complete, andinteraction.status_updateevents with IDs stored oninteraction.id,interaction_id, andevent_id.That mismatch meant streamed function-call events were persisted without an
interaction_id, so the next round of the ReAct loop could not chain the interaction and failed withinvalid_request.Impact
Gemini(use_interactions_api=True)when SSE streaming is enabledValidation
.venv\\Scripts\\pytest tests\\unittests\\models\\test_interactions_utils.py tests\\unittests\\flows\\llm_flows\\test_interactions_processor.py tests\\unittests\\models\\test_google_llm.py -q.venv\\Scripts\\pyink --check --config pyproject.toml src\\google\\adk\\models\\interactions_utils.py tests\\unittests\\models\\test_interactions_utils.py.venv\\Scripts\\isort --check-only src\\google\\adk\\models\\interactions_utils.py tests\\unittests\\models\\test_interactions_utils.py.venv\\Scripts\\pylint --rcfile=pylintrc src\\google\\adk\\models\\interactions_utils.py