175 references to FunctionCallContent
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvocationContext.cs (1)
54
get => _callContent ??=
new
(string.Empty, _nopFunction.Name, EmptyReadOnlyDictionary<string, object?>.Instance);
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
97
return new
FunctionCallContent
(callId, name, arguments)
Microsoft.Extensions.AI.Abstractions.Tests (14)
ChatCompletion\ChatMessageTests.cs (2)
149
new
FunctionCallContent
("callId1", "fc1"),
272
new
FunctionCallContent
("function-id", "plugin-name-function-name", new Dictionary<string, object?> { ["parameter"] = "argument" }),
ChatCompletion\ChatResponseUpdateTests.cs (2)
94
new
FunctionCallContent
("callId1", "fc1"),
123
new
FunctionCallContent
("callId1", "fc1"),
Contents\FunctionApprovalRequestContentTests.cs (3)
14
FunctionCallContent functionCall =
new
("FCC1", "TestFunction");
29
FunctionCallContent functionCall =
new
("FCC1", "TestFunction");
43
FunctionCallContent functionCall =
new
("FCC1", "TestFunction");
Contents\FunctionApprovalResponseContentTests.cs (2)
14
FunctionCallContent functionCall =
new
("FCC1", "TestFunction");
29
FunctionCallContent functionCall =
new
("FCC1", "TestFunction");
Contents\FunctionCallContentTests.cs (4)
21
FunctionCallContent c =
new
("callId1", "name");
38
FunctionCallContent c =
new
("id", "name", args);
51
FunctionCallContent c =
new
("callId1", "name");
81
var sut = new
FunctionCallContent
("callId1", "functionName", new Dictionary<string, object?> { ["key"] = "value" }) { Exception = ex };
SpeechToText\SpeechToTextResponseUpdateTests.cs (1)
65
new
FunctionCallContent
("callId1", "fc1"),
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
990
new(ChatRole.Assistant, [new
FunctionCallContent
("abcd123", "GetMood")]),
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
118
message.Contents.Add(new
FunctionCallContent
(id, toolCallParsed.Name!, toolCallParsed.Arguments is { } args ? new ReadOnlyDictionary<string, object?>(args) : null));
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIChatClientTests.cs (2)
1436
new
FunctionCallContent
("12345", "SayHello"),
1437
new
FunctionCallContent
("12346", "SayHi"),
OpenAIConversionTests.cs (10)
95
new
FunctionCallContent
("callid123", "SomeFunction", new Dictionary<string, object?>
161
new
FunctionCallContent
("callid123", "SomeFunction", new Dictionary<string, object?>
364
new
FunctionCallContent
("call123", "TestFunction", new Dictionary<string, object?> { ["param"] = "value" })
469
new
FunctionCallContent
("process_data", "ProcessComplexData", complexArgs)
652
var functionCallContent = new
FunctionCallContent
("call-123", "GetWeather", new Dictionary<string, object?>
690
var functionCall1 = new
FunctionCallContent
("call-1", "Function1", new Dictionary<string, object?> { ["param1"] = "value1" });
691
var functionCall2 = new
FunctionCallContent
("call-2", "Function2", new Dictionary<string, object?> { ["param2"] = "value2" });
724
new
FunctionCallContent
("call-123", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" }),
966
new
FunctionCallContent
("call-123", "TestFunction", new Dictionary<string, object?> { ["param"] = "value" })
1001
new
FunctionCallContent
("call-456", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" })
Microsoft.Extensions.AI.Tests (145)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
207
new
FunctionCallContent
("callid123", "get_data"),
ChatCompletion\DistributedCachingChatClientTest.cs (4)
51
Contents = [new
FunctionCallContent
("someCallId", "functionName", new Dictionary<string, object?>
254
new
FunctionCallContent
("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" }),
265
Contents = [new
FunctionCallContent
("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" })],
315
new() { Role = ChatRole.Assistant, Contents = [new
FunctionCallContent
("callId1", "separator")] },
ChatCompletion\FunctionInvocationContextTests.cs (1)
55
FunctionCallContent callContent =
new
(string.Empty, string.Empty, new Dictionary<string, object?>());
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (84)
41
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
48
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
49
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
77
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
84
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
85
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
121
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
128
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
129
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
155
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
156
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
160
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
161
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
168
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
179
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
206
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
210
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
214
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
218
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
225
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]) { MessageId = "resp1" },
226
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]) { MessageId = "resp2" },
237
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]) { MessageId = "resp1" },
238
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]) { MessageId = "resp2" },
265
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
266
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
270
new FunctionApprovalResponseContent("callId1", false, new
FunctionCallContent
("callId1", "Func1")),
271
new FunctionApprovalResponseContent("callId2", false, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
278
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
293
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
324
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
325
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
329
new FunctionApprovalResponseContent("callId1", false, new
FunctionCallContent
("callId1", "Func1")),
330
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
337
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
349
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
357
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
388
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
389
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
393
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
394
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
401
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
407
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } })]),
412
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
416
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } }))
442
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
443
new FunctionApprovalRequestContent("callId2", new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
447
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
448
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
450
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
454
new FunctionApprovalRequestContent("callId3", new
FunctionCallContent
("callId3", "Func1")),
458
new FunctionApprovalResponseContent("callId3", true, new
FunctionCallContent
("callId3", "Func1")),
465
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
467
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "Func1")]),
478
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "Func1")]),
505
new FunctionApprovalRequestContent("callId1", new
FunctionCallContent
("callId1", "Func1")),
535
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
536
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
543
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
554
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
581
new FunctionApprovalResponseContent("callId1", true, new
FunctionCallContent
("callId1", "Func1")),
582
new FunctionApprovalResponseContent("callId2", true, new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
598
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1"), new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
643
yield return new ChatResponseUpdate(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]) { MessageId = messageId };
649
new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })
720
yield return new ChatResponseUpdate(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]) { MessageId = messageId };
725
new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })
729
yield return new ChatResponseUpdate(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func3")]) { MessageId = messageId };
ChatCompletion\FunctionInvokingChatClientTests.cs (50)
93
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]),
95
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
97
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
127
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]),
129
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
131
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
160
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]),
162
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
164
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
193
new
FunctionCallContent
("callId1", "Func1"),
194
new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 34 } }),
195
new
FunctionCallContent
("callId3", "Func2", arguments: new Dictionary<string, object?> { { "i", 56 } }),
205
new
FunctionCallContent
("callId4", "Func2", arguments: new Dictionary<string, object?> { { "i", 78 } }),
206
new
FunctionCallContent
("callId5", "Func1")
253
new
FunctionCallContent
("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }),
254
new
FunctionCallContent
("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }),
297
new
FunctionCallContent
("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }),
298
new
FunctionCallContent
("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }),
329
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]),
331
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
333
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
378
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
($"callId0", "VoidReturn")]),
386
plan.Add(new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
($"callId{(i + 1)}", "VoidReturn")]));
528
assistantMessage.Contents.Add(new
FunctionCallContent
(callId, "Func",
552
new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new
FunctionCallContent
("callId1", "Func1"), new TextContent("stuff")]),
554
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
556
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]),
589
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1")]),
611
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]),
667
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]),
742
new() { Contents = [new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["text"] = "Input 1" })] },
743
new() { Contents = [new
FunctionCallContent
("callId2", "Func1", new Dictionary<string, object?> { ["text"] = "Input 2" })] }
795
new(ChatRole.Assistant, [new
FunctionCallContent
($"callId{chatContents.Count()}", "Func1")]) :
844
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["i"] = 41 })]),
846
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId2", "Func1", new Dictionary<string, object?> { ["i"] = 42 })]),
854
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId3", "Func1", new Dictionary<string, object?> { ["i"] = 43 })]),
914
new
FunctionCallContent
("callId1", "Search"),
915
new
FunctionCallContent
("callId2", "Search", new Dictionary<string, object?> { { "result", "birds" } }),
916
new
FunctionCallContent
("callId3", "Search"),
962
return new ChatResponse(new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId-abc", "Func1")]))
1000
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]),
1030
new
FunctionCallContent
("callId1", "Func1", new Dictionary<string, object?> { ["arg"] = "value1" }),
1031
new
FunctionCallContent
("callId2", "Func1", new Dictionary<string, object?> { ["arg"] = "value2" }),
1083
new
FunctionCallContent
("callId1", "UnknownFunc", new Dictionary<string, object?> { ["i"] = 1 }),
1084
new
FunctionCallContent
("callId2", "KnownFunc", new Dictionary<string, object?> { ["i"] = 2 })
1102
new
FunctionCallContent
("callId1", "UnknownFunc", new Dictionary<string, object?> { ["i"] = 1 }),
1103
new
FunctionCallContent
("callId2", "KnownFunc", new Dictionary<string, object?> { ["i"] = 2 })
1130
new(ChatRole.Assistant, [new
FunctionCallContent
("callId1", "DefOnly")]),
1160
new
FunctionCallContent
("callId1", "Known"),
1161
new
FunctionCallContent
("callId2", "DefOnly")
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
109
new(ChatRole.Assistant, [new
FunctionCallContent
("12345", "GetPersonName")]),
ChatReduction\MessageCountingChatReducerTests.cs (3)
128
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("call1", "get_weather", new Dictionary<string, object?> { ["location"] = "Seattle" })]),
223
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("call1", "func", null)]),
225
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("call2", "func", null)]),
ChatReduction\SummarizingChatReducerTests.cs (1)
95
new ChatMessage(ChatRole.Assistant, [new
FunctionCallContent
("call1", "get_weather", new Dictionary<string, object?> { ["location"] = "Seattle" })]),