3 overrides of Metadata
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
284public override AIFunctionMetadata Metadata { get; }
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionCallContentTests..cs (1)
254public override AIFunctionMetadata Metadata => new("NetTypeless")
Functions\AIFunctionTests.cs (1)
38public override AIFunctionMetadata Metadata => new("name");
58 references to Metadata
Microsoft.Extensions.AI (14)
ChatCompletion\FunctionInvokingChatClient.cs (10)
523AIFunction? function = options.Tools!.OfType<AIFunction>().FirstOrDefault(t => t.Metadata.Name == functionCallContent.Name); 629using Activity? activity = _activitySource?.StartActivity(context.Function.Metadata.Name); 637LogInvokingSensitive(context.Function.Metadata.Name, LoggingHelpers.AsJson(context.CallContent.Arguments, context.Function.Metadata.JsonSerializerOptions)); 641LogInvoking(context.Function.Metadata.Name); 660LogInvocationCanceled(context.Function.Metadata.Name); 664LogInvocationFailed(context.Function.Metadata.Name, e); 677LogInvocationCompletedSensitive(context.Function.Metadata.Name, elapsed, LoggingHelpers.AsJson(result, context.Function.Metadata.JsonSerializerOptions)); 681LogInvocationCompleted(context.Function.Metadata.Name, elapsed);
Functions\AIFunctionFactory.cs (4)
33/// The resulting <see cref="AIFunction"/> exposes metadata about the function via <see cref="AIFunction.Metadata"/>. 62/// The resulting <see cref="AIFunction"/> exposes metadata about the function via <see cref="AIFunction.Metadata"/>. 105/// The resulting <see cref="AIFunction"/> exposes metadata about the function via <see cref="AIFunction.Metadata"/>. 140/// The resulting <see cref="AIFunction"/> exposes metadata about the function via <see cref="AIFunction.Metadata"/>.
Microsoft.Extensions.AI.Abstractions (5)
Functions\AIFunction.cs (5)
33public override string ToString() => Metadata.Name; 46string.IsNullOrWhiteSpace(Metadata.Description) ? 47Metadata.Name : 48$"{Metadata.Name} ({Metadata.Description})";
Microsoft.Extensions.AI.Abstractions.Tests (2)
Utilities\AIJsonUtilitiesTests.cs (2)
218AIFunctionMetadata metadata = func.Metadata; 239AIFunctionMetadata metadata = func.Metadata;
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (3)
379var parameters = aiFunction.Metadata.Parameters; 400return new(new FunctionDefinition(aiFunction.Metadata.Name) 402Description = aiFunction.Metadata.Description,
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
297ToolMode = ChatToolMode.RequireSpecific(shieldsUpTool.Metadata.Name),
PromptBasedFunctionCallingChatClient.cs (3)
182Name = tool.Metadata.Name, 183Description = tool.Metadata.Description, 184Arguments = tool.Metadata.Parameters.ToDictionary(
Microsoft.Extensions.AI.Ollama (4)
OllamaChatClient.cs (4)
439Name = function.Metadata.Name, 440Description = function.Metadata.Description, 443Properties = function.Metadata.Parameters.ToDictionary( 446Required = function.Metadata.Parameters.Where(p => p.IsRequired).Select(p => p.Name).ToList(),
Microsoft.Extensions.AI.OpenAI (9)
OpenAIChatClient.cs (4)
494aiFunction.Metadata.AdditionalProperties.TryGetValue("Strict", out object? strictObj) && 500var parameters = aiFunction.Metadata.Parameters; 519return ChatTool.CreateFunctionTool(aiFunction.Metadata.Name, aiFunction.Metadata.Description, resultParameters, strict);
OpenAIRealtimeExtensions.cs (5)
35Properties = aiFunction.Metadata.Parameters 37Required = aiFunction.Metadata.Parameters 44Name = aiFunction.Metadata.Name, 45Description = aiFunction.Metadata.Description, 115&& tools.FirstOrDefault(t => t.Metadata.Name == update.FunctionName) is AIFunction aiFunction)
Microsoft.Extensions.AI.Tests (17)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
358new(ChatRole.Assistant, [new FunctionCallContent("callId1", func1.Metadata.Name)]), 359new(ChatRole.Assistant, [new FunctionCallContent("callId2", func2.Metadata.Name)]),
Functions\AIFunctionFactoryTest.cs (15)
136Assert.Contains("Metadata_DerivedFromLambda", func.Metadata.Name); 137Assert.Empty(func.Metadata.Description); 138Assert.Empty(func.Metadata.Parameters); 139Assert.Equal(typeof(string), func.Metadata.ReturnParameter.ParameterType); 142Assert.Contains("Metadata_DerivedFromLambda", func.Metadata.Name); 143Assert.Empty(func.Metadata.Description); 144Assert.Single(func.Metadata.Parameters); 148Assert.Contains("Metadata_DerivedFromLambda", func.Metadata.Name); 149Assert.Equal("This is a test function", func.Metadata.Description); 150Assert.Collection(func.Metadata.Parameters, 179Assert.Equal("test name", func.Metadata.Name); 180Assert.Equal("test description", func.Metadata.Description); 181Assert.Equal(parameterMetadata, func.Metadata.Parameters); 182Assert.Equal(returnParameterMetadata, func.Metadata.ReturnParameter); 183Assert.Equal(metadata, func.Metadata.AdditionalProperties);