Repository navigation
fix(google-genai): preserve distinct streaming response parts - #276
Merged
nik13 merged 2 commits intoNov 9, 2026
Merged
Conversation
Contributor
Author
|
I merged current |
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 does this PR do?
Fixes #275. Keeps Gemini streaming response parts distinct instead of merging every part into position 0. A response containing
weather(city="Paris")andtime(zone="UTC")currently exports only the second call; adding text can hide both calls from the tool-call attributes.Why?
Candidates have indexes; their parts do not. The existing list-append path in
_ValuesAccumulatorpreserves the ordered parts without inventing an index or combining unrelated tool arguments, signatures and media. Candidate grouping and concatenated message-content attributes remain unchanged. Application-visible chunks are returned by identity.output.valuenow contains the original part fragments in arrival order, including separate text fragments. README and changelog describe this trace-output change. This does not reconstruct Vertexpartial_argsinto synthetic complete calls or change stream lifecycle handling.How was it tested?
Linux CI and complete test/build artifacts check out
4d9f31ae00cf6a3d9e6b92041b0eb7be8f1c1b1fdirectly:httpx.MockTransport, exercising request construction, SSE parsing, conversion and instrumentation. No live Gemini calls were made.pip check, wheel build, Ruff correctness rules (E4,E7,E9,F), Black/isort on new tests and Mypy 1.18.2 pass in all four jobs. Local Windows/Python 3.12 checks pass too.Checklist
main; conventional commit; no secrets or new runtime dependencies.Notes for reviewers
This is independent of #268 and #270, which change the Google ADK adapter. The production change here uses the existing accumulator's append behavior; no SDK patches or dependency changes are included.
Implementation and regression tests written with an OpenAI assistant under my supervision.