19 instantiations of AIParameterNameAttribute
Microsoft.Extensions.AI.Abstractions.Tests (7)
Functions\AINameAttributesTests.cs (2)
21
Assert.Throws<ArgumentNullException>("name", () => new
AIParameterNameAttribute
(null!));
22
Assert.Throws<ArgumentException>("name", () => new
AIParameterNameAttribute
(" "));
Utilities\AIJsonUtilitiesTests.cs (5)
605
static void TestMethod([
AIParameterName
("custom_property_name")] string select, int top)
625
static void DuplicateByAttribute([
AIParameterName
("dup")] string first, [
AIParameterName
("dup")] string second)
634
static void DuplicateByCollision([
AIParameterName
("filter")] string select, string filter)
648
static void TestMethod([
AIParameterName
("a/b~c")] RecursiveNode node)
Microsoft.Extensions.AI.Tests (12)
Functions\AIFunctionFactoryTest.cs (12)
120
AIFunctionFactory.Create(([
AIParameterName
("theParam")] string otherName) => otherName),
342
AIFunction func = AIFunctionFactory.Create([AIFunctionName("my_tool")] ([
AIParameterName
("my_param")] string myParam) => myParam);
355
AIFunction func = AIFunctionFactory.Create(([
AIParameterName
("$select")] string select, int top) => select + top);
364
([
AIParameterName
("my_param")] string myParam, int top) => myParam + top);
389
([
AIParameterName
("my_param")] string myParam) => myParam,
419
([
AIParameterName
("a/b~c")] AIParameterNameAttributeRecursiveNode node) => node.ToString(),
432
([
AIParameterName
("dup")] string first, [
AIParameterName
("dup")] string second) => first + second));
437
([
AIParameterName
("filter")] string select, string filter) => select + filter));
458
([
AIParameterName
("dup")] string first, [
AIParameterName
("dup")] string second) => first + second,
1828
public abstract string Method([
AIParameterName
("my_param")] string myParam);
4 references to AIParameterNameAttribute
Microsoft.Extensions.AI.Abstractions (4)
Functions\AIFunctionFactory.cs (1)
819
Throw.ArgumentException("method", $"Multiple parameters are mapped to the same name '{effectiveName}'. Ensure that any {nameof(
AIParameterNameAttribute
)} values do not collide with each other or with other parameter names.");
Functions\AIParameterNameAttribute.cs (1)
20
/// <summary>Initializes a new instance of the <see cref="
AIParameterNameAttribute
"/> class.</summary>
Utilities\AIJsonUtilities.Schema.Create.cs (2)
135
Throw.ArgumentException(nameof(method), $"Multiple parameters are mapped to the same name '{parameterSchemaName}'. Ensure that any {nameof(
AIParameterNameAttribute
)} values do not collide with each other or with other parameter names.");
874
parameter.GetCustomAttribute<
AIParameterNameAttribute
>(inherit: true)?.Name ?? parameter.Name!;