Types to represent user input request and response for additional details#7088
Open
SergeyMenshykh wants to merge 10 commits intodotnet:mainfrom
Open
Types to represent user input request and response for additional details#7088SergeyMenshykh wants to merge 10 commits intodotnet:mainfrom
SergeyMenshykh wants to merge 10 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces two new content types to represent user input requests and responses for additional details in AI agent interactions. The AdditionalDetailsRequestContent class allows AI agents (specifically A2A agents) to request additional information from users, while AdditionalDetailsResponseContent represents the user's response. These types follow the existing pattern of paired request/response content types (similar to FunctionApprovalRequestContent/FunctionApprovalResponseContent) and integrate properly with the JSON serialization infrastructure.
Key changes:
- Added
AdditionalDetailsRequestContentandAdditionalDetailsResponseContentclasses with proper inheritance fromUserInputRequestContentandUserInputResponseContent - Integrated both types into the JSON polymorphic serialization system with type discriminators
- Provided comprehensive test coverage for constructors, serialization, and the
CreateResponsehelper method
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs |
New class representing a request for additional details from the user, includes a CreateResponse helper method |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs |
New class representing a response providing requested additional details |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs |
Added JSON polymorphic type mapping for the new request content type |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs |
Added JSON polymorphic type mapping for the new response content type |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs |
Updated comments documenting the complete type hierarchy |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs |
Registered new types in JSON serialization options and source generation context |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs |
Comprehensive tests for the request content type including constructor validation, roundtripping, and CreateResponse method |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsResponseContentTests.cs |
Comprehensive tests for the response content type including constructor validation and serialization |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIContentTests.cs |
Updated polymorphic serialization test to include the new content types |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs |
Added new request content type to derived types serialization test |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs |
Added new response content type to derived types serialization test |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs
Show resolved
Hide resolved
.../Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs
Show resolved
Hide resolved
…ditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ditionalDetailsResponseContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ditionalDetailsResponseContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ithub.com/SergeyMenshykh/extensions into additional-details-request-response-types
…ditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
15 tasks
…ithub.com/SergeyMenshykh/extensions into additional-details-request-response-types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
AdditionalDetailsRequestContentclass to represent requests from AI agents for additional details, and theAdditionalDetailsResponseContentclass to represent corresponding responses to those requests.For now, the pair of classes will be used by the A2A AI agents to indicate that additional details need to be provided to the agents. The request from and response to the A2A agent can be represented by
TextContent,UriContent, orDataContentAI content types.Microsoft Reviewers: Open in CodeFlow