AgentFrameworkToolkit.OpenAI
1.0.0-preview.251121.1
See the version list below for details.
dotnet add package AgentFrameworkToolkit.OpenAI --version 1.0.0-preview.251121.1
NuGet\Install-Package AgentFrameworkToolkit.OpenAI -Version 1.0.0-preview.251121.1
<PackageReference Include="AgentFrameworkToolkit.OpenAI" Version="1.0.0-preview.251121.1" />
<PackageVersion Include="AgentFrameworkToolkit.OpenAI" Version="1.0.0-preview.251121.1" />
<PackageReference Include="AgentFrameworkToolkit.OpenAI" />
paket add AgentFrameworkToolkit.OpenAI --version 1.0.0-preview.251121.1
#r "nuget: AgentFrameworkToolkit.OpenAI, 1.0.0-preview.251121.1"
#:package AgentFrameworkToolkit.OpenAI@1.0.0-preview.251121.1
#addin nuget:?package=AgentFrameworkToolkit.OpenAI&version=1.0.0-preview.251121.1&prerelease
#tool nuget:?package=AgentFrameworkToolkit.OpenAI&version=1.0.0-preview.251121.1&prerelease
AgentFramework Toolkit
An opinionated C# Toolkit for Microsoft Agent Framework that makes life easier
NuGet
- AgentFramework Toolkit for OpenAI
- AgentFramework Toolkit for Azure OpenAI
- AgentFramework Toolkit for Google (Gemini)
- AgentFramework Toolkit for Anthropic (Claude)
- AgentFramework Toolkit for XAI (Grok)
Examples of use
All agents have AIAgent as base, fully work the rest of Microsoft Agent Framework)
OpenAI
OpenAIAgentFactory factory = new OpenAIAgentFactory(new OpenAIConnection
{
ApiKey = configuration.OpenAiApiKey
});
OpenAIAgent agent = factory.CreateAgent(new OpenAIAgentOptionsForResponseApiWithReasoning
{
DeploymentModelName = "gpt-5",
ReasoningEffort = ResponseReasoningEffortLevel.High,
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Detailed,
NetworkTimeout = TimeSpan.FromMinutes(5),
});
GoogleAgentFactory factory = new(new GoogleConnection
{
ApiKey = configuration.GoogleGeminiApiKey
});
GoogleAgent agent = factory.CreateAgent(new GoogleAgentOptions
{
DeploymentModelName = GenerativeAI.GoogleAIModels.Gemini25Pro,
Tools = [AIFunctionFactory.Create(GetWeather)]
});
Anthropic
AnthropicAgentFactory factory = new AnthropicAgentFactory(new AnthropicConnection
{
ApiKey = configuration.AnthropicApiKey
});
factory.CreateAgent(new AnthropicAgentOptions
{
DeploymentModelName = "claude-sonnet-4-5",
MaxOutputTokens = 10000, // <-- Force the MaxToken property I always forget
BudgetTokens = 5000
});
X AI
XAIAgentFactory factory = new(new XAIConnection
{
ApiKey = configuration.XAiGrokApiKey
});
XAIAgent agent = factory.CreateAgent(new OpenAIAgentOptionsForChatClientWithoutReasoning
{
DeploymentModelName = "grok-4-fast-non-reasoning",
Tools = [AIFunctionFactory.Create(GetWeather)]
});
Azure AI (with every optional setting added for demonstration)
AzureOpenAIAgent fullBlownAgent = azureOpenAIAgentFactory.CreateAgent(new OpenAIAgentOptionsForResponseApiWithReasoning
{
Id = "1234",
Name = "MyAgent",
Description = "The description of my agent",
Instructions = "Speak like a pirate",
DeploymentModelName = "gpt-5-mini",
ReasoningEffort = ResponseReasoningEffortLevel.Low,
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Detailed,
NetworkTimeout = TimeSpan.FromMinutes(5),
Tools = [AIFunctionFactory.Create(GetWeather)],
RawToolCallDetails = details => { Console.WriteLine(details.ToString()); },
RawHttpCallDetails = details =>
{
Console.WriteLine($"URL: {details.RequestUrl}");
Console.WriteLine($"Request: {details.RequestJson}");
Console.WriteLine($"Response: {details.ResponseJson}");
}
});
| Product | Versions 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. |
-
net8.0
- AgentFrameworkToolkit (>= 1.0.0-preview.251121.1)
- Microsoft.Agents.AI.OpenAI (>= 1.0.0-preview.251114.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on AgentFrameworkToolkit.OpenAI:
| Package | Downloads |
|---|---|
|
AgentFrameworkToolkit.AzureOpenAI
An opinionated C# Toolkit targeting Azure OpenAI for Microsoft Agent Framework that makes life eaisier |
|
|
AgentFrameworkToolkit.XAI
An opinionated C# Toolkit targeting XAI (Grok) for Microsoft Agent Framework that makes life eaisier |
|
|
AgentFrameworkToolkit.OpenRouter
An opinionated C# Toolkit targeting OpenRouter for Microsoft Agent Framework that makes life eaisier |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.251123.1 | 0 | 11/23/2025 |
| 1.0.0-preview.251121.3 | 250 | 11/21/2025 |
| 1.0.0-preview.251121.2 | 281 | 11/21/2025 |
| 1.0.0-preview.251121.1 | 284 | 11/21/2025 |
| 0.0.1-preview2 | 329 | 11/18/2025 |
| 0.0.1-preview1 | 334 | 11/18/2025 |