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");
64 references to Metadata
Microsoft.Extensions.AI (14)
ChatCompletion\FunctionInvokingChatClient.cs (10)
539AIFunction? function = options.Tools!.OfType<AIFunction>().FirstOrDefault(t => t.Metadata.Name == functionCallContent.Name); 645using Activity? activity = _activitySource?.StartActivity(context.Function.Metadata.Name); 653LogInvokingSensitive(context.Function.Metadata.Name, LoggingHelpers.AsJson(context.CallContent.Arguments, context.Function.Metadata.JsonSerializerOptions)); 657LogInvoking(context.Function.Metadata.Name); 676LogInvocationCanceled(context.Function.Metadata.Name); 680LogInvocationFailed(context.Function.Metadata.Name, e); 693LogInvocationCompletedSensitive(context.Function.Metadata.Name, elapsed, LoggingHelpers.AsJson(result, context.Function.Metadata.JsonSerializerOptions)); 697LogInvocationCompleted(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)
381var parameters = aiFunction.Metadata.Parameters; 402return new(new FunctionDefinition(aiFunction.Metadata.Name) 404Description = aiFunction.Metadata.Description,
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
307ToolMode = 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)
460Name = function.Metadata.Name, 461Description = function.Metadata.Description, 464Properties = function.Metadata.Parameters.ToDictionary( 467Required = function.Metadata.Parameters.Where(p => p.IsRequired).Select(p => p.Name).ToList(),
Microsoft.Extensions.AI.OpenAI (9)
OpenAIModelMapper.ChatCompletion.cs (4)
390aiFunction.Metadata.AdditionalProperties.TryGetValue("Strict", out object? strictObj) && 396var parameters = aiFunction.Metadata.Parameters; 415return 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.OpenAI.Tests (6)
OpenAISerializationTests.cs (6)
340Assert.Equal("Gets the age of the specified person.", function.Metadata.Description); 341Assert.Equal("GetPersonAge", function.Metadata.Name); 342Assert.Equal("Strict", Assert.Single(function.Metadata.AdditionalProperties).Key); 343Assert.Equal("Return parameter", function.Metadata.ReturnParameter.Description); 344Assert.Equal("{}", Assert.IsType<JsonElement>(function.Metadata.ReturnParameter.Schema).GetRawText()); 346AIFunctionParameterMetadata parameter = Assert.Single(function.Metadata.Parameters);
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);