agui-dotnet-client-tools
AG-UI .NET — client (frontend) tools
Goal: let the model call a function that runs in the client app — to read something only the client has (location, local state, UI selection, a device API) — with the client executing the call and returning the result so the run continues to a final answer.
A client tool is an ordinary Microsoft.Extensions.AI AIFunction you attach to the request via ChatOptions.Tools. AGUIChatClient is itself a function-invoking client, so it runs the tool locally and sends the result back automatically — you do not wrap it in UseFunctionInvocation.
Install
dotnet add package AGUI.Client
Microsoft.Extensions.AI supplies AIFunctionFactory, ChatOptions, and AITool. Run dotnet package search AGUI.Client --exact-match for the current version.
Declare a tool and pass it in options
Define the function in the client, wrap it with AIFunctionFactory.Create, and put it on ChatOptions.Tools: