Skip to content

.Net ChatClientAgent Streaming API Impl. - #69

Merged
Roger Barreto (rogerbarreto) merged 5 commits into
microsoft:mainfrom
rogerbarreto:issues/68-chatclientagent-streaming
Jun 12, 2025
Merged

.Net ChatClientAgent Streaming API Impl.#69
Roger Barreto (rogerbarreto) merged 5 commits into
microsoft:mainfrom
rogerbarreto:issues/68-chatclientagent-streaming

Conversation

@rogerbarreto

Copy link
Copy Markdown
Member

Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements full streaming support for the ChatClientAgent and updates related configuration, extensions, logging, and tests.

  • Adds streaming logic to ChatClientAgent.RunStreamingAsync with proper thread/message preparation and logging
  • Introduces InstructionsRole in ChatClientAgentOptions and extends the agent API with RunStreamingAsync in extensions
  • Renames and updates unit tests to cover the new streaming behavior

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
dotnet/tests/.../ChatClientAgentTests.csRenamed tests, removed outdated ones, added new streaming test
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentOptions.csAdded InstructionsRole property
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.csUpdated log messages to reference client type instead of service
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.csAdded RunStreamingAsync extension and renamed parameter for clarity
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.csImplemented streaming API, refactored thread/message preparation
Comments suppressed due to low confidence (4)

dotnet/tests/Microsoft.Agents.UnitTests/ChatCompletion/ChatClientAgentTests.cs:546

  • Add a unit test to verify that supplying InstructionsRole via ChatClientAgentOptions correctly overrides the default ChatClientAgent.InstructionsRole value.
}

dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs:49

  • [nitpick] Add a <returns> XML comment to describe that this method yields an asynchronous stream of ChatResponseUpdate items.
public static IAsyncEnumerable<ChatResponseUpdate> RunStreamingAsync(

dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs:27

  • [nitpick] Consider renaming this method to LogAgentChatClientInvokingClient to reflect that it logs invocation of the chat client, matching the {ClientType} token in the message template.
public static partial void LogAgentChatClientInvokingAgent(

dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs:24

  • All logger messages currently share EventId = 0. Assign distinct event IDs to each log entry to make filtering and diagnostics easier.
EventId = 0,

Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentOptions.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Outdated
Merged via the queue into microsoft:main with commit d761c92Jun 12, 2025
@rogerbarreto
Roger Barreto (rogerbarreto) deleted the issues/68-chatclientagent-streaming branch June 12, 2025 06:21
Reuben Bond (ReubenBond) pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
* Add Streaming API
* Removing InstructionsRole
* Updating thread notification strategy
* Fix net472 failing
* Address typo
Sign up for freeto 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.

ChatClientAgent Streaming API

5 participants

@rogerbarreto@stephentoub@markwallace-microsoft@westey-m