Skip to content

Conversation

rogerbarreto
Copy link
Member

#Motivation

@rogerbarreto rogerbarreto self-assigned this Jun 11, 2025
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 12:54
Copy link
Contributor

@Copilot Copilot AI left a comment

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
File Description
dotnet/tests/.../ChatClientAgentTests.cs Renamed tests, removed outdated ones, added new streaming test
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentOptions.cs Added InstructionsRole property
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs Updated log messages to reference client type instead of service
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs Added RunStreamingAsync extension and renamed parameter for clarity
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs Implemented 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,

@rogerbarreto rogerbarreto enabled auto-merge June 11, 2025 17:32
@rogerbarreto rogerbarreto added this pull request to the merge queue Jun 12, 2025
Merged via the queue into microsoft:main with commit d761c92 Jun 12, 2025
8 checks passed
@rogerbarreto rogerbarreto deleted the issues/68-chatclientagent-streaming branch June 12, 2025 06:21
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.

ChatClientAgent Streaming API

4 participants