6 instantiations of AIFunctionNameAttribute
Microsoft.Extensions.AI.Abstractions.Tests (3)
Functions\AINameAttributesTests.cs (2)
14Assert.Throws<ArgumentNullException>("name", () => new AIFunctionNameAttribute(null!)); 15Assert.Throws<ArgumentException>("name", () => new AIFunctionNameAttribute(" "));
Utilities\AIJsonUtilitiesTests.cs (1)
579[AIFunctionName("my_tool")]
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
324Func<string> funcWithAttribute = [AIFunctionName("get_user")] () => "test"; 328Func<string> funcWithBoth = [AIFunctionName("my_function")][DisplayName("display_name")] () => "test"; 342AIFunction func = AIFunctionFactory.Create([AIFunctionName("my_tool")] ([AIParameterName("my_param")] string myParam) => myParam);
5 references to AIFunctionNameAttribute
Microsoft.Extensions.AI.Abstractions (5)
Functions\AIFunctionFactory.cs (3)
138/// any <see cref="AIFunctionNameAttribute"/> on <paramref name="method"/>, then from any <see cref="DisplayNameAttribute"/> 317/// any <see cref="AIFunctionNameAttribute"/> on <paramref name="method"/>, then from any <see cref="DisplayNameAttribute"/> 829Name = key.Name ?? key.Method.GetCustomAttribute<AIFunctionNameAttribute>(inherit: true)?.Name ?? key.Method.GetCustomAttribute<DisplayNameAttribute>(inherit: true)?.DisplayName ?? GetFunctionName(key.Method);
Functions\AIFunctionFactoryOptions.cs (1)
53/// The name to use for the function. The default value is a name derived from the passed <see cref="Delegate"/> or <see cref="MethodInfo"/> (for example, via an <see cref="AIFunctionNameAttribute"/> or <see cref="DisplayNameAttribute"/> on the method).
Functions\AIFunctionNameAttribute.cs (1)
20/// <summary>Initializes a new instance of the <see cref="AIFunctionNameAttribute"/> class.</summary>