Skip to content

Streaming responses#61

Merged
axelsrz merged 7 commits intomainfrom
axsuarez/streaming
Jul 17, 2025
Merged

Streaming responses#61
axelsrz merged 7 commits intomainfrom
axsuarez/streaming

Conversation

@axelsrz
Copy link
Member

@axelsrz axelsrz commented Jul 9, 2025

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]

@axelsrz axelsrz requested review from rido-min and tracyboehrer July 9, 2025 18:19
rido-min
rido-min previously approved these changes Jul 9, 2025
Copy link
Member

@rido-min rido-min left a comment

Choose a reason for hiding this comment

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

LGTM

tracyboehrer
tracyboehrer previously approved these changes Jul 15, 2025
Copy link
Member

@tracyboehrer tracyboehrer left a comment

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.

rido-min
rido-min previously approved these changes Jul 16, 2025
@axelsrz axelsrz merged commit 3721d3d into main Jul 17, 2025
5 checks passed
@cleemullins 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

Comments