60 references to FunctionCallContent
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvocationContext.cs (1)
54get => _callContent ??= new(string.Empty, _nopFunction.Name, EmptyReadOnlyDictionary<string, object?>.Instance);
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
97return new FunctionCallContent(callId, name, arguments)
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatMessageTests.cs (2)
146new FunctionCallContent("callId1", "fc1"), 255new FunctionCallContent("function-id", "plugin-name-function-name", new Dictionary<string, object?> { ["parameter"] = "argument" }),
ChatCompletion\ChatResponseUpdateTests.cs (2)
94new FunctionCallContent("callId1", "fc1"), 123new FunctionCallContent("callId1", "fc1"),
Contents\FunctionCallContentTests..cs (4)
21FunctionCallContent c = new("callId1", "name"); 38FunctionCallContent c = new("id", "name", args); 51FunctionCallContent c = new("callId1", "name"); 81var sut = new FunctionCallContent("callId1", "functionName", new Dictionary<string, object?> { ["key"] = "value" }) { Exception = ex };
SpeechToText\SpeechToTextResponseUpdateTests.cs (1)
65new FunctionCallContent("callId1", "fc1"),
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
990new(ChatRole.Assistant, [new FunctionCallContent("abcd123", "GetMood")]),
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.Tests (4)
OpenAIChatClientTests.cs (2)
1454new FunctionCallContent("12345", "SayHello"), 1455new FunctionCallContent("12346", "SayHi"),
OpenAIConversionTests.cs (2)
92new FunctionCallContent("callid123", "SomeFunction", new Dictionary<string, object?> 144new FunctionCallContent("callid123", "SomeFunction", new Dictionary<string, object?>
Microsoft.Extensions.AI.Tests (43)
ChatCompletion\DistributedCachingChatClientTest.cs (4)
51Contents = [new FunctionCallContent("someCallId", "functionName", new Dictionary<string, object?> 254new FunctionCallContent("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" }), 265Contents = [new FunctionCallContent("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" })], 315new() { Role = ChatRole.Assistant, Contents = [new FunctionCallContent("callId1", "separator")] },
ChatCompletion\FunctionInvocationContextTests.cs (1)
55FunctionCallContent callContent = new(string.Empty, string.Empty, new Dictionary<string, object?>());
ChatCompletion\FunctionInvokingChatClientTests.cs (37)
88new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 90new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 92new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 121new FunctionCallContent("callId1", "Func1"), 122new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 34 } }), 123new FunctionCallContent("callId3", "Func2", arguments: new Dictionary<string, object?> { { "i", 56 } }), 133new FunctionCallContent("callId4", "Func2", arguments: new Dictionary<string, object?> { { "i", 78 } }), 134new FunctionCallContent("callId5", "Func1") 181new FunctionCallContent("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }), 182new FunctionCallContent("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }), 225new FunctionCallContent("callId1", "Func", arguments: new Dictionary<string, object?> { { "arg", "hello" } }), 226new FunctionCallContent("callId2", "Func", arguments: new Dictionary<string, object?> { { "arg", "world" } }), 257new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 259new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 261new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]), 306new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId0", "VoidReturn")]), 314plan.Add(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{(i + 1)}", "VoidReturn")])); 456assistantMessage.Contents.Add(new FunctionCallContent(callId, "Func", 480new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]), 482new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]), 484new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]), 517new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]), 539new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 595new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 670new() { Contents = [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["text"] = "Input 1" })] }, 671new() { Contents = [new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["text"] = "Input 2" })] } 723new(ChatRole.Assistant, [new FunctionCallContent($"callId{chatContents.Count()}", "Func1")]) : 772new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["i"] = 41 })]), 774new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["i"] = 42 })]), 782new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "Func1", new Dictionary<string, object?> { ["i"] = 43 })]), 842new FunctionCallContent("callId1", "Search"), 843new FunctionCallContent("callId2", "Search", new Dictionary<string, object?> { { "result", "birds" } }), 844new FunctionCallContent("callId3", "Search"), 890return new ChatResponse(new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId-abc", "Func1")])) 928new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]), 958new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg"] = "value1" }), 959new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["arg"] = "value2" }),
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
112new(ChatRole.Assistant, [new FunctionCallContent("12345", "GetPersonName")]),