44 instantiations of ApprovalRequiredAIFunction
Microsoft.Extensions.AI.Abstractions.Tests (4)
Functions\ApprovalRequiredAIFunctionTests.cs (3)
15Assert.Throws<ArgumentNullException>("innerFunction", () => new ApprovalRequiredAIFunction(null!)); 22var func = new ApprovalRequiredAIFunction(inner); 38var func = new ApprovalRequiredAIFunction(inner);
Functions\DelegatingAIFunctionTests.cs (1)
23AIFunction expected = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => 42));
Microsoft.Extensions.AI.Tests (40)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (35)
23new ApprovalRequiredAIFunction( 25new ApprovalRequiredAIFunction( 65new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 106additionalToolsRequireApproval ? new ApprovalRequiredAIFunction(func1) : func1, 113additionalToolsRequireApproval ? func2 : new ApprovalRequiredAIFunction(func2), 160new ApprovalRequiredAIFunction( 208new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 249new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 300new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 301new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 353new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 412new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 471new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 535new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 600new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 694new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 752new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 806new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 885new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 957new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1021new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1076new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1106new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1152new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1198Tools = [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"))], 1248Tools = [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"))], 1294Tools = [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"))], 1349Tools = [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"))], 1402new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => 1538new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 1636new ApprovalRequiredAIFunction( 1676new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 1725new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func")), 1768new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func")), 1852new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func")),
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
3040AIFunction functionB = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "FunctionB result", "FunctionB")); 3143AIFunction replacementFunctionB = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Replacement FunctionB result", "FunctionB")); 3344var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")); 3381var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")); 3418var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"));
12 references to ApprovalRequiredAIFunction
Microsoft.Extensions.AI (5)
ChatCompletion\FunctionInvokingChatClient.cs (5)
43/// Further, if a requested function is an <see cref="ApprovalRequiredAIFunction"/>, the <see cref="FunctionInvokingChatClient"/> will not 52/// even if they were not <see cref="ApprovalRequiredAIFunction"/> instances. If this is a concern, consider requesting that multiple tool call 362.Where(t => t.GetService<ApprovalRequiredAIFunction>() is not null) 584.Where(t => t.GetService<ApprovalRequiredAIFunction>() is not null) 811if (toolList[i].GetService<ApprovalRequiredAIFunction>() is not null)
Microsoft.Extensions.AI.Abstractions (1)
Functions\ApprovalRequiredAIFunction.cs (1)
19/// Initializes a new instance of the <see cref="ApprovalRequiredAIFunction"/> class.
Microsoft.Extensions.AI.Abstractions.Tests (3)
Functions\ApprovalRequiredAIFunctionTests.cs (2)
22var func = new ApprovalRequiredAIFunction(inner); 38var func = new ApprovalRequiredAIFunction(inner);
Functions\DelegatingAIFunctionTests.cs (1)
35Assert.Same(expected, actual.GetService<ApprovalRequiredAIFunction>());
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\FunctionInvokingChatClientTests.cs (3)
3344var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")); 3381var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")); 3418var approvalFunc = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1"));