1 write to Name
Microsoft.Extensions.AI.Abstractions (1)
Contents\FunctionCallContent.cs (1)
29Name = Throw.IfNull(name);
67 references to Name
Microsoft.Extensions.AI (17)
ChatCompletion\FunctionInvokingChatClient.cs (14)
943LogFunctionNotFound(fcc.Name); 954AIFunctionDeclaration? tool = FindTool(fcc.Name, options?.Tools, AdditionalTools); 961LogNonInvocableFunction(fcc.Name); 972LogFunctionNotFound(fcc.Name); 1132AIFunctionDeclaration? tool = FindTool(callContent.Name, options?.Tools, AdditionalTools); 1137LogFunctionNotFound(callContent.Name); 1141LogNonInvocableFunction(callContent.Name); 1182LogFunctionRequestedTermination(callContent.Name); 1227FunctionInvocationStatus.NotFound => $"Error: Requested function \"{result.CallContent.Name}\" not found.", 1539LogProcessingApprovalResponse(approvalResponse.FunctionCall.Name, approvalResponse.Approved); 1563LogFunctionRejected(m.Response.FunctionCall.Name, m.Response.Reason); 1687if (arf.Name == fcc.Name) 1746anyApprovalRequired |= FindTool(functionCall.Name, toolLists)?.GetService<ApprovalRequiredAIFunction>() is not null; 1768LogFunctionRequiresApproval(functionCall.Name);
ChatCompletion\ImageGeneratingChatClient.cs (2)
329_toolNames.Contains(functionCall.Name)) 334if (functionCall.Name != nameof(GetImagesForEdit))
ChatCompletion\OpenTelemetryChatClient.cs (1)
265Name = 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)
70.OfType<FunctionCallContent>().Select(c => ChatToolCall.CreateFunctionToolCall(c.CallId, c.Name, 154functionName: fcc.Name,
OpenAIChatClient.cs (1)
202ChatToolCall.CreateFunctionToolCall(fc.CallId, fc.Name, new(JsonSerializer.SerializeToUtf8Bytes(
OpenAIResponsesChatClient.cs (1)
1085callContent.Name,
Microsoft.Extensions.AI.OpenAI.Tests (7)
OpenAIChatClientTests.cs (2)
1167Assert.Equal("GetPersonAge", fcc.Name); 1347Assert.Equal("GetPersonAge", fcc.Name);
OpenAIConversionTests.cs (3)
823Assert.Equal("functionName", Assert.IsType<FunctionCallContent>(message.Contents[2], exactMatch: false).Name); 854Assert.Equal("functionName", Assert.IsType<FunctionCallContent>(message.Contents[2], exactMatch: false).Name); 973Assert.Equal("TestFunction", functionCall.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)
999Assert.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); 2261cloned.Add(new FunctionCallContent(fcc.CallId, fcc.Name, fcc.Arguments) 3048Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3058Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3154Assert.Contains(result.Messages, m => m.Contents.OfType<FunctionApprovalRequestContent>().Any(frc => frc.FunctionCall.Name == "FunctionB")); 3165Assert.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);