42 references to new
Microsoft.Extensions.AI.Abstractions.Tests (3)
Contents\FunctionCallContentTests.cs (1)
99
AIFunctionArguments arguments =
new
()
Functions\AIFunctionArgumentsTests.cs (2)
17
var args = new
AIFunctionArguments
();
53
var args = new
AIFunctionArguments
Microsoft.Extensions.AI.Tests (39)
Functions\AIFunctionFactoryTest.cs (39)
46
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
49
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
52
AssertExtensions.EqualFunctionCallResults(3L, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
60
AssertExtensions.EqualFunctionCallResults("hello hello", await func.InvokeAsync(
new
() { ["a"] = "hello" }));
79
AssertExtensions.EqualFunctionCallResults("hello", await funcNull.InvokeAsync(
new
() { ["text"] = "hello" }));
88
AssertExtensions.EqualFunctionCallResults("custom", await funcValue.InvokeAsync(
new
() { ["text"] = "custom" }));
97
AssertExtensions.EqualFunctionCallResults(10, await funcInt.InvokeAsync(
new
() { ["x"] = 5 }));
131
var result = await func.InvokeAsync(
new
()
161
var result = await func.InvokeAsync(
new
()
181
var result = await func.InvokeAsync(
new
()
215
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
219
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
224
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
230
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
235
AssertExtensions.EqualFunctionCallResults(new int[] { 0, 1, 2, 3, 4 }, await func.InvokeAsync(
new
() { ["count"] = 5 }), JsonContext.Default.Options);
375
var result = (JsonElement?)await func.InvokeAsync(
new
()
405
AIFunctionArguments arguments =
new
() { ["myInteger"] = 42 };
465
var result = await func.InvokeAsync(
new
() { ["myInteger"] = 42 });
493
var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(
new
() { Services = sp });
604
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
606
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
627
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
629
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
649
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1 });
652
result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
686
Exception e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
689
e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
()
696
var result = await f.InvokeAsync(
new
()
720
var result = await f.InvokeAsync(
new
() { Services = sp1 });
727
AIFunctionArguments args1 =
new
() { ["a"] = 42 };
728
AIFunctionArguments args2 =
new
() { ["a"] = 43 };
760
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
783
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
806
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
829
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
852
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
875
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
898
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
922
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);