fix(gemini): align streaming function-call handling with ADK Python#1307
Merged
Conversation
0e81429 to
6ed9f41
Compare
- Drop the special-case buffering of function responses for "gemini-3" models; responses are merged regardless of model name. - Emit each streaming function-call chunk as a partial and bundle the accumulated calls into a final aggregated response. - Merge function-call arguments streamed across chunks (partialArgs/willContinue) into a single complete call, accumulating string chunks by JSONPath. - Assign one client-side function-call ID per call and reuse it across the partial and final events so consumers can correlate them. - Emit the final aggregated response even when the stream ends without a finish reason, surfacing a non-STOP finish (e.g. MAX_TOKENS) as an error code. - Stop persisting partial events in the Runner so managed session services (e.g. VertexAiSessionService) no longer store duplicate function-call events. PiperOrigin-RevId: 938566833
6ed9f41 to
37bb5e6
Compare
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.
fix(gemini): align streaming function-call handling with ADK Python
responses are merged regardless of model name.
calls into a final aggregated response.
into a single complete call, accumulating string chunks by JSONPath.
and final events so consumers can correlate them.
reason, surfacing a non-STOP finish (e.g. MAX_TOKENS) as an error code.
VertexAiSessionService) no longer store duplicate function-call events.