1 write to Name
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
29Name = Throw.IfNull(name);
68 references to Name
Microsoft.Extensions.AI (17)
ChatCompletion\FunctionInvokingChatClient.cs (14)
1069LogFunctionNotFound(fcc.Name); 1080AIFunctionDeclaration? tool = FindTool(fcc.Name, options?.Tools, AdditionalTools); 1087LogNonInvocableFunction(fcc.Name); 1098LogFunctionNotFound(fcc.Name); 1258AIFunctionDeclaration? tool = FindTool(callContent.Name, options?.Tools, AdditionalTools); 1263LogFunctionNotFound(callContent.Name); 1267LogNonInvocableFunction(callContent.Name); 1308LogFunctionRequestedTermination(callContent.Name); 1353FunctionInvocationStatus.NotFound => $"Error: Requested function \"{result.CallContent.Name}\" not found.", 1665LogProcessingApprovalResponse(approvalResponse.FunctionCall.Name, approvalResponse.Approved); 1689LogFunctionRejected(m.Response.FunctionCall.Name, m.Response.Reason); 1813if (arf.Name == fcc.Name) 1872anyApprovalRequired |= FindTool(functionCall.Name, toolLists)?.GetService<ApprovalRequiredAIFunction>() is not null; 1894LogFunctionRequiresApproval(functionCall.Name);
ChatCompletion\ImageGeneratingChatClient.cs (2)
329_toolNames.Contains(functionCall.Name)) 334if (functionCall.Name != nameof(GetImagesForEdit))
ChatCompletion\OpenTelemetryChatClient.cs (1)
319Name = fcc.Name,
Microsoft.Extensions.AI.Abstractions (2)
Contents\FunctionCallContent.cs (2)
125$"{Name}({string.Join(", ", Arguments)})" : 126$"{Name}()";
Microsoft.Extensions.AI.Abstractions.Tests (16)
AssertExtensions.cs (2)
41Assert.Equal(expectedFunctionCall.Name, chatFunctionCall.Name);
ChatCompletion\ChatMessageTests.cs (1)
328Assert.Equal("plugin-name-function-name", functionCallContent.Name);
ChatCompletion\ChatResponseUpdateTests.cs (1)
149Assert.Equal("fc1", ((FunctionCallContent)result.Contents[2]).Name);
Contents\FunctionApprovalRequestContentTests.cs (2)
91Assert.Equal(content.FunctionCall.Name, deserializedContent.FunctionCall.Name);
Contents\FunctionApprovalResponseContentTests.cs (2)
57Assert.Equal(content.FunctionCall.Name, deserializedContent.FunctionCall.Name);
Contents\FunctionCallContentTests.cs (8)
27Assert.Equal("name", c.Name); 44Assert.Equal("name", c.Name); 125Assert.Equal("functionName", deserialized.Name); 138Assert.Equal("functionName", deserialized.Name); 154Assert.Equal(original.Name, deserialized.Name); 173Assert.Equal("functionName", deserializedSut.Name); 391Assert.Equal("functionName", content.Name);
Microsoft.Extensions.AI.Evaluation.Quality (3)
IntentResolutionEvaluator.cs (1)
123if (toolCalls.Any(t => !toolDefinitionNames.Contains(t.Name)))
TaskAdherenceEvaluator.cs (1)
122if (toolCalls.Any(t => !toolDefinitionNames.Contains(t.Name)))
ToolCallAccuracyEvaluator.cs (1)
131if (toolCalls.Any(t => !toolDefinitionNames.Contains(t.Name)))
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
76var toolCallJson = JsonSerializer.Serialize(new { fcc.CallId, fcc.Name, fcc.Arguments }, _jsonOptions);
Microsoft.Extensions.AI.OpenAI (4)
MicrosoftExtensionsAIChatExtensions.cs (2)
74.OfType<FunctionCallContent>().Select(c => ChatToolCall.CreateFunctionToolCall(c.CallId, c.Name, 159functionName: fcc.Name,
OpenAIChatClient.cs (1)
214ChatToolCall.CreateFunctionToolCall(fc.CallId, fc.Name, new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIResponsesChatClient.cs (1)
1161callContent.Name,
Microsoft.Extensions.AI.OpenAI.Tests (8)
OpenAIChatClientTests.cs (2)
1169Assert.Equal("GetPersonAge", fcc.Name); 1349Assert.Equal("GetPersonAge", fcc.Name);
OpenAIConversionTests.cs (3)
825Assert.Equal("functionName", Assert.IsType<FunctionCallContent>(message.Contents[2], exactMatch: false).Name); 856Assert.Equal("functionName", Assert.IsType<FunctionCallContent>(message.Contents[2], exactMatch: false).Name); 975Assert.Equal("TestFunction", functionCall.Name);
OpenAIResponseClientTests.cs (1)
5433Assert.Equal("get_weather", fcc.Name);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
41Assert.Equal(expectedFunctionCall.Name, chatFunctionCall.Name);
Microsoft.Extensions.AI.Tests (17)
ChatCompletion\DistributedCachingChatClientTest.cs (4)
819Assert.Equal(expectedFcc.Name, actualFcc.Name); 853Assert.Equal(expectedFcc.Name, actualFcc.Name);
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (5)
996Assert.Equal("Func1", functionCall.Name); 1004Assert.Equal("Func2", functionCall.Name); 1089Assert.Equal("Func1", approvalRequest1.FunctionCall.Name); 1097Assert.Equal("Func2", approvalRequest2.FunctionCall.Name); 1105Assert.Equal("Func3", approvalRequest3.FunctionCall.Name);
ChatCompletion\FunctionInvokingChatClientTests.cs (6)
1332Assert.Equal("Func1", context.CallContent.Name); 2318cloned.Add(new FunctionCallContent(fcc.CallId, fcc.Name, fcc.Arguments) 3105Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3115Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3211Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3222Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB"));
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
41Assert.Equal(expectedFunctionCall.Name, chatFunctionCall.Name);