23 instantiations of FunctionApprovalResponseContent
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionApprovalRequestContent.cs (1)
40public FunctionApprovalResponseContent CreateResponse(bool approved) => new(Id, approved, FunctionCall);
Microsoft.Extensions.AI.Abstractions.Tests (5)
Contents\FunctionApprovalResponseContentTests.cs (5)
16Assert.Throws<ArgumentNullException>("id", () => new FunctionApprovalResponseContent(null!, true, functionCall)); 17Assert.Throws<ArgumentException>("id", () => new FunctionApprovalResponseContent("", true, functionCall)); 18Assert.Throws<ArgumentException>("id", () => new FunctionApprovalResponseContent("\r\t\n ", true, functionCall)); 20Assert.Throws<ArgumentNullException>("functionCall", () => new FunctionApprovalResponseContent("id", true, null!)); 30FunctionApprovalResponseContent content = new(id, approved, functionCall);
Microsoft.Extensions.AI.Tests (17)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (17)
160new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 161new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 214new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 218new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 270new FunctionApprovalResponseContent("callId1", false, new FunctionCallContent("callId1", "Func1")), 271new FunctionApprovalResponseContent("callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 329new FunctionApprovalResponseContent("callId1", false, new FunctionCallContent("callId1", "Func1")), 330new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 393new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 394new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 447new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 448new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 458new FunctionApprovalResponseContent("callId3", true, new FunctionCallContent("callId3", "Func1")), 535new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 536new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 581new FunctionApprovalResponseContent("callId1", true, new FunctionCallContent("callId1", "Func1")), 582new FunctionApprovalResponseContent("callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
19 references to FunctionApprovalResponseContent
Microsoft.Extensions.AI (12)
ChatCompletion\FunctionInvokingChatClient.cs (12)
52/// responsible for responding to that approval request by sending a corresponding <see cref="FunctionApprovalResponseContent"/> in a subsequent 754/// Gets whether <paramref name="messages"/> contains any <see cref="FunctionApprovalRequestContent"/> or <see cref="FunctionApprovalResponseContent"/> instances. 757messages.Any(static m => m.Contents.Any(static c => c is FunctionApprovalRequestContent or FunctionApprovalResponseContent)); 1200/// 1. Remove all <see cref="FunctionApprovalRequestContent"/> and <see cref="FunctionApprovalResponseContent"/> from the <paramref name="originalMessages"/>. 1201/// 2. Recreate <see cref="FunctionCallContent"/> for any <see cref="FunctionApprovalResponseContent"/> that haven't been executed yet. 1202/// 3. Genreate failed <see cref="FunctionResultContent"/> for any rejected <see cref="FunctionApprovalResponseContent"/>. 1260List<FunctionApprovalResponseContent>? allApprovalResponses = null; 1289case FunctionApprovalResponseContent farc: 1347foreach (var approvalResponse in allApprovalResponses) 1379/// Extracts the <see cref="FunctionCallContent"/> from the provided <see cref="FunctionApprovalResponseContent"/> to recreate the original function call messages. 1585/// Execute the provided <see cref="FunctionApprovalResponseContent"/> and return the resulting <see cref="FunctionCallContent"/> 1680public FunctionApprovalResponseContent Response { get; set; }
Microsoft.Extensions.AI.Abstractions (5)
Contents\FunctionApprovalRequestContent.cs (3)
36/// Creates a <see cref="FunctionApprovalResponseContent"/> to indicate whether the function call is approved or rejected based on the value of <paramref name="approved"/>. 39/// <returns>The <see cref="FunctionApprovalResponseContent"/> representing the approval response.</returns> 40public FunctionApprovalResponseContent CreateResponse(bool approved) => new(Id, approved, FunctionCall);
Contents\FunctionApprovalResponseContent.cs (1)
17/// Initializes a new instance of the <see cref="FunctionApprovalResponseContent"/> class.
Contents\McpServerToolApprovalRequestContent.cs (1)
39/// <returns>The <see cref="FunctionApprovalResponseContent"/> representing the approval response.</returns>
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionApprovalRequestContentTests.cs (1)
47var response = content.CreateResponse(approved);
Contents\FunctionApprovalResponseContentTests.cs (1)
30FunctionApprovalResponseContent content = new(id, approved, functionCall);