375 references to FunctionCallContent
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvocationContext.cs (1)
42get => field ??= new(string.Empty, _nopFunction.Name, EmptyReadOnlyDictionary<string, object?>.Instance);
Microsoft.Extensions.AI.Abstractions (2)
Contents\FunctionCallContent.cs (1)
100return new FunctionCallContent(callId, name, arguments)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Microsoft.Extensions.AI.Abstractions.Tests (34)
ChatCompletion\ChatMessageTests.cs (2)
148new FunctionCallContent("callId1", "fc1"), 271new FunctionCallContent("function-id", "plugin-name-function-name", new Dictionary<string, object?> { ["parameter"] = "argument" }),
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (1)
1127new() { Contents = [new FunctionCallContent("fc1", "SearchTool", new Dictionary<string, object?> { ["q"] = "test" })] },
ChatCompletion\ChatResponseUpdateTests.cs (3)
94new FunctionCallContent("callId1", "fc1"), 123new FunctionCallContent("callId1", "fc1"), 186new FunctionCallContent("callId1", "fc1"),
Contents\AIContentTests.cs (3)
72new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } }), 77new ToolApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })), 78new ToolApprovalResponseContent("request123", approved: true, new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
Contents\FunctionCallContentTests.cs (7)
21FunctionCallContent c = new("callId1", "name"); 39FunctionCallContent c = new("id", "name", args); 52FunctionCallContent c = new("callId1", "name"); 87var sut = new FunctionCallContent("callId1", "functionName", new Dictionary<string, object?> { ["key"] = "value" }) 148var original = new FunctionCallContent("callId1", "functionName") { InformationalOnly = informationalOnly }; 164var sut = new FunctionCallContent("callId1", "functionName", new Dictionary<string, object?> { ["key"] = "value" }) { Exception = ex }; 412var content = new FunctionCallContent("call123", "myFunction")
Contents\InputRequestContentTests.cs (1)
40new ToolApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
Contents\InputResponseContentTests.cs (1)
39new ToolApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName")),
Contents\ToolApprovalRequestContentTests.cs (7)
16Assert.Throws<ArgumentNullException>("requestId", () => new ToolApprovalRequestContent(null!, new FunctionCallContent("FCC1", "TestFunction"))); 17Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalRequestContent("", new FunctionCallContent("FCC1", "TestFunction"))); 18Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalRequestContent("\r\t\n ", new FunctionCallContent("FCC1", "TestFunction"))); 24new FunctionCallContent("FCC1", "TestFunction", new Dictionary<string, object?> { { "param1", 123 } }), 65FunctionCallContent functionCall = new("FCC1", "TestFunction"); 137var content = new ToolApprovalRequestContent("req-1", new FunctionCallContent("call1", "Func")); 146var content = new ToolApprovalRequestContent("req-1", new FunctionCallContent("call1", "Func"))
Contents\ToolApprovalResponseContentTests.cs (5)
16Assert.Throws<ArgumentNullException>("requestId", () => new ToolApprovalResponseContent(null!, true, new FunctionCallContent("FCC1", "TestFunction"))); 17Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalResponseContent("", true, new FunctionCallContent("FCC1", "TestFunction"))); 18Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalResponseContent("\r\t\n ", true, new FunctionCallContent("FCC1", "TestFunction"))); 24new FunctionCallContent("FCC1", "TestFunction", new Dictionary<string, object?> { { "param1", 123 } }), 82var content = new ToolApprovalResponseContent("request123", true, new FunctionCallContent("call123", "functionName"))
Contents\ToolCallContentTests.cs (1)
56new FunctionCallContent("call1", "function1", new Dictionary<string, object?> { { "param1", 123 } }),
Generated\361d1da7f942c932\TestJsonSerializerContext.FunctionCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Realtime\RealtimeConversationItemTests.cs (1)
57var functionCall = new FunctionCallContent("call_1", "myFunc");
SpeechToText\SpeechToTextResponseUpdateTests.cs (1)
64new FunctionCallContent("callId1", "fc1"),
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.FunctionCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
ScenarioRunResultTests.cs (1)
219var functionCall = new FunctionCallContent(
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
118message.Contents.Add(new FunctionCallContent(id, toolCallParsed.Name!, toolCallParsed.Arguments is { } args ? new ReadOnlyDictionary<string, object?>(args) : null));
Microsoft.Extensions.AI.OpenAI (1)
OpenAIRealtimeClientSession.cs (1)
1117[new FunctionCallContent(funcCallItem.CallId ?? string.Empty, funcCallItem.FunctionName, arguments)],
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIChatClientTests.cs (2)
1472new FunctionCallContent("12345", "SayHello"), 1473new FunctionCallContent("12346", "SayHi"),
OpenAIConversionTests.cs (10)
731new FunctionCallContent("callid123", "SomeFunction", new Dictionary<string, object?> 800new FunctionCallContent("callid123", "SomeFunction", new Dictionary<string, object?> 1220new FunctionCallContent("call123", "TestFunction", new Dictionary<string, object?> { ["param"] = "value" }) 1591new FunctionCallContent("process_data", "ProcessComplexData", complexArgs) 1774var functionCallContent = new FunctionCallContent("call-123", "GetWeather", new Dictionary<string, object?> 1812var functionCall1 = new FunctionCallContent("call-1", "Function1", new Dictionary<string, object?> { ["param1"] = "value1" }); 1813var functionCall2 = new FunctionCallContent("call-2", "Function2", new Dictionary<string, object?> { ["param2"] = "value2" }); 1846new FunctionCallContent("call-123", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" }), 2087new FunctionCallContent("call-123", "TestFunction", new Dictionary<string, object?> { ["param"] = "value" }) 2122new FunctionCallContent("call-456", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" })
Microsoft.Extensions.AI.Stabilization.Tests (1)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.FunctionCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Microsoft.Extensions.AI.Tests (320)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
201new FunctionCallContent("callid123", "get_data"),
ChatCompletion\DistributedCachingChatClientTest.cs (4)
52Contents = [new FunctionCallContent("someCallId", "functionName", new Dictionary<string, object?> 255new FunctionCallContent("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" }), 266Contents = [new FunctionCallContent("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" })], 316new() { Role = ChatRole.Assistant, Contents = [new FunctionCallContent("callId1", "separator")] },
ChatCompletion\FunctionInvocationContextTests.cs (1)
55FunctionCallContent callContent = new(string.Empty, string.Empty, new Dictionary<string, object?>());
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (165)
41new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 48new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 49new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 77new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 84new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 85new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 124new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 133new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")) 137new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 175new FunctionCallContent("callId1", "Func1"), 176new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }) 184new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 185new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 220new FunctionCallContent("callId1", "Func1"), 221new FunctionCallContent("callId2", "Unknown"), 229new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 230new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Unknown")) 259new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 260new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 264new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 265new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 272new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 283new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 311new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 312new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 316new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 317new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 325new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 336new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 363new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 367new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 371new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 375new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 382new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]) { MessageId = "resp1" }, 383new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]) { MessageId = "resp2" }, 394new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]) { MessageId = "resp1" }, 395new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]) { MessageId = "resp2" }, 422new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 423new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 427new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")), 428new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 435new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 450new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 481new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 482new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 486new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")), 487new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 494new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 506new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 514new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 545new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 546new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 550new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) 554new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 564new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 579new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 611new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 612new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })), 613new ToolApprovalRequestContent("ficc_callId3", new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } })) 617new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) { Reason = "Custom rejection for Func1" }, 618new ToolApprovalResponseContent("ficc_callId2", false, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })), 619new ToolApprovalResponseContent("ficc_callId3", true, new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } })) 628new FunctionCallContent("callId1", "Func1"), 629new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }), 630new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } }) 649new FunctionCallContent("callId1", "Func1"), 650new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }), 651new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } }) 666new FunctionCallContent("callId1", "Func1"), 667new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }), 668new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } }) 703new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 707new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) 717new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 731new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 761new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 762new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 766new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 767new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 774new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 780new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } })]), 785new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 789new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } })) 815new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 816new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 820new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 821new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 823new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 827new ToolApprovalRequestContent("ficc_callId3", new FunctionCallContent("callId3", "Func1")), 831new ToolApprovalResponseContent("ficc_callId3", true, new FunctionCallContent("callId3", "Func1")), 838new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 840new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "Func1")]), 851new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "Func1")]), 875var requestFcc = new FunctionCallContent("callId1", "Func1"); 876var responseFcc = new FunctionCallContent("callId1", "Func1"); 945var request1Fcc = new FunctionCallContent("callId1", "Func1"); 946var response1Fcc = new FunctionCallContent("callId1", "Func1") { InformationalOnly = true }; 948var request2Fcc = new FunctionCallContent("callId2", "Func1"); 1040new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1049new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1059new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1086new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 1116new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1117new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 1124new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1135new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1162new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1163new ToolApprovalResponseContent("ficc_callId2", true, new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })) 1179new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 1206new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1228new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1256new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1276new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1302new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 1306new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1318new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1330new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1357new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 1361new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1369new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1381new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1415new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")), 1419new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")), 1425new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1482yield return new ChatResponseUpdate(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]) { MessageId = messageId }; 1488new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }) 1562yield return new ChatResponseUpdate(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]) { MessageId = messageId }; 1567new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }) 1571yield return new ChatResponseUpdate(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func3")]) { MessageId = messageId }; 1644var alreadyProcessedFunctionCall = new FunctionCallContent("callId1", "Func1") { InformationalOnly = true }; 1688new ToolApprovalRequestContent("approval-request-id", new FunctionCallContent("function-call-id", "Func1")) 1692new ToolApprovalResponseContent("approval-request-id", true, new FunctionCallContent("function-call-id", "Func1")) 1704new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("function-call-id", "Func1")]) { MessageId = OriginalMessageId }, 1743new FunctionCallContent("callId1", "Func"), 1752new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")), 1782new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")), 1787new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func")), 1801new FunctionCallContent("callId1", "Func") 1825new FunctionCallContent("callId1", "Func") 1866new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")), 1871new ToolApprovalResponseContent("ficc_callId1", approveFuncCall, new FunctionCallContent("callId1", "Func")), 1884new FunctionCallContent("callId1", "Func") 1911new FunctionCallContent("callId1", "Func"), 2098FunctionCallContent fcc => new FunctionCallContent(fcc.CallId, fcc.Name, fcc.Arguments)
ChatCompletion\FunctionInvokingChatClientTests.cs (126)
94new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 96new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 98new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 128new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 130new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 132new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 161new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 163new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 165new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 194new FunctionCallContent("callId1", "Func1"), 195new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 34 } }), 196new FunctionCallContent("callId3", "Func2", arguments: new Dictionary<string, object?> { { "i", 56 } }), 206new FunctionCallContent("callId4", "Func2", arguments: new Dictionary<string, object?> { { "i", 78 } }), 207new FunctionCallContent("callId5", "Func1") 254new FunctionCallContent("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }), 255new FunctionCallContent("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }), 298new FunctionCallContent("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }), 299new FunctionCallContent("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }), 330new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 332new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 334new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 380new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]))); 393new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])).ToChatResponseUpdates()); 461new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]))); 474new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])).ToChatResponseUpdates()); 542new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]))); 555new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])).ToChatResponseUpdates()); 637new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId0", "VoidReturn")]), 645plan.Add(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{(i + 1)}", "VoidReturn")])); 668var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{capturedOptions.Count}", "Func1")]); 712var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{capturedOptions.Count}", "Func1")]); 759var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]); 804var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]); 960assistantMessage.Contents.Add(new FunctionCallContent(callId, "Func", 984new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]), 986new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 988new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]), 1021new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1043new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 1100new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 1192new() { Contents = [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["text"] = "Input 1" })] }, 1193new() { Contents = [new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["text"] = "Input 2" })] } 1245new(ChatRole.Assistant, [new FunctionCallContent($"callId{chatContents.Count()}", "Func1")]) : 1294new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["i"] = 41 })]), 1296new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["i"] = 42 })]), 1304new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "Func1", new Dictionary<string, object?> { ["i"] = 43 })]), 1364new FunctionCallContent("callId1", "Search"), 1365new FunctionCallContent("callId2", "Search", new Dictionary<string, object?> { { "result", "birds" } }), 1366new FunctionCallContent("callId3", "Search"), 1412return new ChatResponse(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId-abc", "Func1")])) 1450new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 1480new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg"] = "value1" }), 1481new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["arg"] = "value2" }), 1533new FunctionCallContent("callId1", "UnknownFunc", new Dictionary<string, object?> { ["i"] = 1 }), 1534new FunctionCallContent("callId2", "KnownFunc", new Dictionary<string, object?> { ["i"] = 2 }) 1552new FunctionCallContent("callId1", "UnknownFunc", new Dictionary<string, object?> { ["i"] = 1 }), 1553new FunctionCallContent("callId2", "KnownFunc", new Dictionary<string, object?> { ["i"] = 2 }) 1580new(ChatRole.Assistant, [new FunctionCallContent("callId1", "DefOnly")]), 1610new FunctionCallContent("callId1", "Known"), 1611new FunctionCallContent("callId2", "DefOnly") 1645messages.Add(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])); 1682new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1741? new(ChatRole.Assistant, [new FunctionCallContent("call1", "Func1")]) 1793new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1835new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 1885new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "secret" })]), 1957new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 2006new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 2033var alreadyProcessedFunctionCall = new FunctionCallContent("callId1", "Func1") { InformationalOnly = true }; 2085var needsProcessing = new FunctionCallContent("callId1", "Func1") { InformationalOnly = false }; 2086var alreadyProcessed = new FunctionCallContent("callId2", "Func2") { InformationalOnly = true }; 2161return new ChatResponse(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])); 2329cloned.Add(new FunctionCallContent(fcc.CallId, fcc.Name, fcc.Arguments) 2389[new FunctionCallContent("callId1", "FunctionA")])]); 2396[new FunctionCallContent("callId2", "FunctionB")])]); 2412[new FunctionCallContent("callId1", "FunctionA")]); 2418[new FunctionCallContent("callId2", "FunctionB")]); 2483[new FunctionCallContent("callId1", "FunctionA")])]); 2490[new FunctionCallContent("callId2", "FunctionB")])]); 2506[new FunctionCallContent("callId1", "FunctionA")]); 2512[new FunctionCallContent("callId2", "FunctionB")]); 2590[new FunctionCallContent("callId1", "FunctionA")])]); 2596[new FunctionCallContent("callId2", "FunctionB")])]); 2611[new FunctionCallContent("callId1", "FunctionA")]); 2617[new FunctionCallContent("callId2", "FunctionB")]); 2688[new FunctionCallContent("callId1", "FunctionA")])]); 2696[new FunctionCallContent("callId2", "FunctionB"), 2697new FunctionCallContent("callId3", "AdditionalTool")])]); 2712[new FunctionCallContent("callId1", "FunctionA")]); 2718[new FunctionCallContent("callId2", "FunctionB"), 2719new FunctionCallContent("callId3", "AdditionalTool")]); 2792[new FunctionCallContent("callId1", "FunctionA")])]); 2798[new FunctionCallContent("callId2", "SharedName")])]); 2813[new FunctionCallContent("callId1", "FunctionA")]); 2819[new FunctionCallContent("callId2", "SharedName")]); 2890[new FunctionCallContent($"callId{callCount}", "FunctionA")])]); 2905[new FunctionCallContent($"callId{callCount}", "FunctionA")]); 2968[new FunctionCallContent("callId1", "FunctionA")])]); 2976[new FunctionCallContent("callId2", "FunctionB")])]); 2991[new FunctionCallContent("callId1", "FunctionA")]); 2997[new FunctionCallContent("callId2", "FunctionB")]); 3069[new FunctionCallContent("callId1", "FunctionA")])]); 3077[new FunctionCallContent("callId2", "FunctionB")])]); 3092[new FunctionCallContent("callId1", "FunctionA")]); 3098[new FunctionCallContent("callId2", "FunctionB")]); 3175[new FunctionCallContent("callId1", "FunctionA")])]); 3183[new FunctionCallContent("callId2", "FunctionB")])]); 3198[new FunctionCallContent("callId1", "FunctionA")]); 3204[new FunctionCallContent("callId2", "FunctionB")]); 3258new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "UnknownFunc")]), 3288new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 3324new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "TerminatingFunc")]), 3353new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 3362new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")) 3398new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")) 3402new ToolApprovalResponseContent("ficc_callId1", true, new FunctionCallContent("callId1", "Func1")) 3435new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")) 3439new ToolApprovalResponseContent("ficc_callId1", false, new FunctionCallContent("callId1", "Func1")) { Reason = "User denied" } 3474new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 3482new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 3538new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2")]), 3553new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1"), new FunctionCallContent("callId2", "Func2")]), 3607return new ChatResponse(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")])); 3618var response = new ChatResponse(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]));
ChatCompletion\ImageGeneratingChatClientTests.cs (8)
317[new FunctionCallContent(callId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" })]); 360[new FunctionCallContent(callId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" })]); 405"at-start" => [new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" }), 408new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" })], 410new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" }), 480"at-start" => [new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" }), 483new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" })], 485new FunctionCallContent(imageCallId, "GenerateImage", new Dictionary<string, object?> { ["prompt"] = "a cat" }),
ChatCompletion\OpenTelemetryChatClientTests.cs (4)
116new(ChatRole.Assistant, [new FunctionCallContent("12345", "GetPersonName")]), 408new FunctionCallContent("call-123", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" }), 424yield return new() { Contents = [new FunctionCallContent("call-123", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" })] }; 450new(ChatRole.Assistant, [new FunctionCallContent("call-456", "SearchFiles")]),
ChatReduction\MessageCountingChatReducerTests.cs (3)
128new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call1", "get_weather", new Dictionary<string, object?> { ["location"] = "Seattle" })]), 223new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call1", "func", null)]), 225new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call2", "func", null)]),
ChatReduction\SummarizingChatReducerTests.cs (3)
99new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call1", "get_weather"), new TestInputRequestContent("uir1")]), 188new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call1", "get_weather", new Dictionary<string, object?> { ["location"] = "Seattle" }), new TestInputRequestContent("uir2")]), 193new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("call2", "get_weather", new Dictionary<string, object?> { ["location"] = "New York" })]),
Generated\361d1da7f942c932\TestJsonSerializerContext.FunctionCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.FunctionCallContent((string)args[0], (string)args[1], (global::System.Collections.Generic.IDictionary<string, object>)args[2]),
Realtime\FunctionInvokingRealtimeClientTests.cs (3)
481new FunctionCallContent("call_a", "slow_func"), 482new FunctionCallContent("call_b", "slow_func"), 641var functionCallContent = new FunctionCallContent(callId, functionName, arguments);
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
602[new FunctionCallContent("call_123", "search", new Dictionary<string, object?> { ["query"] = "test" })],