Initial implementation of API to send chat history to MCP platform.#148
Initial implementation of API to send chat history to MCP platform.#148pontemonti merged 33 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements an API for sending chat history to an MCP (Model Context Protocol) platform endpoint for real-time threat protection analysis. The implementation adds new data models, service methods, and utility functions to support this feature.
Key changes:
- Adds
SendChatHistoryAsyncmethods toIMcpToolServerConfigurationServicefor sending chat history to the MCP platform - Introduces new models (
ChatMessageRequest,ChatHistoryMessage) to represent chat history data - Creates utility method
GetChatHistoryEndpointfor constructing the chat history endpoint URL - Adds singleton Instance property to
Agent365SdkUserAgentConfigurationand usesnewkeyword in derived classes to provide type-specific instances - Implements
GetDefaultHttpClientutility method in Runtime to centralize HttpClient creation with standard configuration
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tooling/Extensions/SemanticKernel/Agent365SemanticKernelSdkUserAgentConfiguration.cs | Adds new keyword to Instance property to hide base class member and return derived type |
| src/Tooling/Extensions/AzureAIFoundry/Agent365AzureAIFoundrySdkUserAgentConfiguration.cs | Adds new keyword to Instance property to hide base class member and return derived type |
| src/Tooling/Extensions/AgentFramework/Agent365AgentFrameworkSdkUserAgentConfiguration.cs | Adds new keyword to Instance property to hide base class member and return derived type |
| src/Tooling/Core/Utils/Utility.cs | Adds GetChatHistoryEndpoint method to construct endpoint URL for chat history API |
| src/Tooling/Core/Services/McpToolServerConfigurationService.cs | Implements SendChatHistoryAsync methods to POST chat history to MCP platform; refactors GetMCPServerFromToolingGatewayAsync to use new GetDefaultHttpClient utility |
| src/Tooling/Core/Services/IMcpToolServerConfigurationService.cs | Adds interface definitions for SendChatHistoryAsync methods (with and without ToolOptions) |
| src/Tooling/Core/Models/ChatMessageRequest.cs | New model representing the request payload for sending chat messages to threat protection endpoint |
| src/Tooling/Core/Models/ChatHistoryMessage.cs | New model representing individual messages in chat history with id, role, content, and timestamp |
| src/Runtime/Core/Utility.cs | Adds GetDefaultHttpClient utility method for creating HttpClient instances with standard timeout and user agent configuration |
| src/Runtime/Core/Agent365SdkUserAgentConfiguration.cs | Adds static Instance property to provide singleton access to default configuration |
| src/Tests/Runtime.Tests/Agent365SdkUserAgentConfigurationTests.cs | Adds tests for Instance singleton property behavior and validation |
| src/Tests/Microsoft.Agents.A365.Tooling.Tests/Utils/UtilityTests.cs | New test file with comprehensive tests for GetChatHistoryEndpoint and other utility methods |
| src/Tests/Microsoft.Agents.A365.Tooling.Tests/Services/McpToolServerConfigurationServiceTests.cs | New test file with tests for SendChatHistoryAsync parameter validation |
| src/Tests/Microsoft.Agents.A365.Tooling.Tests/Models/ChatMessageRequestTests.cs | New test file with tests for ChatMessageRequest serialization and constructor behavior |
| src/Tests/Microsoft.Agents.A365.Tooling.Tests/Models/ChatHistoryMessageTests.cs | New test file with tests for ChatHistoryMessage serialization and property handling |
| src/Tests/Microsoft.Agents.A365.Tooling.Tests/Microsoft.Agents.A365.Tooling.Tests.csproj | New test project file for Tooling component tests |
| src/Microsoft.Agents.A365.Sdk.sln | Adds new test project to solution file |
rahuldevikar761
left a comment
There was a problem hiding this comment.
If it's not urgent, I want to discuss this offline.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
We'll want to get this in ASAP so that we can proceed with the other implementations - there are teams waiting for this. |
|
@pontemonti I've opened a new pull request, #150, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ryMessageTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Trying to get this in ASAP, we can discuss any follow-ups later.
|
@pontemonti I've opened a new pull request, #151, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Wrap HttpResponseMessage in using statement for proper disposal Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
…164) * Initial plan * Fix HttpResponseMessage disposal issues by using lambda factory pattern Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
…ServerConfigurationServiceTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@pontemonti I've opened a new pull request, #165, to work on those changes. Once the pull request is ready, I'll request review from you. |
) * Initial plan * Fix HttpResponseMessage disposal race condition in test Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
No description provided.