AgentFrameworkToolkit 1.0.0-preview.260108.1

This is a prerelease version of AgentFrameworkToolkit.
dotnet add package AgentFrameworkToolkit --version 1.0.0-preview.260108.1
                    
NuGet\Install-Package AgentFrameworkToolkit -Version 1.0.0-preview.260108.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="AgentFrameworkToolkit" Version="1.0.0-preview.260108.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AgentFrameworkToolkit" Version="1.0.0-preview.260108.1" />
                    
Directory.Packages.props
<PackageReference Include="AgentFrameworkToolkit" />
                    
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 AgentFrameworkToolkit --version 1.0.0-preview.260108.1
                    
#r "nuget: AgentFrameworkToolkit, 1.0.0-preview.260108.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 AgentFrameworkToolkit@1.0.0-preview.260108.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=AgentFrameworkToolkit&version=1.0.0-preview.260108.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AgentFrameworkToolkit&version=1.0.0-preview.260108.1&prerelease
                    
Install as a Cake Tool

GitHub Actions Workflow Status GitHub Issues or Pull Requests by label Libraries.io dependency status for GitHub repo

Agent Framework Toolkit

Welcome to Agent Framework Toolkit; An opinionated C# Wrapper for Microsoft Agent Framework that makes life easier

When using the Microsoft Agent Framework, it is very simple, as long as you do not need to do anything advanced. So setting things like 'model', 'instructions', and 'tools' is a breeze. But the second you need to do something slightly more advanced, you end up with questions:

  • How to work with Anthropic's Claude?
  • How do you set the reasoning effort in OpenAI or Google?
  • How do you add Tool Calling Middleware?
  • How do you create Tools from a class or MCP Server?

Things like the above, while doable, are very cumbersome and are not discoverable, as Microsoft Agent Framework have decided to be very generic.

Agent Framework Toolkit resolves these issues by offering Provider-specific wrappers around Microsoft Agent Framwork, that are tailored to the specific provider while keeping 100% compatibility with the rest of Microsoft Agent Framework. The result is less code and much easier code for you to write.

With and Without Agent Framework Toolkit The above sample shows how the code looks with and without the Agent Framework Toolkit. You can get more details in this video.

Supported Providers

The following providers are currently supported (check out the individual README's for details and samples)

Provider Supported Features
Antropic (Claude) AgentFactory, AIToolsFactory NuGet README
Azure OpenAI AgentFactory, AIToolsFactory, EmbeddingFactory NuGet README
Cohere AgentFactory, AIToolsFactory NuGet README
GitHub Models AgentFactory, AIToolsFactory NuGet README
Google (Gemini) AgentFactory, AIToolsFactory NuGet README
Mistral AgentFactory, AIToolsFactory, EmbeddingFactory NuGet README
OpenAI AgentFactory, AIToolsFactory, EmbeddingFactory NuGet README
OpenRouter AgentFactory, AIToolsFactory, EmbeddingFactory NuGet README
XAI (Grok) AgentFactory, AIToolsFactory NuGet README

Tip: For other OpenAI-based providers, you can use the OpenAI Package and provide a custom endpoint

Code sample (AgentFactory)

using Azure OpenAI, easily setting Reasoning Effort and Tool Calling Middleware (see individual Provider README for detailed examples)

AzureOpenAIAgentFactory agentFactory = new("<endpoint>", "<apiKey>");

AzureOpenAIAgent agent = agentFactory.CreateAgent(new AgentOptions
{
    Model = OpenAIChatModels.Gpt5Mini,
    ReasoningEffort = OpenAIReasoningEffort.Low,
    Tools = [AIFunctionFactory.Create(WeatherTool.GetWeather)],
    RawToolCallDetails = details => { Console.WriteLine(details.ToString()); }
});

string question = "What is the Weather like in Paris";
ChatClientAgentRunResponse<WeatherReport> response = await agent.RunAsync<WeatherReport>(question);
WeatherReport weatherReport = response.Result;

Code sample (AIToolsFactory)

//1. Make your tool-class and add [AITool] attributes

public class MyTools
{
    [AITool]
    public string MyTool1()
    {
        return "hello";
    }

    [AITool]
    public string MyTool2()
    {
        return "world";
    }
}

//2. Get your tool by either instance or Type (if not contructor dependencies)

IList<AITool> tools = aiToolsFactory.GetTools(typeof(MyTools));
//or
IList<AITool> tools = aiToolsFactory.GetTools(new MyTools());

More Info

WIKI Changelog YouTube Contributing Security

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (6)

Showing the top 5 NuGet packages that depend on AgentFrameworkToolkit:

Package Downloads
AgentFrameworkToolkit.Anthropic

An opinionated C# Toolkit targeting Anthropic for Microsoft Agent Framework that makes life eaisier

AgentFrameworkToolkit.OpenAI

An opinionated C# Toolkit targeting OpenAI for Microsoft Agent Framework that makes life eaisier

AgentFrameworkToolkit.Google

An opinionated C# Toolkit targeting Google for Microsoft Agent Framework that makes life eaisier

AgentFrameworkToolkit.Mistral

An opinionated C# Toolkit targeting Mistral for Microsoft Agent Framework that makes life eaisier

AgentFrameworkToolkit.GitHub

An opinionated C# Toolkit targeting GitHubModels for Microsoft Agent Framework that makes life eaisier

GitHub repositories

This package is not used by any popular GitHub repositories.