What feature would you like to be added?
Create tools from Microsoft.Extensions.AI.AIFunctionFactory
[Description("...")]
public static async Task<string> UpperCase(string message)
{
return message.ToUpper();
}
var tools = AIFunctionFactory.Create(UpperCase)
var middleware = new FunctionCallMiddleware([tools])
var agentWithTools = agent.RegisterMiddleware(middleware);
In the long run, we will want to replace FunctionContract and FunctionParameterContract with the contract classes from M.E.A.I, and maybe update source generator to generate those contract classes instead
Why is this needed?
This enables developers to create type-safe function call for autogen agents even where source generator is not available. E.G. dotnet interactive
cc @colombod