43 references to new
Microsoft.Extensions.AI.Abstractions.Tests (3)
Contents\FunctionCallContentTests.cs (1)
182
AIFunctionArguments arguments =
new
()
Functions\AIFunctionArgumentsTests.cs (2)
17
var args = new
AIFunctionArguments
();
53
var args = new
AIFunctionArguments
Microsoft.Extensions.AI.Tests (40)
Functions\AIFunctionFactoryTest.cs (40)
47
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
50
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
53
AssertExtensions.EqualFunctionCallResults(3L, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
61
AssertExtensions.EqualFunctionCallResults("hello hello", await func.InvokeAsync(
new
() { ["a"] = "hello" }));
80
AssertExtensions.EqualFunctionCallResults("hello", await funcNull.InvokeAsync(
new
() { ["text"] = "hello" }));
89
AssertExtensions.EqualFunctionCallResults("custom", await funcValue.InvokeAsync(
new
() { ["text"] = "custom" }));
98
AssertExtensions.EqualFunctionCallResults(10, await funcInt.InvokeAsync(
new
() { ["x"] = 5 }));
132
var result = await func.InvokeAsync(
new
()
162
var result = await func.InvokeAsync(
new
()
182
var result = await func.InvokeAsync(
new
()
216
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
220
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
225
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
231
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
236
AssertExtensions.EqualFunctionCallResults(new int[] { 0, 1, 2, 3, 4 }, await func.InvokeAsync(
new
() { ["count"] = 5 }), JsonContext.Default.Options);
376
var result = (JsonElement?)await func.InvokeAsync(
new
()
406
AIFunctionArguments arguments =
new
() { ["myInteger"] = 42 };
466
var result = await func.InvokeAsync(
new
() { ["myInteger"] = 42 });
494
var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(
new
() { Services = sp });
605
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
607
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
628
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
630
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
650
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1 });
653
result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
687
Exception e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
690
e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
()
697
var result = await f.InvokeAsync(
new
()
721
var result = await f.InvokeAsync(
new
() { Services = sp1 });
728
AIFunctionArguments args1 =
new
() { ["a"] = 42 };
729
AIFunctionArguments args2 =
new
() { ["a"] = 43 };
761
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
784
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
807
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
830
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
853
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
876
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
899
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
923
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
1452
object? result = await func.InvokeAsync(
new
() { ["value"] = 21 });