-
Notifications
You must be signed in to change notification settings - Fork 586
.Net ChatClientAgent Streaming API Impl. #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net ChatClientAgent Streaming API Impl. #69
Conversation
There was a problem hiding this 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.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,
#Motivation