Skip to content

Add ability to change name of arguments inside AIFunction parameters in MEAI #7477

@NoofSaeidh

Description

@NoofSaeidh

Currently there is possibility to easily add descriptions for method argument with DescriptionAttribute but it is not possible to change display name which would be generated. The only possible way to change it is to handle marshaling for argument manually, which could be overkill.
This scenario is might be needed when arguments should be named with symbols that disallowed for argument names, such as space or $ sign. For my case I need to name arguments as $select, $expand to align with OData documentation, but it is kinda tricky.

It would be great to provide ability to use another attribute for name like DescriptionAttribute. I see already existing alternative - DisplayNameAttribute, but currently it is not applicable for argument names. So maybe it is better to provide a custom attribute instead.

Example:

return AIFunctionFactory.Create(Method);
void Method(
  // [DisplayName("$select")]
  [Description("OData $select")]
  string? select)
{}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-aiMicrosoft.Extensions.AI librariesuntriaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions