From cc6d24d795e35eb1e4af77521fa669dff377d241 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh Date: Wed, 26 Nov 2025 17:42:33 +0000 Subject: [PATCH 1/8] add types to represent additional details request and response --- .../Contents/AIContent.cs | 2 + .../AdditionalDetailsRequestContent.cs | 38 +++++++++++ .../AdditionalDetailsResponseContent.cs | 31 +++++++++ .../Contents/UserInputRequestContent.cs | 1 + .../Contents/UserInputResponseContent.cs | 1 + .../Utilities/AIJsonUtilities.Defaults.cs | 4 ++ .../Contents/AIContentTests.cs | 4 +- .../AdditionalDetailsRequestContentTests.cs | 65 +++++++++++++++++++ .../AdditionalDetailsResponseContentTests.cs | 49 ++++++++++++++ .../Contents/UserInputRequestContentTests.cs | 1 + .../Contents/UserInputResponseContentTests.cs | 1 + 11 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs create mode 100644 src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs create mode 100644 test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs create mode 100644 test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsResponseContentTests.cs diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs index af8b19c8d84..1bfc61e0a38 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs @@ -32,6 +32,8 @@ namespace Microsoft.Extensions.AI; // [JsonDerivedType(typeof(McpServerToolApprovalResponseContent), typeDiscriminator: "mcpServerToolApprovalResponse")] // [JsonDerivedType(typeof(CodeInterpreterToolCallContent), typeDiscriminator: "codeInterpreterToolCall")] // [JsonDerivedType(typeof(CodeInterpreterToolResultContent), typeDiscriminator: "codeInterpreterToolResult")] +// [JsonDerivedType(typeof(AdditionalDetailsRequestContent), typeDiscriminator: "additionalDetailsRequestContent")] +// [JsonDerivedType(typeof(AdditionalDetailsResponseContent), typeDiscriminator: "additionalDetailsResponseContent")] public class AIContent { diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs new file mode 100644 index 00000000000..4f54a2f4218 --- /dev/null +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.AI; +using Microsoft.Shared.Diagnostics; + +namespace Microsoft.Extensions.AI; + +/// +/// Represents a request for additional details from the user. +/// +[Experimental("MEAI001")] +public sealed class AdditionalDetailsRequestContent : UserInputRequestContent +{ + /// + /// Initializes a new instance of the class. + /// + /// The ID that uniquely identifies the additional details request/response pair. + /// The additional details request. + public AdditionalDetailsRequestContent(string id, AIContent request) + : base(id) + { + Request = Throw.IfNull(request); + } + + /// + /// Gets the additional details request. + /// + public AIContent Request { get; } + + /// + /// Creates a to provide the requested additional details. + /// + /// The containing the requestd additional details. + /// The representing the response. + public AdditionalDetailsResponseContent CreateResponse(AIContent response) => new(Id, response); +} diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs new file mode 100644 index 00000000000..6f90e99a74b --- /dev/null +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.AI; +using Microsoft.Shared.Diagnostics; + +namespace Microsoft.Extensions.AI; + +/// +/// Represents a response for additional details request from the user. +/// +[Experimental("MEAI001")] +public class AdditionalDetailsResponseContent : UserInputResponseContent +{ + /// + /// Initializes a new instance of the class. + /// + /// The ID that uniquely identifies the additional details request/response pair. + /// The additional details response. + public AdditionalDetailsResponseContent(string id, AIContent response) + : base(id) + { + Response = Throw.IfNull(response); + } + + /// + /// Gets the additional details response. + /// + public AIContent Response { get; } +} diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs index b2a2e0e6e95..267bfe3c4dc 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs @@ -15,6 +15,7 @@ namespace Microsoft.Extensions.AI; [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] [JsonDerivedType(typeof(FunctionApprovalRequestContent), "functionApprovalRequest")] [JsonDerivedType(typeof(McpServerToolApprovalRequestContent), "mcpServerToolApprovalRequest")] +[JsonDerivedType(typeof(AdditionalDetailsRequestContent), "additionalDetailsRequestContent")] public class UserInputRequestContent : AIContent { /// diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs index 6902f047282..980f84dcb61 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs @@ -15,6 +15,7 @@ namespace Microsoft.Extensions.AI; [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] [JsonDerivedType(typeof(FunctionApprovalResponseContent), "functionApprovalResponse")] [JsonDerivedType(typeof(McpServerToolApprovalResponseContent), "mcpServerToolApprovalResponse")] +[JsonDerivedType(typeof(AdditionalDetailsResponseContent), "additionalDetailsResponseContent")] public class UserInputResponseContent : AIContent { /// diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs index d01294836bc..8b1c1fb1996 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs @@ -59,6 +59,8 @@ private static JsonSerializerOptions CreateDefaultOptions() AddAIContentType(options, typeof(McpServerToolApprovalResponseContent), typeDiscriminatorId: "mcpServerToolApprovalResponse", checkBuiltIn: false); AddAIContentType(options, typeof(CodeInterpreterToolCallContent), typeDiscriminatorId: "codeInterpreterToolCall", checkBuiltIn: false); AddAIContentType(options, typeof(CodeInterpreterToolResultContent), typeDiscriminatorId: "codeInterpreterToolResult", checkBuiltIn: false); + AddAIContentType(options, typeof(AdditionalDetailsRequestContent), typeDiscriminatorId: "additionalDetailsRequestContent", checkBuiltIn: false); + AddAIContentType(options, typeof(AdditionalDetailsResponseContent), typeDiscriminatorId: "additionalDetailsResponseContent", checkBuiltIn: false); if (JsonSerializer.IsReflectionEnabledByDefault) { @@ -133,6 +135,8 @@ private static JsonSerializerOptions CreateDefaultOptions() [JsonSerializable(typeof(McpServerToolApprovalResponseContent))] [JsonSerializable(typeof(CodeInterpreterToolCallContent))] [JsonSerializable(typeof(CodeInterpreterToolResultContent))] + [JsonSerializable(typeof(AdditionalDetailsRequestContent))] + [JsonSerializable(typeof(AdditionalDetailsResponseContent))] [JsonSerializable(typeof(ResponseContinuationToken))] // IEmbeddingGenerator diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIContentTests.cs index e5734ccd7cf..152eea7dcf1 100644 --- a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIContentTests.cs +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIContentTests.cs @@ -75,7 +75,9 @@ public void Serialization_DerivedTypes_Roundtrips() new McpServerToolCallContent("call123", "myTool", "myServer"), new McpServerToolResultContent("call123"), new McpServerToolApprovalRequestContent("request123", new McpServerToolCallContent("call123", "myTool", "myServer")), - new McpServerToolApprovalResponseContent("request123", approved: true) + new McpServerToolApprovalResponseContent("request123", approved: true), + new AdditionalDetailsRequestContent("request123", new TextContent("Please provide the image you mentioned but did not provide.")), + new AdditionalDetailsResponseContent("response123", new DataContent(new byte[]{ 1, 2, 3 }, "image/jpeg")) ]); var serialized = JsonSerializer.Serialize(message, AIJsonUtilities.DefaultOptions); diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs new file mode 100644 index 00000000000..da6c42631ed --- /dev/null +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs @@ -0,0 +1,65 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text.Json; +using Xunit; + +namespace Microsoft.Extensions.AI.Contents; + +public class AdditionalDetailsRequestContentTests +{ + [Fact] + public void Constructor_InvalidArguments_Throws() + { + Assert.Throws("id", () => new AdditionalDetailsRequestContent(null!, new TextContent("request"))); + Assert.Throws("id", () => new AdditionalDetailsRequestContent("", new TextContent("request"))); + Assert.Throws("id", () => new AdditionalDetailsRequestContent("\r\t\n ", new TextContent("request"))); + + Assert.Throws("request", () => new AdditionalDetailsRequestContent("id", null!)); + } + + [Fact] + public void Constructor_Roundtrips() + { + string id = "abc"; + TextContent request = new("What is your name?"); + AdditionalDetailsRequestContent content = new(id, request); + + Assert.Same(id, content.Id); + Assert.Same(request, content.Request); + } + + [Fact] + public void CreateResponse_ReturnsExpectedResponse() + { + string id = "req-1"; + string request = "What is your name?"; + TextContent response = new TextContent("My name is John"); + + AdditionalDetailsRequestContent content = new(id, new TextContent(request)); + + var textResponse = content.CreateResponse(response); + + Assert.NotNull(textResponse); + Assert.Same(id, textResponse.Id); + Assert.Same(response, textResponse.Response); + } + + [Fact] + public void Serialization_Roundtrips() + { + var content = new AdditionalDetailsRequestContent("request123", new TextContent("What is your name?")); + + var json = JsonSerializer.Serialize(content, AIJsonUtilities.DefaultOptions); + var deserializedContent = JsonSerializer.Deserialize(json, AIJsonUtilities.DefaultOptions); + + Assert.NotNull(deserializedContent); + Assert.Equal(content.Id, deserializedContent.Id); + + TextContent originalRequest = Assert.IsType(content.Request); + TextContent deserializedRequest = Assert.IsType(deserializedContent.Request); + + Assert.Equal(originalRequest.Text, deserializedRequest.Text); + } +} diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsResponseContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsResponseContentTests.cs new file mode 100644 index 00000000000..34f847a3b51 --- /dev/null +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsResponseContentTests.cs @@ -0,0 +1,49 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text.Json; +using Xunit; + +namespace Microsoft.Extensions.AI.Contents; + +public class AdditionalDetailsResponseContentTests +{ + [Fact] + public void Constructor_InvalidArguments_Throws() + { + Assert.Throws("id", () => new AdditionalDetailsResponseContent(null!, new TextContent("response"))); + Assert.Throws("id", () => new AdditionalDetailsResponseContent("", new TextContent("response"))); + Assert.Throws("id", () => new AdditionalDetailsResponseContent("\r\t\n ", new TextContent("response"))); + + Assert.Throws("response", () => new AdditionalDetailsResponseContent("id", null!)); + } + + [Fact] + public void Constructor_Roundtrips() + { + string id = "test-id"; + TextContent response = new("test-response"); + AdditionalDetailsResponseContent content = new(id, response); + + Assert.Same(id, content.Id); + Assert.Same(response, content.Response); + } + + [Fact] + public void Serialization_Roundtrips() + { + var content = new AdditionalDetailsResponseContent("response123", new TextContent("This is my answer")); + + var json = JsonSerializer.Serialize(content, AIJsonUtilities.DefaultOptions); + var deserializedContent = JsonSerializer.Deserialize(json, AIJsonUtilities.DefaultOptions); + + Assert.NotNull(deserializedContent); + Assert.Equal(content.Id, deserializedContent.Id); + + TextContent originalResponse = Assert.IsType(content.Response); + TextContent deserializedResponse = Assert.IsType(deserializedContent.Response); + + Assert.Equal(originalResponse.Text, deserializedResponse.Text); + } +} diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs index fc4dac9cabb..8d0b5e62a1b 100644 --- a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs @@ -43,6 +43,7 @@ public void Serialization_DerivedTypes_Roundtrips() [ new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary { { "param1", 123 } })), new McpServerToolApprovalRequestContent("request123", new McpServerToolCallContent("call123", "myTool", "myServer")), + new AdditionalDetailsRequestContent("request123", new TextContent("I need more details. Where would you like to fly from and to?")), ]; var serializedContents = JsonSerializer.Serialize(contents, TestJsonSerializerContext.Default.UserInputRequestContentArray); diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs index 2442e57272d..3916546e437 100644 --- a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs @@ -41,6 +41,7 @@ public void Serialization_DerivedTypes_Roundtrips() [ new FunctionApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName")), new McpServerToolApprovalResponseContent("request123", true), + new AdditionalDetailsResponseContent("response123", new TextContent("I would like to fly from New York to San Francisco.")) ]; var serializedContents = JsonSerializer.Serialize(contents, TestJsonSerializerContext.Default.UserInputResponseContentArray); From 416190d87fd0f7fea88182d232e2c8b160e080cc Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:14:34 +0000 Subject: [PATCH 2/8] Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Contents/AdditionalDetailsRequestContent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs index 4f54a2f4218..9382760aadb 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs @@ -32,7 +32,7 @@ public AdditionalDetailsRequestContent(string id, AIContent request) /// /// Creates a to provide the requested additional details. /// - /// The containing the requestd additional details. + /// The containing the requested additional details. /// The representing the response. public AdditionalDetailsResponseContent CreateResponse(AIContent response) => new(Id, response); } From 6ec704b9479c5b58994d6e426e0ff5e929a1f49a Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:14:51 +0000 Subject: [PATCH 3/8] Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Contents/AdditionalDetailsResponseContent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs index 6f90e99a74b..a74f4a5d620 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.AI; /// Represents a response for additional details request from the user. /// [Experimental("MEAI001")] -public class AdditionalDetailsResponseContent : UserInputResponseContent +public sealed class AdditionalDetailsResponseContent : UserInputResponseContent { /// /// Initializes a new instance of the class. From 08e3a7365fef9b3e1572180e8e59804320c67dfc Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:15:19 +0000 Subject: [PATCH 4/8] Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Contents/AdditionalDetailsRequestContent.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs index 9382760aadb..939e0a230b8 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs @@ -18,6 +18,9 @@ public sealed class AdditionalDetailsRequestContent : UserInputRequestContent /// /// The ID that uniquely identifies the additional details request/response pair. /// The additional details request. + /// is . + /// is empty or composed entirely of whitespace. + /// is . public AdditionalDetailsRequestContent(string id, AIContent request) : base(id) { From 335acbf5c95b3404a505f65532e0fa470f878c48 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:15:25 +0000 Subject: [PATCH 5/8] Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Contents/AdditionalDetailsResponseContent.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs index a74f4a5d620..84ed6319e72 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs @@ -18,6 +18,9 @@ public sealed class AdditionalDetailsResponseContent : UserInputResponseContent /// /// The ID that uniquely identifies the additional details request/response pair. /// The additional details response. + /// is . + /// is empty or composed entirely of whitespace. + /// is . public AdditionalDetailsResponseContent(string id, AIContent response) : base(id) { From fa95e3a452f0347c9610b3d33a430d954828b310 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh Date: Wed, 26 Nov 2025 18:21:33 +0000 Subject: [PATCH 6/8] address pr review comment --- .../Contents/AdditionalDetailsRequestContentTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs index da6c42631ed..247137dd288 100644 --- a/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs +++ b/test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AdditionalDetailsRequestContentTests.cs @@ -44,6 +44,7 @@ public void CreateResponse_ReturnsExpectedResponse() Assert.NotNull(textResponse); Assert.Same(id, textResponse.Id); Assert.Same(response, textResponse.Response); + Assert.Throws("response", () => content.CreateResponse(null!)); } [Fact] From 65f626bcbdfc9f9adc5a92035ab23672021db17d Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:25:06 +0000 Subject: [PATCH 7/8] Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Contents/AdditionalDetailsRequestContent.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs index 939e0a230b8..da5e627a7d3 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs @@ -37,5 +37,6 @@ public AdditionalDetailsRequestContent(string id, AIContent request) /// /// The containing the requested additional details. /// The representing the response. + /// is . public AdditionalDetailsResponseContent CreateResponse(AIContent response) => new(Id, response); } From fc6a2db30eeb5096ec6f6e7ea41174c5cea61d37 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh Date: Wed, 26 Nov 2025 18:56:41 +0000 Subject: [PATCH 8/8] fix compilation issues --- .../Contents/AdditionalDetailsRequestContent.cs | 1 + .../Contents/AdditionalDetailsResponseContent.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs index 939e0a230b8..939dad01005 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsRequestContent.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs index 84ed6319e72..a20980c2aeb 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AdditionalDetailsResponseContent.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics;