Skip to content

Streaming responses - #61

Merged
Axel Suárez (axelsrz) merged 7 commits into
mainfrom
axsuarez/streaming
Jul 17, 2025
Merged

Streaming responses#61
Axel Suárez (axelsrz) merged 7 commits into
mainfrom
axsuarez/streaming

Conversation

@axelsrz

Copy link
Copy Markdown
Member

This pull request introduces several enhancements and new features across multiple modules, focusing on streaming capabilities, AI-generated content handling, and citation utilities. The most significant changes include the addition of a streaming_response property to the turn context, support for AI entities in activities, and utility functions for citation management.

Streaming Enhancements:

  • Added a streaming_response property to TurnContext in libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/turn_context.py, enabling partial response streaming to clients.
  • Introduced StreamingResponse, StreamingChannelData, and related classes in libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming, providing foundational support for streaming operations. [1] [2]

AI-Generated Content:

  • Added AIEntity and related models in libraries/Core/microsoft-agents-core/microsoft/agents/core/models/ai_entity.py to represent AI-generated content and citations. Also included a utility function, add_ai_to_activity, for associating AI entities with activities.
  • Updated Activity class in libraries/Core/microsoft-agents-core/microsoft/agents/core/models/activity.py to support AI entities using SerializeAsAny.

Citation Utilities:

  • Introduced CitationUtil in libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation_util.py, providing methods for formatting citation responses, clipping text, and extracting used citations from text.

Miscellaneous Improvements:

  • Enhanced model_dump in ConnectorClient to exclude None values when replying to activities, optimizing payloads.
  • Updated __init__.py files across modules to export new classes and utilities for broader accessibility. [1] [2] [3]

rido-min
Rido (rido-min) previously approved these changes Jul 9, 2025

@rido-min Rido (rido-min) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other consideration is the DotNet AgentApplication will call EndStream if needed. More of a request from Teams to ensure it's called even in the event of an exception.

@axelsrz
Axel Suárez (axelsrz) merged commit 3721d3d into main Jul 17, 2025
5 checks passed
@cleemullins
Chris Mullins (cleemullins) deleted the axsuarez/streaming branch October 2, 2025 21:07
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.

4 participants