Skip to content

fix(gemini): align streaming function-call handling with ADK Python#1307

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_936020505
Jun 26, 2026
Merged

fix(gemini): align streaming function-call handling with ADK Python#1307
copybara-service[bot] merged 1 commit into
mainfrom
test_936020505

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 26, 2026

Copy link
Copy Markdown

fix(gemini): align streaming function-call handling with ADK Python

  • 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.

@copybara-service copybara-service Bot force-pushed the test_936020505 branch 10 times, most recently from 0e81429 to 6ed9f41 Compare June 26, 2026 13:47
- 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
@copybara-service copybara-service Bot merged commit 37bb5e6 into main Jun 26, 2026
@copybara-service copybara-service Bot deleted the test_936020505 branch June 26, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant