fix: stream Azure Responses function-call arguments - #6679
Open
FrigaZzz wants to merge 1 commit into
Open
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
FrigaZzz
force-pushed
the
feat/partial-function-call-streaming
branch
from
August 11, 2026 12:36
e2a17e9 to
0f287b5
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
When an Azure OpenAI Responses request used
stream=True, ADK accumulatedfunction-call argument deltas internally but did not expose them to streaming
consumers. Applications could display token-by-token text but appeared idle
while Azure generated a large or complex tool invocation.
Solution:
Expose Azure/OpenAI Responses function-call argument events through ADK's
existing streaming contract:
LlmResponse(partial=True)when a function call starts and as argumentfragments arrive.
FunctionCall.partial_argsand setFunctionCall.will_continue=True.FunctionCallwith parsedargsafter generation completes.response.function_call_arguments.doneor completed outputitem when Azure does not provide separate delta events.
incomplete arguments cannot become an executable empty tool call.
No new public option or feature flag is introduced. Function-call arguments
are streamed whenever the caller already opts into streaming with
stream=True; non-streaming behavior remains unchanged.This PR intentionally limits the implementation to OpenAI Responses and Azure
OpenAI Responses. The other adapters discussed in #6630 are outside this PR's
scope.
Testing Plan
Unit Tests:
The focused OpenAI Responses unit tests pass locally. Coverage includes:
response.function_call_arguments.deltaevents.response.function_call_arguments.done.response.completedevent.Focused test command:
Manual End-to-End (E2E) Tests:
Tested with an Azure / Native OpenAI Responses deployment using both the ADK Dev UI and
the included terminal runner.
Setup:
Dev UI:
Terminal runner:
Observed behavior:
argument fragments before tool execution.
will_continue=True.create_documenttool executes only after the final function call andwrites the requested Markdown document.
Checklist
Additional context
The sample intentionally uses a large nested Pydantic tool schema so Azure
emits enough function-call argument fragments to make progressive streaming
easy to observe in the Dev UI and terminal output.
Partial argument fragments are informational only. Tool execution continues to
use the final validated and parsed
FunctionCall.args.