Skip to content

Conversation

@SergeyMenshykh
Copy link
Contributor

@SergeyMenshykh SergeyMenshykh commented Nov 26, 2025

This PR adds the AdditionalDetailsRequestContent class to represent requests from AI agents for additional details, and the AdditionalDetailsResponseContent class 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, or DataContent AI content types.

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings November 26, 2025 18:03
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner November 26, 2025 18:03
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Nov 26, 2025
Copilot finished reviewing on behalf of SergeyMenshykh November 26, 2025 18:06
Copy link
Contributor

Copilot AI left a 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 AdditionalDetailsRequestContent and AdditionalDetailsResponseContent classes with proper inheritance from UserInputRequestContent and UserInputResponseContent
  • Integrated both types into the JSON polymorphic serialization system with type discriminators
  • Provided comprehensive test coverage for constructors, serialization, and the CreateResponse helper 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

SergeyMenshykh and others added 7 commits November 26, 2025 18:14
…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>
…ditionalDetailsRequestContent.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant