279 references to AIFunctionFactory
Aspire.Dashboard (6)
Model\Assistant\AssistantChatViewModel.cs (6)
162AIFunctionFactory.Create(dataContext.GetResourceGraphAsync), 163AIFunctionFactory.Create(dataContext.GetConsoleLogsAsync), 164AIFunctionFactory.Create(dataContext.GetTraceAsync), 165AIFunctionFactory.Create(dataContext.GetStructuredLogsAsync), 166AIFunctionFactory.Create(dataContext.GetTracesAsync), 167AIFunctionFactory.Create(dataContext.GetTraceStructuredLogsAsync)
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvocationContext.cs (1)
18private static readonly AIFunction _nopFunction = AIFunctionFactory.Create(() => { }, nameof(FunctionInvocationContext));
Microsoft.Extensions.AI.Abstractions (2)
Functions\AIFunctionFactoryOptions.cs (2)
79/// By default, the return value of invoking the method wrapped into an <see cref="AIFunction"/> by <see cref="AIFunctionFactory"/> 89/// method for <see cref="AIFunction"/> instances produced by <see cref="AIFunctionFactory"/> to wrap
Microsoft.Extensions.AI.Abstractions.Tests (19)
ChatCompletion\ChatOptionsTests.cs (4)
70AIFunctionFactory.Create(() => 42), 71AIFunctionFactory.Create(() => 43), 178AIFunctionFactory.Create(() => 42), 179AIFunctionFactory.Create(() => 43),
Contents\FunctionCallContentTests.cs (6)
111AIFunction function = AIFunctionFactory.Create((DayOfWeek[] a, double b, Guid c, Dictionary<string, string> d) => b, serializerOptions: TestJsonSerializerContext.Default.Options); 133AIFunction function = AIFunctionFactory.Create((DayOfWeek[] a, double b, Guid c, Dictionary<string, string> d) => b, serializerOptions: TestJsonSerializerContext.Default.Options); 141var ex = Assert.Throws<NotSupportedException>(() => AIFunctionFactory.Create((CustomType arg) => { }, serializerOptions: TestJsonSerializerContext.Default.Options)); 145ex = Assert.Throws<NotSupportedException>(() => AIFunctionFactory.Create(() => new CustomType(), serializerOptions: TestJsonSerializerContext.Default.Options)); 166AIFunction function = AIFunctionFactory.Create((DayOfWeek[] a, double b, Guid c, Dictionary<string, string> d) => b, serializerOptions: TestJsonSerializerContext.Default.Options); 187AIFunction function = AIFunctionFactory.Create((DayOfWeek[] a, double b, Guid c, Dictionary<string, string> d) => b, serializerOptions: TestJsonSerializerContext.Default.Options);
Functions\ApprovalRequiredAIFunctionTests.cs (2)
21var inner = AIFunctionFactory.Create(() => 42); 37var inner = AIFunctionFactory.Create(() => "result");
Functions\DelegatingAIFunctionTests.cs (2)
23AIFunction expected = new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => 42)); 65AIFunction inner = AIFunctionFactory.Create(int () =>
Utilities\AIJsonSchemaTransformCacheTests.cs (1)
51AIFunction func = AIFunctionFactory.Create((int x, int y) => x + y);
Utilities\AIJsonUtilitiesTests.cs (4)
285AIFunction func = AIFunctionFactory.Create((int x, int y) => x + y, serializerOptions: options); 339AIFunction func = AIFunctionFactory.Create(( 360AIFunction func = AIFunctionFactory.Create((int a, int? b, long c, short d, float e, double f, decimal g) => { }, serializerOptions: options); 410AIFunction func = AIFunctionFactory.Create(([Range(1, 10)] int num, [StringLength(100, MinimumLength = 1)] string str) => num + str.Length, serializerOptions: options);
Microsoft.Extensions.AI.AzureAIInference.Tests (6)
AzureAIInferenceChatClientTests.cs (6)
328AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 412AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 501AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 576AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 1251Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 1338Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")],
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
AgentQualityEvaluatorTests.cs (2)
43Tools = [AIFunctionFactory.Create(GetOrders), AIFunctionFactory.Create(GetOrderStatus)]
Microsoft.Extensions.AI.Integration.Tests (46)
ChatClientIntegrationTests.cs (46)
246Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] 262Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 277Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 311AIFunction func = AIFunctionFactory.Create((string id = "defaultId") => id is "foo" ? secretNumber : -1, "GetSecretNumberById"); 343AIFunction func = AIFunctionFactory.Create((PersonRecord person) => person.Name is "John" ? secretNumber + person.Age : -1, "GetSecretNumberByPerson"); 375AIFunction func = AIFunctionFactory.Create((string[] items, string shopperId) => { shoppingCart.AddRange(items); shopperName = shopperId; }, "AddItemsToShoppingCart"); 459AIFunctionFactory.Create((int? i) => i, createOptions()), 460AIFunctionFactory.Create((string? s) => s, createOptions()), 461AIFunctionFactory.Create((int? i = null) => i, createOptions()), 462AIFunctionFactory.Create((bool b) => b, createOptions()), 463AIFunctionFactory.Create((double d) => d, createOptions()), 464AIFunctionFactory.Create((decimal d) => d, createOptions()), 465AIFunctionFactory.Create((float f) => f, createOptions()), 466AIFunctionFactory.Create((long l) => l, createOptions()), 467AIFunctionFactory.Create((char c) => c, createOptions()), 468AIFunctionFactory.Create((DateTime dt) => dt, createOptions()), 469AIFunctionFactory.Create((DateTimeOffset? dt) => dt, createOptions()), 470AIFunctionFactory.Create((TimeSpan ts) => ts, createOptions()), 472AIFunctionFactory.Create((DateOnly d) => d, createOptions()), 473AIFunctionFactory.Create((TimeOnly t) => t, createOptions()), 475AIFunctionFactory.Create((Uri uri) => uri, createOptions()), 476AIFunctionFactory.Create((Guid guid) => guid, createOptions()), 477AIFunctionFactory.Create((List<int> list) => list, createOptions()), 478AIFunctionFactory.Create((int[] arr, ComplexObject? co) => arr, createOptions()), 479AIFunctionFactory.Create((string p1 = "str", int p2 = 42, BindingFlags p3 = BindingFlags.IgnoreCase, char p4 = 'x') => p1, createOptions()), 480AIFunctionFactory.Create((string? p1 = "str", int? p2 = 42, BindingFlags? p3 = BindingFlags.IgnoreCase, char? p4 = 'x') => p1, createOptions()), 584Tools = [AIFunctionFactory.Create((string personName) => 606var tool = AIFunctionFactory.Create(() => 629var getSecretNumberTool = AIFunctionFactory.Create(() => 123, "GetSecretNumber"); 630var shieldsUpTool = AIFunctionFactory.Create(() => shieldsUp = true, "ShieldsUp"); 726var getTemperature = AIFunctionFactory.Create([Description("Gets the current temperature")] () => 765var getTemperature = AIFunctionFactory.Create([Description("Gets the current temperature")] () => 807var getTemperature = AIFunctionFactory.Create([Description("Gets the current temperature")] () => 897new ChatOptions { Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] }); 923new ChatOptions { Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] })) 1077Tools = [AIFunctionFactory.Create((int personId) => 1228var getWeather = AIFunctionFactory.Create(([Description("Gets weather for a city")] string city) => 1417var weatherTool = AIFunctionFactory.Create( 1425var translateTool = AIFunctionFactory.Create( 1433var mathTool = AIFunctionFactory.Create( 1501var translateTool = AIFunctionFactory.Create( 1509var weatherTool = AIFunctionFactory.Create( 1558var weatherTool = AIFunctionFactory.Create( 1634var weatherTool = AIFunctionFactory.Create( 1642var translateTool = AIFunctionFactory.Create( 1650var mathTool = AIFunctionFactory.Create(
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (3)
OllamaSharpChatClientIntegrationTests.cs (3)
46Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")], 66var stockPriceTool = AIFunctionFactory.Create([Description("Returns the stock price for a given ticker symbol")] ( 76var irrelevantTool = AIFunctionFactory.Create(() => { didCallIrrelevantTool = true; return 123; }, "GetSecretNumber");
Microsoft.Extensions.AI.OpenAI.Tests (18)
OpenAIChatClientTests.cs (8)
332Tools = [AIFunctionFactory.Create(() => 42, "GetPersonAge", "Gets the age of the specified person.")], 382AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 459AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 542AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 616AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person."); 729Tools = [AIFunctionFactory.Create((string name) => 42, "GetPersonAge")], 1141Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 1325Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")],
OpenAIConversionTests.cs (1)
22private static readonly AIFunction _testFunction = AIFunctionFactory.Create(
OpenAIResponseClientIntegrationTests.cs (7)
262Tools = [AIFunctionFactory.Create(() => { callCount++; return "5:43"; }, new AIFunctionFactoryOptions { Name = "GetCurrentTime" })] 356Tools = [AIFunctionFactory.Create(() => { callCount++; return "5:43"; }, new AIFunctionFactoryOptions { Name = "GetCurrentTime" })] 436Tools = [AIFunctionFactory.Create((int a, int b) => new TextContent($"The sum is {a + b}"), "AddNumbers", "Adds two numbers together")] 456Tools = [AIFunctionFactory.Create((string city) => new List<AIContent> 484Tools = [AIFunctionFactory.Create(() => new DataContent(ImageDataUri.GetImageDataUri(), "image/png"), "GetDotnetLogo", "Returns the .NET logo image")] 509Tools = [AIFunctionFactory.Create(() => new DataContent(ImageDataUri.GetPdfDataUri(), "application/pdf") { Name = "document.pdf" }, "GetDocument", "Returns a PDF document")] 532Tools = [AIFunctionFactory.Create(() => new List<AIContent>
OpenAIResponseClientTests.cs (2)
535Tools = [AIFunctionFactory.Create(() => 42, "GetPersonAge", "Gets the age of the specified person.")], 677AIFunction tool = AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.");
Microsoft.Extensions.AI.Tests (176)
ChatCompletion\FunctionInvocationContextTests.cs (1)
51AIFunction function = AIFunctionFactory.Create(() => { }, nameof(Properties_Roundtrip));
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (31)
24AIFunctionFactory.Create(() => "Result 1", "Func1")), 26AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 65new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 66AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 99AIFunction func1 = AIFunctionFactory.Create(() => "Result 1", "Func1"); 100AIFunction func2 = AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"); 145new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 146AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 196new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 197AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 255new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 256AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 314new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 315AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 378AIFunctionFactory.Create(() => "Result 1", "Func1"), 379new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 432AIFunctionFactory.Create(() => "Result 1", "Func1"), 433new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 503new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 504AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 558new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 559AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 588new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 589AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 634new ApprovalRequiredAIFunction(AIFunctionFactory.Create(() => "Result 1", "Func1")), 635AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 686AIFunctionFactory.Create(() => "Result 1", "Func1"), 687AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 758AIFunctionFactory.Create(() => "Result 1", "Func1"), 759new ApprovalRequiredAIFunction(AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2")), 760AIFunctionFactory.Create(() => "Result 3", "Func3"),
ChatCompletion\FunctionInvokingChatClientTests.cs (40)
72IList<AITool> additionalTools = [AIFunctionFactory.Create(() => "Additional Tool")]; 84AIFunctionFactory.Create(() => "Result 1", "Func1"), 85AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 86AIFunctionFactory.Create((int i) => { }, "VoidReturn"), 113new() { Tools = [AIFunctionFactory.Create(() => "Shouldn't be invoked", "ChatOptionsFunc")] } : 119AIFunctionFactory.Create(() => "Result 1", "Func1"), 120AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 121AIFunctionFactory.Create((int i) => { }, "VoidReturn"), 146Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")] 152AIFunctionFactory.Create(() => "Should never be invoked", "Func1"), 153AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 154AIFunctionFactory.Create((int i) => { }, "VoidReturn"), 183AIFunctionFactory.Create((int? i = 42) => "Result 1", "Func1"), 184AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 234AIFunctionFactory.Create(async (string arg) => 281AIFunctionFactory.Create(async (string arg) => 320AIFunctionFactory.Create(() => "Result 1", "Func1"), 321AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 322AIFunctionFactory.Create((int i) => { }, "VoidReturn"), 371AIFunctionFactory.Create(() => { actualCallCount++; }, "VoidReturn"), 413AIFunctionFactory.Create((bool shouldThrow, int callIndex) => 494AIFunctionFactory.Create(() => 543AIFunctionFactory.Create(() => "Result 1", "Func1"), 544AIFunctionFactory.Create((int i) => $"Result 2: {i}", "Func2"), 545AIFunctionFactory.Create((int i) => { }, "VoidReturn"), 582AIFunctionFactory.Create(string () => throw new InvalidOperationException("Oh no!"), "Func1"), 618Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")] 675Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")] 740Tools = [AIFunctionFactory.Create((string text) => $"Result for {text}", "Func1")] 798Tools = [AIFunctionFactory.Create(() => "doesn't matter", "Func1")] 837var function = AIFunctionFactory.Create(async (int i) => 912var function = AIFunctionFactory.Create((string? result = null) => 967Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")], 1028Tools = [AIFunctionFactory.Create((IServiceProvider actual) => 1061Tools = [AIFunctionFactory.Create(async (string arg, CancellationToken cancellationToken) => 1089Tools = [AIFunctionFactory.Create((int i) => $"Known: {i}", "KnownFunc")] 1141var declarationOnly = AIFunctionFactory.Create(() => "unused", "DefOnly").AsDeclarationOnly(); 1166var known = AIFunctionFactory.Create(() => { invoked++; return "OK"; }, "Known"); 1167var defOnly = AIFunctionFactory.Create(() => "unused", "DefOnly").AsDeclarationOnly(); 1224Tools = [AIFunctionFactory.Create(() => { }, "Func1")],
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
135AIFunctionFactory.Create((string personName) => personName, "GetPersonAge", "Gets the age of a person by name."), 140AIFunctionFactory.Create((string location) => "", "GetCurrentWeather", "Gets the current weather for a location.").AsDeclarationOnly(),
Functions\AIFunctionFactoryTest.cs (102)
31Assert.Throws<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!)); 32Assert.Throws<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!, target: new object())); 33Assert.Throws<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!, target: new object(), name: "myAiFunk")); 34Assert.Throws<ArgumentNullException>("target", () => AIFunctionFactory.Create(typeof(AIFunctionFactoryTest).GetMethod(nameof(InvalidArguments_Throw))!, (object?)null)); 36AIFunctionFactory.Create(typeof(AIFunctionFactoryTest).GetMethod(nameof(InvalidArguments_Throw))!, (Func<AIFunctionArguments, object>)null!)); 37Assert.Throws<ArgumentException>("method", () => AIFunctionFactory.Create(typeof(List<>).GetMethod("Add")!, new List<int>())); 45func = AIFunctionFactory.Create((string a) => a + " " + a); 48func = AIFunctionFactory.Create((string a, string b) => b + " " + a); 51func = AIFunctionFactory.Create((int a, long b) => a + b); 58AIFunction func = AIFunctionFactory.Create((string a = "test") => a + " " + a); 67AIFunction funcNull = AIFunctionFactory.Create(([DefaultValue(null)] string? text) => text ?? "was null"); 82AIFunction funcValue = AIFunctionFactory.Create(([DefaultValue("default")] string text) => text); 91AIFunction funcInt = AIFunctionFactory.Create(([DefaultValue(42)] int x) => x * 2); 100AIFunction funcBoth = AIFunctionFactory.Create(([DefaultValue(100)] int y = 50) => y); 113AIFunctionFactory.Create((string theParam) => theParam + " " + theParam), 114AIFunctionFactory.Create((string? theParam) => theParam + " " + theParam), 115AIFunctionFactory.Create((int theParam) => theParam * 2), 116AIFunctionFactory.Create((int? theParam) => theParam * 2), 129AIFunction func = AIFunctionFactory.Create((int x, int y, int z, int w, int u) => x + y + z + w + u); 158AIFunction func = AIFunctionFactory.Create((JsonElement param) => param, serializerOptions: options); 178AIFunction func = AIFunctionFactory.Create((JsonElement param) => param); 197AIFunction func = AIFunctionFactory.Create((int value1 = 1, string value2 = "2", CancellationToken cancellationToken = default) => 213func = AIFunctionFactory.Create(Task<string> (string a) => Task.FromResult(a + " " + a)); 217func = AIFunctionFactory.Create(ValueTask<string> (string a, string b) => new ValueTask<string>(b + " " + a)); 222func = AIFunctionFactory.Create(async Task (int a, long b) => { result = a + b; await Task.Yield(); }); 228func = AIFunctionFactory.Create(async ValueTask (int a, long b) => { result = a + b; await Task.Yield(); }); 233func = AIFunctionFactory.Create((int count) => SimpleIAsyncEnumerable(count), serializerOptions: JsonContext.Default.Options); 246func = AIFunctionFactory.Create(() => (IAsyncEnumerable<int>)new ThrowingAsyncEnumerable(), serializerOptions: JsonContext.Default.Options); 263func = AIFunctionFactory.Create(dotnetFunc); 269func = AIFunctionFactory.Create(dotnetFunc2); 275func = AIFunctionFactory.Create(dotnetFunc3); 289AIFunction func = AIFunctionFactory.Create(funcWithDisplayName); 295func = AIFunctionFactory.Create(funcWithBoth); 300func = AIFunctionFactory.Create(funcWithDisplayName, name: "explicit_name"); 304func = AIFunctionFactory.Create(funcWithDisplayName, new AIFunctionFactoryOptions()); 308func = AIFunctionFactory.Create(funcWithDisplayName, new AIFunctionFactoryOptions { Name = "options_name" }); 313func = AIFunctionFactory.Create(funcWithoutDisplayName); 338AIFunction func = AIFunctionFactory.Create(dotnetFunc, options); 363AIFunction func = AIFunctionFactory.Create( 387AIFunction func = AIFunctionFactory.Create( 407AIFunction func = AIFunctionFactory.Create(( 451AIFunction func = AIFunctionFactory.Create(( 483AIFunction func = AIFunctionFactory.Create( 501AIFunction func = AIFunctionFactory.Create( 512AIFunction func = AIFunctionFactory.Create( 523Assert.Throws<ArgumentException>("method", () => AIFunctionFactory.Create( 531AIFunction func = AIFunctionFactory.Create( 550AIFunction func = AIFunctionFactory.Create( 569AIFunction func = AIFunctionFactory.Create( 596AIFunction f = AIFunctionFactory.Create(([FromKeyedServices("key")] MyService service, int myInteger) => service.Value + myInteger, 619AIFunction f = AIFunctionFactory.Create(([FromKeyedServices(null!)] MyService service, int myInteger) => service.Value + myInteger, 642AIFunction f = AIFunctionFactory.Create(([FromKeyedServices("key")] MyService? service = null, int myInteger = 0) => 661AIFunction f = AIFunctionFactory.Create( 713AIFunction f = AIFunctionFactory.Create( 730AIFunction f = AIFunctionFactory.Create( 746AIFunction f = AIFunctionFactory.Create( 769AIFunction f = AIFunctionFactory.Create( 792AIFunction f = AIFunctionFactory.Create( 815AIFunction f = AIFunctionFactory.Create( 838AIFunction f = AIFunctionFactory.Create( 861AIFunction f = AIFunctionFactory.Create( 884AIFunction f = AIFunctionFactory.Create( 907AIFunction f = AIFunctionFactory.Create( 931AIFunctionFactory.Create(() => (AIContent)new TextContent("text")), 932AIFunctionFactory.Create(async () => (AIContent)new TextContent("text")), 933AIFunctionFactory.Create(async ValueTask<AIContent> () => (AIContent)new TextContent("text")), 934AIFunctionFactory.Create(() => new TextContent("text")), 935AIFunctionFactory.Create(async () => new TextContent("text")), 936AIFunctionFactory.Create(async ValueTask<AIContent> () => new TextContent("text")), 941AIFunctionFactory.Create(() => new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")), 942AIFunctionFactory.Create(async () => new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")), 943AIFunctionFactory.Create(async ValueTask<DataContent> () => new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")), 948AIFunctionFactory.Create(() => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 949AIFunctionFactory.Create(async () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 950AIFunctionFactory.Create(async ValueTask<IEnumerable<AIContent>> () => (IEnumerable<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 955AIFunctionFactory.Create(() => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 956AIFunctionFactory.Create(async () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 957AIFunctionFactory.Create(async ValueTask<AIContent[]> () => (AIContent[])[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 962AIFunctionFactory.Create(() => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 963AIFunctionFactory.Create(async () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 964AIFunctionFactory.Create(async ValueTask<List<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 969AIFunctionFactory.Create(() => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 970AIFunctionFactory.Create(async () => (IList<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 971AIFunctionFactory.Create(async ValueTask<IList<AIContent>> () => (List<AIContent>)[new TextContent("text"), new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")]), 988AIFunction f = AIFunctionFactory.Create((Guid g = default, StructWithDefaultCtor s = default) => g.ToString() + "," + s.Value.ToString(), serializerOptions: JsonContext.Default.Options); 999AIFunction f = AIFunctionFactory.Create( 1032AIFunction f = AIFunctionFactory.Create( 1062AIFunction f = AIFunctionFactory.Create(Add, serializerOptions: JsonContext.Default.Options); 1075AIFunctionDeclaration f = AIFunctionFactory.CreateDeclaration("something", "amazing", schema); 1081f = AIFunctionFactory.CreateDeclaration("other", null, default, schema); 1087Assert.Throws<ArgumentNullException>("name", () => AIFunctionFactory.CreateDeclaration(null!, "description", default)); 1188var tool = AIFunctionFactory.Create(DoSomething); 1207var tool1 = AIFunctionFactory.Create(FirstLocal); 1208var tool2 = AIFunctionFactory.Create(SecondLocal); 1224var tool = AIFunctionFactory.Create(lambda); 1243var tool1 = AIFunctionFactory.Create(lambda1); 1244var tool2 = AIFunctionFactory.Create(lambda2); 1258var tool = AIFunctionFactory.Create(Add); 1274var tool = AIFunctionFactory.Create(FetchDataAsync); 1291var tool = AIFunctionFactory.Create(DoSomething, name: "CustomName"); 1300var tool = AIFunctionFactory.Create(Add, serializerOptions: JsonContext.Default.Options); 1312var tool = AIFunctionFactory.Create(TestStaticMethod, null, serializerOptions: JsonContext.Default.Options);