Andes.Extensions.AI.Agent 0.3.1

dotnet add package Andes.Extensions.AI.Agent --version 0.3.1
                    
NuGet\Install-Package Andes.Extensions.AI.Agent -Version 0.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Andes.Extensions.AI.Agent" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Andes.Extensions.AI.Agent" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Andes.Extensions.AI.Agent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Andes.Extensions.AI.Agent --version 0.3.1
                    
#r "nuget: Andes.Extensions.AI.Agent, 0.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Andes.Extensions.AI.Agent@0.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Andes.Extensions.AI.Agent&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Andes.Extensions.AI.Agent&version=0.3.1
                    
Install as a Cake Tool

Andes.Extensions.AI.Agent

Microsoft Agent Framework support for Andes.Extensions.AI tool tracking. Adds two things on top of the core middleware:

  • Classification — agents wrapped with WithTracking() are recognized as ToolKind.Agent and render with the "Calling {Agent} Agent" header in progress updates and usage reports.
  • Usage capture — each agent run's AgentResponse.Usage is attributed to the calling tool's scope, so hosted or remote agents' token usage lands in the ChatUsageReport even when their pipeline cannot be instrumented.

Install

dotnet add package Andes.Extensions.AI.Agent

Quickstart

using Andes.Extensions.AI;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;

AIAgent weatherAgent = weatherChatClient.AsAIAgent(
    instructions: "You answer questions about the weather.",
    name: "Weather Agent",
    description: "Answers questions about the weather.",
    tools: [AIFunctionFactory.Create(GetWeather)]);

IChatClient client = innerClient
    .AsBuilder()
    .UseToolTracking(options => options.UseAgentToolClassification())
    .UseFunctionInvocation() // tracking must be registered before function invocation
    .Build();

var chatOptions = new ChatOptions
{
    Tools = [weatherAgent.WithTracking()],
};

await foreach (ChatResponseUpdate update in client.GetStreamingResponseAsync("prompt", chatOptions))
{
    foreach (ChatProgressContent progress in update.Contents.OfType<ChatProgressContent>())
    {
        // e.g. "Calling Weather Agent" (header), then any statuses the agent's tools report
        Console.WriteLine(progress.Progress.Message);
    }
}

WithTracking carries the agent identity used for classification and attributes each run's usage to the calling tool's scope. Pass trackUsage: false when the agent's own chat pipeline uses UseToolTracking() — the nested pipeline already rolls its total usage up, and reporting AgentResponse.Usage on top would double-count. Pass reportFunctionCalls: true to additionally report a "Calling {Function} Tool" status each time the agent invokes one of its function tools (local function-invoking agents only; names only).

Nested agents render as their own activity: when a WithTracking-wrapped agent is a tool of another agent, or is invoked directly inside a tool body, the wrapper opens a child tracking scope — the run streams as a child activity under the enclosing tool (ParentScopeId/Depth on its progress events) and lands as a child ToolCallUsage with its own usage and duration in the ChatUsageReport. A tool the tracking middleware wrapped itself still opens exactly one scope, and report totals are unchanged either way.

Notes

  • A function created by a plain agent.AsAIFunction() call exposes neither its agent nor its usage; without WithTracking it classifies as a regular function tool. The same applies to agents hidden inside your own DelegatingAIFunction wrappers, which this package never unwraps or bypasses.
  • The agent runs in-process on the caller's async flow, so statuses its tools report through ChatProgress.Report(...) surface beneath the agent's header automatically.
  • Usage capture reports whatever the agent implementation surfaces on AgentResponse.Usage; agents that report no usage attribute nothing.
  • Privacy posture matches the core package: progress events never carry prompt content, tool arguments, or tool results.

Full documentation lives in the repository docs.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 39 7/29/2026
0.3.0 34 7/29/2026
0.2.0 80 7/25/2026