67 instantiations of ToolApprovalResponseContent
Microsoft.Extensions.AI.Abstractions (2)
Contents\ToolApprovalRequestContent.cs (1)
74new ToolApprovalResponseContent(RequestId, approved, ToolCall) { Reason = reason };
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
Microsoft.Extensions.AI.Abstractions.Tests (13)
Contents\AIContentTests.cs (2)
78new ToolApprovalResponseContent("request123", approved: true, new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })), 82new ToolApprovalResponseContent("request123", approved: true, new McpServerToolCallContent("call456", "myTool2", "myServer2")),
Contents\InputResponseContentTests.cs (2)
39new ToolApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName")), 40new ToolApprovalResponseContent("request456", true, new McpServerToolCallContent("call456", "myTool", "myServer")),
Contents\ToolApprovalResponseContentTests.cs (8)
16Assert.Throws<ArgumentNullException>("requestId", () => new ToolApprovalResponseContent(null!, true, new FunctionCallContent("FCC1", "TestFunction"))); 17Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalResponseContent("", true, new FunctionCallContent("FCC1", "TestFunction"))); 18Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalResponseContent("\r\t\n ", true, new FunctionCallContent("FCC1", "TestFunction"))); 19Assert.Throws<ArgumentNullException>("toolCall", () => new ToolApprovalResponseContent("id", true, null!)); 34ToolApprovalResponseContent content = new("req-1", true, toolCall); 40content = new("req-2", false, toolCall); 51var content = new ToolApprovalResponseContent("request123", true, toolCall) 82var content = new ToolApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName"))
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolApprovalResponseContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIResponsesChatClient.cs (2)
246message.Contents.Add(new ToolApprovalResponseContent( 549yield return CreateUpdate(new ToolApprovalResponseContent(
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIResponseClientTests.cs (2)
1756var codeInterpreterApproval = new ToolApprovalResponseContent("req-ci-1", true, new CodeInterpreterToolCallContent("ci-call-1")); 1757var imageGenApproval = new ToolApprovalResponseContent("req-ig-1", false, new ImageGenerationToolCallContent("ig-call-1"));
Microsoft.Extensions.AI.Stabilization.Tests (1)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.ToolApprovalResponseContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
Microsoft.Extensions.AI.Tests (45)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (41)
264new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 265new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 316new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 317new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 371new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 375new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 427new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")), 428new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 486new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")), 487new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 550new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) 554new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 617new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) { Reason = "Custom rejection for Func1" }, 618new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })), 619new ToolApprovalResponseContent("ficc_callId3", true, new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } })) 707new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) 766new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 767new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 820new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 821new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 831new ToolApprovalResponseContent("ficc_callId3", true, new FunctionCallContent("callId3", "Func1")), 898new ToolApprovalResponseContent("ficc_callId1", false, responseFcc), 970new ToolApprovalResponseContent("ficc_callId1", false, response1Fcc), 978new ToolApprovalResponseContent("ficc_callId2", false, request2Fcc), 1116new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1117new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 1162new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1163new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 1206new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1256new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1306new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1361new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1419new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1692new ToolApprovalResponseContent("approval-request-id", true, new FunctionCallContent("function-call-id", "Func1")) 1787new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func")), 1788new ToolApprovalResponseContent("callId2", true, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1809new ToolApprovalResponseContent("callId2", true, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1871new ToolApprovalResponseContent("ficc_callId1", approveFuncCall, new FunctionCallContent("callId1", "Func")), 1872new ToolApprovalResponseContent("callId2", approveMcpCall, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1894new ToolApprovalResponseContent("callId2", approveMcpCall, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 2108new ToolApprovalResponseContent(tarc.RequestId, tarc.Approved, (ToolCallContent)CloneFcc(tarc.ToolCall))
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
3402new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")) 3439new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) { Reason = "User denied" }
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
849new ToolApprovalResponseContent("approval-1", true, toolCall),
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolApprovalResponseContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ToolApprovalResponseContent((string)args[0], (bool)args[1], (global::Microsoft.Extensions.AI.ToolCallContent)args[2]),
187 references to ToolApprovalResponseContent
Microsoft.Extensions.AI (15)
ChatCompletion\FunctionInvokingChatClient.cs (14)
46/// responsible for responding to that approval request by sending a corresponding <see cref="ToolApprovalResponseContent"/> in a subsequent 862/// Gets whether <paramref name="messages"/> contains any <see cref="ToolApprovalRequestContent"/> or <see cref="ToolApprovalResponseContent"/> 871or ToolApprovalResponseContent { ToolCall: FunctionCallContent { InformationalOnly: false } }); 875/// (a <see cref="ToolApprovalRequestContent"/> or <see cref="ToolApprovalResponseContent"/> whose tool call is a 885or ToolApprovalResponseContent { ToolCall: FunctionCallContent { InformationalOnly: false } }); 1329/// 1. Remove all <see cref="ToolApprovalRequestContent"/> and <see cref="ToolApprovalResponseContent"/> from the <paramref name="originalMessages"/>. 1330/// 2. Recreate <see cref="FunctionCallContent"/> for any <see cref="ToolApprovalResponseContent"/> that haven't been executed yet. 1331/// 3. Generate failed <see cref="FunctionResultContent"/> for any rejected <see cref="ToolApprovalResponseContent"/>. 1429List<ToolApprovalResponseContent>? allApprovalResponses = null; 1458case ToolApprovalResponseContent tarc when tarc.ToolCall is FunctionCallContent { InformationalOnly: false }: 1516foreach (var approvalResponse in allApprovalResponses) 1572/// Extracts the <see cref="FunctionCallContent"/> from the provided <see cref="ToolApprovalResponseContent"/> to recreate the original function call messages. 1807/// Execute the provided <see cref="ToolApprovalResponseContent"/> and return the resulting <see cref="FunctionCallContent"/> 1916public ToolApprovalResponseContent Response { get; init; }
Common\OtelMessageSerializer.cs (1)
213case ToolApprovalResponseContent farespc when farespc.ToolCall is McpServerToolCallContent:
Microsoft.Extensions.AI.Abstractions (28)
Contents\AIContent.cs (1)
26[JsonDerivedType(typeof(ToolApprovalResponseContent), typeDiscriminator: "toolApprovalResponse")]
Contents\InputResponseContent.cs (1)
13[JsonDerivedType(typeof(ToolApprovalResponseContent), "toolApprovalResponse")]
Contents\ToolApprovalRequestContent.cs (4)
46/// <see cref="ToolApprovalResponseContent"/> still has to be supplied so the originating 68/// Creates a <see cref="ToolApprovalResponseContent"/> indicating whether the tool call is approved or rejected. 72/// <returns>The <see cref="ToolApprovalResponseContent"/> correlated with this request.</returns> 73public ToolApprovalResponseContent CreateResponse(bool approved, string? reason = null) =>
Contents\ToolApprovalResponseContent.cs (1)
16/// Initializes a new instance of the <see cref="ToolApprovalResponseContent"/> class.
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 24get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 78DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 88AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
348if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Microsoft.Extensions.AI.Abstractions.Tests (39)
AssertExtensions.cs (3)
58else if (expectedItem is ToolApprovalResponseContent expectedApprovalResponse) 60var actualApprovalResponse = (ToolApprovalResponseContent)chatItem;
Contents\InputResponseContentTests.cs (2)
87var approvalResponse = Assert.IsType<ToolApprovalResponseContent>(result);
Contents\ToolApprovalRequestContentTests.cs (2)
48var response = content.CreateResponse(approved: true); 69var response = content.CreateResponse(approved, reason);
Contents\ToolApprovalResponseContentTests.cs (11)
34ToolApprovalResponseContent content = new("req-1", true, toolCall); 51var content = new ToolApprovalResponseContent("request123", true, toolCall) 56AssertSerializationRoundtrips<ToolApprovalResponseContent>(content); 60static void AssertSerializationRoundtrips<T>(ToolApprovalResponseContent content) 67var deserializedContent = Assert.IsType<ToolApprovalResponseContent>(deserialized); 82var content = new ToolApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName")) 88var deserializedContent = JsonSerializer.Deserialize<ToolApprovalResponseContent>(json, AIJsonUtilities.DefaultOptions); 123var approvalResponse = Assert.IsType<ToolApprovalResponseContent>(result);
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
350if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolApprovalResponseContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 22get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 76DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 86AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting (21)
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 24get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 78DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 88AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
220if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (21)
Generated\361d1da7f942c932\JsonContext.ToolApprovalResponseContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 24get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 78DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 80Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 88AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
216if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Microsoft.Extensions.AI.OpenAI (3)
OpenAIRealtimeClientSession.cs (1)
657if (firstContent is ToolApprovalResponseContent approvalResponse)
OpenAIResponsesChatClient.cs (2)
1320ToolApprovalResponseContent { ToolCall: McpServerToolCallContent } toolResp => ResponseItem.CreateMcpApprovalResponseItem(toolResp.RequestId, toolResp.Approved), 1410case ToolApprovalResponseContent toolResp when toolResp.ToolCall is McpServerToolCallContent:
Microsoft.Extensions.AI.OpenAI.Tests (13)
OpenAIConversionTests.cs (8)
1050ToolApprovalResponseContent? approvalResponse = updates[3].Contents.OfType<ToolApprovalResponseContent>().FirstOrDefault(); 1142Assert.Empty(updates[0].Contents.OfType<ToolApprovalResponseContent>()); 1147Assert.IsNotType<ToolApprovalResponseContent>(genericContent); 1363ToolApprovalResponseContent? approvalResponseContent = message.Contents.OfType<ToolApprovalResponseContent>().FirstOrDefault(); 1434Assert.Empty(message.Contents.OfType<ToolApprovalResponseContent>()); 1439Assert.IsNotType<ToolApprovalResponseContent>(genericContent);
OpenAIResponseClientTests.cs (2)
1756var codeInterpreterApproval = new ToolApprovalResponseContent("req-ci-1", true, new CodeInterpreterToolCallContent("ci-call-1")); 1757var imageGenApproval = new ToolApprovalResponseContent("req-ig-1", false, new ImageGenerationToolCallContent("ig-call-1"));
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (3)
58else if (expectedItem is ToolApprovalResponseContent expectedApprovalResponse) 60var actualApprovalResponse = (ToolApprovalResponseContent)chatItem;
Microsoft.Extensions.AI.Stabilization.Tests (21)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.GetJsonTypeInfo.g.cs (1)
122if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.ToolApprovalResponseContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 22get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 76DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 86AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Tests (26)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (2)
2107ToolApprovalResponseContent tarc => 2144.OfType<ToolApprovalResponseContent>()
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
230if (type == typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.ToolApprovalResponseContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>? _ToolApprovalResponseContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> ToolApprovalResponseContent 22get => _ToolApprovalResponseContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> Create_ToolApprovalResponseContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ToolApprovalResponseContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(bool), typeof(global::Microsoft.Extensions.AI.ToolCallContent)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ToolApprovalResponseContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Approved, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Approved", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 76DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 78Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).ToolCall, 86AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("ToolCall", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ToolCallContent), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ToolApprovalResponseContent)obj).Reason = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ToolApprovalResponseContent).GetProperty("Reason", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (3)
58else if (expectedItem is ToolApprovalResponseContent expectedApprovalResponse) 60var actualApprovalResponse = (ToolApprovalResponseContent)chatItem;