33 instantiations of FunctionApprovalRequestContent
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (2)
1529updatedContent[i] = new FunctionApprovalRequestContent(fcc.CallId, fcc); 1593message.Contents[contentIndex] = new FunctionApprovalRequestContent(functionCall.CallId, functionCall);
Microsoft.Extensions.AI.Abstractions.Tests (10)
Contents\AIContentTests.cs (1)
73new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
Contents\FunctionApprovalRequestContentTests.cs (7)
18Assert.Throws<ArgumentNullException>("id", () => new FunctionApprovalRequestContent(null!, functionCall)); 19Assert.Throws<ArgumentException>("id", () => new FunctionApprovalRequestContent("", functionCall)); 20Assert.Throws<ArgumentException>("id", () => new FunctionApprovalRequestContent("\r\t\n ", functionCall)); 22Assert.Throws<ArgumentNullException>("functionCall", () => new FunctionApprovalRequestContent("id", null!)); 33FunctionApprovalRequestContent content = new(id, functionCall); 47FunctionApprovalRequestContent content = new(id, functionCall); 60var content = new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } }));
Contents\UserInputRequestContentTests.cs (2)
36UserInputRequestContent content = new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })); 44new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
Microsoft.Extensions.AI.Tests (21)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (21)
48new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 49new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 84new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 85new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 128new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 129new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 155new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 156new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 206new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 210new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 265new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 266new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 324new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 325new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 388new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 389new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 416new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } })) 442new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")), 443new FunctionApprovalRequestContent("callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 454new FunctionApprovalRequestContent("callId3", new FunctionCallContent("callId3", "Func1")), 568new FunctionApprovalRequestContent("callId1", new FunctionCallContent("callId1", "Func1")),
22 references to FunctionApprovalRequestContent
Microsoft.Extensions.AI (7)
ChatCompletion\FunctionInvokingChatClient.cs (7)
42/// attempt to invoke it directly. Instead, it will replace that <see cref="FunctionCallContent"/> with a <see cref="FunctionApprovalRequestContent"/> 748/// Gets whether <paramref name="messages"/> contains any <see cref="FunctionApprovalRequestContent"/> or <see cref="FunctionApprovalResponseContent"/> instances. 751messages.Any(static m => m.Contents.Any(static c => c is FunctionApprovalRequestContent or FunctionApprovalResponseContent)); 1227/// 1. Remove all <see cref="FunctionApprovalRequestContent"/> and <see cref="FunctionApprovalResponseContent"/> from the <paramref name="originalMessages"/>. 1310case FunctionApprovalRequestContent farc: 1515/// Replaces all <see cref="FunctionCallContent"/> with <see cref="FunctionApprovalRequestContent"/> and ouputs a new list if any of them were replaced. 1538/// Replaces all <see cref="FunctionCallContent"/> from <paramref name="messages"/> with <see cref="FunctionApprovalRequestContent"/>
Microsoft.Extensions.AI.Abstractions (4)
Contents\FunctionApprovalRequestContent.cs (1)
17/// Initializes a new instance of the <see cref="FunctionApprovalRequestContent"/> class.
Contents\UserInputRequestContent.cs (1)
16[JsonDerivedType(typeof(FunctionApprovalRequestContent), "functionApprovalRequest")]
Utilities\AIJsonUtilities.Defaults.cs (2)
54AddAIContentType(options, typeof(FunctionApprovalRequestContent), typeDiscriminatorId: "functionApprovalRequest", checkBuiltIn: false); 128[JsonSerializable(typeof(FunctionApprovalRequestContent))]
Microsoft.Extensions.AI.Abstractions.Tests (5)
Contents\FunctionApprovalRequestContentTests.cs (5)
33FunctionApprovalRequestContent content = new(id, functionCall); 47FunctionApprovalRequestContent content = new(id, functionCall); 60var content = new FunctionApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })); 63var deserializedContent = JsonSerializer.Deserialize<FunctionApprovalRequestContent>(json, AIJsonUtilities.DefaultOptions);
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (6)
818var approvalRequest1 = update.Contents.OfType<FunctionApprovalRequestContent>().First(); 826var approvalRequest2 = update.Contents.OfType<FunctionApprovalRequestContent>().First(); 834var approvalRequest3 = update.Contents.OfType<FunctionApprovalRequestContent>().First();