Uh oh!
There was an error while loading. Please reload this page.
.Net ChatClientAgent Streaming API Impl. - #69
Conversation
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.RunStreamingAsyncwith proper thread/message preparation and logging - Introduces
InstructionsRoleinChatClientAgentOptionsand extends the agent API withRunStreamingAsyncin 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
InstructionsRoleviaChatClientAgentOptionscorrectly overrides the defaultChatClientAgent.InstructionsRolevalue.
}
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs:49
- [nitpick] Add a
<returns>XML comment to describe that this method yields an asynchronous stream ofChatResponseUpdateitems.
public static IAsyncEnumerable<ChatResponseUpdate> RunStreamingAsync(
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs:27
- [nitpick] Consider renaming this method to
LogAgentChatClientInvokingClientto 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,
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Add Streaming API * Removing InstructionsRole * Updating thread notification strategy * Fix net472 failing * Address typo
#Motivation