azure-ai-agents streaming samples#48397
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class streaming support to azure-ai-agents Responses clients (sync + async), along with bridging utilities and end-to-end samples/tests to demonstrate and validate agent streaming scenarios.
Changes:
- Added streaming response creation methods to
ResponsesClientandResponsesAsyncClientfor agent and agent-conversation scenarios. - Introduced
StreamingUtilsto bridge OpenAI streaming primitives into Azure SDKIterableStreamand ReactorFlux. - Added streaming-focused samples and tests (sync + async), plus updated
assets.jsontag.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesClient.java | Adds sync streaming APIs returning IterableStream<ResponseStreamEvent>. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesAsyncClient.java | Adds async streaming APIs returning Flux<ResponseStreamEvent>. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/StreamingUtils.java | New bridging utilities (StreamResponse→IterableStream, AsyncStreamResponse→Flux). |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/implementation/StreamingUtilsTest.java | Unit tests for the new bridging utilities. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/StreamingTests.java | New sync integration tests validating streamed agent responses. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/StreamingAsyncTests.java | New async integration tests validating streamed agent responses. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/SimpleStreamingSync.java | Sample showing sync streaming text deltas. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/SimpleStreamingAsync.java | Sample showing async streaming text deltas. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/FunctionCallStreamingSync.java | Sample showing sync streaming with function-calling deltas. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/FunctionCallStreamingAsync.java | Sample showing async streaming with function-calling deltas. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/CodeInterpreterStreamingSync.java | Sample showing sync streaming with Code Interpreter progress/code events. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/streaming/CodeInterpreterStreamingAsync.java | Sample showing async streaming with Code Interpreter progress/code events. |
| sdk/ai/azure-ai-agents/assets.json | Updates the asset tag to a new version. |
You can also share your feedback on Copilot code review. Take the survey.
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
kaylieee
approved these changes
Mar 13, 2026
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.
This pull request introduces streaming support for agent responses in both synchronous and asynchronous clients, enabling real-time processing of response events. It adds utility methods for bridging OpenAI streaming types to Azure SDK and Reactor types, and provides new sample code demonstrating streaming with the Code Interpreter tool. The most significant changes are grouped below.
Streaming API Enhancements
createStreamingWithAgentandcreateStreamingWithAgentConversationmethods to bothResponsesClientandResponsesAsyncClient, allowing users to receive streamed response events from agents and agent conversations. These methods utilize new bridging utilities for OpenAI streaming types. [1] [2]StreamingUtilsclass, which provides helper methods (toIterableStreamandtoFlux) to convert OpenAI streaming responses into Azure SDK'sIterableStreamand Reactor'sFlux, ensuring proper resource management and seamless integration.Sample Code Additions
CodeInterpreterStreamingSync.javaandCodeInterpreterStreamingAsync.javasamples, illustrating how to stream agent responses (including code execution progress and text output) using the new synchronous and asynchronous streaming APIs. These samples highlight practical usage of the Code Interpreter tool and event handling. [1] [2]Asset Tag Update
assets.jsonto reference the new version, reflecting these streaming capabilities.