-
Notifications
You must be signed in to change notification settings - Fork 833
Open
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI librarieshelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Description
Description
There's a bunch of .NET reflection-originating chars in a tool name when it's created from a local function. It would be nice to to additional cleanup to get cleaner tool name by default.
Reproduction Steps
[Fact]
public void DefaultToolName()
{
static void DoSomething() { }
var tool = AIFunctionFactory.Create(DoSomething);
// renders _DefaultToolName_g__DoSomething_4_0
Assert.Equal("DefaultToolName_DoSomething", tool.Name);
}
Expected behavior
Since there can't be two members with the same name (neither at the method as well as the local function level), the name could just be DefaultToolName_DoSomething
.
Actual behavior
Returns _DefaultToolName_g__DoSomething_4_0
Regression?
No response
Known Workarounds
Set name explicitly
Configuration
net10 preview 6, MEAI 9.7.0
Other information
No response
Metadata
Metadata
Assignees
Labels
area-aiMicrosoft.Extensions.AI librariesMicrosoft.Extensions.AI librarieshelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue