-
Notifications
You must be signed in to change notification settings - Fork 845
Types to represent user input request and response for additional details #7088
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
base: main
Are you sure you want to change the base?
Types to represent user input request and response for additional details #7088
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 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>
…ithub.com/SergeyMenshykh/extensions into additional-details-request-response-types
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