![]() |
VOOZH | about |
dotnet add package AgentFrameworkToolkit.AzureOpenAI --version 1.10.0
NuGet\Install-Package AgentFrameworkToolkit.AzureOpenAI -Version 1.10.0
<PackageReference Include="AgentFrameworkToolkit.AzureOpenAI" Version="1.10.0" />
<PackageVersion Include="AgentFrameworkToolkit.AzureOpenAI" Version="1.10.0" />Directory.Packages.props
<PackageReference Include="AgentFrameworkToolkit.AzureOpenAI" />Project file
paket add AgentFrameworkToolkit.AzureOpenAI --version 1.10.0
#r "nuget: AgentFrameworkToolkit.AzureOpenAI, 1.10.0"
#:package AgentFrameworkToolkit.AzureOpenAI@1.10.0
#addin nuget:?package=AgentFrameworkToolkit.AzureOpenAI&version=1.10.0Install as a Cake Addin
#tool nuget:?package=AgentFrameworkToolkit.AzureOpenAI&version=1.10.0Install as a Cake Tool
This package is aimed at Azure OpenAI as an LLM Provider. Check out the General README.md for other providers and shared features in Agent Framework Toolkit.
Agent Framework Toolkit is an opinionated C# wrapper on top of the Microsoft Agent Framework that makes various things easier to work with:
.RunAsync<>(...) even on AIAgents using Tool Calling Middleware.Q: If I use the Agent Framework Toolkit, does it limit or hinder what I can do with Microsoft Agent Framework?
A: No, everything you can do with Microsoft Agent Framework can still be done with Agent Framework Toolkit. It is just a wrapper that enables options that are hard to use otherwise
Q: What is the release frequency of Agent Framework Toolkit (can I always use the latest Microsoft Agent Framework release)?
A: This NuGet package is released as often (or more) than the Microsoft Agent Framework. At a minimum, it will be bumped to the latest Microsoft Agent Framework Release within a day of official release. It follows the same versioning scheme as AF, so the same or higher version number will always be compatible with the latest release.
Q: Why are the agents not AIAgent / ChatClientAgents? Are they compatible with the rest of the Microsoft Agent Framework?
A: The specialized agents in Agent Framework Toolkit are all 100% compatible with AF as they simply inherit from AIAgent
dotnet add package AgentFrameworkToolkit.AzureOpenAI)AzureOpenAIAgentFactory instance (Namespace: AgentFrameworkToolkit.AzureOpenAI)AzureOpenAIAgent (which is a regular Microsoft Agent Framework AIAgent behind the scenes)//Create your AgentFactory
AzureOpenAIAgentFactory agentFactory = new AzureOpenAIAgentFactory("<Endpoint>", "<API Key>");
//Create your Agent
AzureOpenAIAgent agent = agentFactory.CreateAgent("gpt-5");
AgentResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);
//Create your AgentFactory
AzureOpenAIAgentFactory agentFactory = new AzureOpenAIAgentFactory("<Endpoint>", "<API Key>");
//Create your Agent
AzureOpenAIAgent agent = agentFactory.CreateAgent(new AgentOptions //Use AgentOptions overload to access more options
{
Model = "gpt-5",
ReasoningEffort = OpenAIReasoningEffort.Low, //Set reasoning effort
Instructions = "You are a nice AI", //The System Prompt
Tools = [], //Add your tools here
});
AgentResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);
//Create your AgentFactory
AzureOpenAIAgentFactory agentFactory = new AzureOpenAIAgentFactory(new AzureOpenAIConnection
{
Endpoint = "<Endpoint>",
Credentials = new AzureCliCredential() //Or similar
});
//Create your Agent
AzureOpenAIAgent agent = agentFactory.CreateAgent(new AgentOptions //Use AgentOptions overload to access more options
{
Model = "gpt-5",
ReasoningEffort = OpenAIReasoningEffort.Low, //Set reasoning effort
Instructions = "You are a nice AI", //The System Prompt
Tools = [], //Add your tools here
});
AgentResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);
//Create your AgentFactory (using a connection object for more options)
AzureOpenAIAgentFactory agentFactory = new AzureOpenAIAgentFactory(new AzureOpenAIConnection
{
Endpoint = "<endpoint>",
ApiKey = "<apiKey>",
NetworkTimeout = TimeSpan.FromMinutes(5), //Set call timeout
Credentials = null, //Set RBAC Credentials
DefaultClientType = ClientType.ResponsesApi, //Set default Client Type for each agent (ChatClient or ResponsesAPI)
AutoCorrectFoundryEndpoint = true, //Autocorrect Foundry project URLs to the Azure OpenAI endpoint
AdditionalAzureOpenAIClientOptions = options =>
{
//Set additional properties if needed
}
});
//Create your Agent
AzureOpenAIAgent agent = agentFactory.CreateAgent(new AgentOptions
{
//Mandatory
Model = "gpt-5", //Model to use
//Optional (Common)
ClientType = ClientType.ChatClient, //Choose ClientType (ChatClient or Responses API)
Name = "MyAgent", //Agent Name
Temperature = 0, //The Temperature of the LLM Call (1 = Normal; 0 = Less creativity) [ONLY NON-REASONING MODELS]
ReasoningEffort = OpenAIReasoningEffort.Low, //Set Reasoning Effort [ONLY REASONING MODELS]
ReasoningSummaryVerbosity = OpenAIReasoningSummaryVerbosity.Detailed, //Only used in Responses API [ONLY REASONING MODELS]
Instructions = "You are a nice AI", //The System Prompt for the Agent to Follow
Tools = [], //Add your tools for Tool Calling here
ToolCallingMiddleware = async (callingAgent, context, next, token) => //Tool Calling Middleware to Inspect, change, and cancel tool-calling
{
AIFunctionArguments arguments = context.Arguments; //Details on the tool-call that is about to happen
return await next(context, token);
},
OpenTelemetryMiddleware = new OpenTelemetryMiddleware(source: "MyOpenTelemetrySource", telemetryAgent => telemetryAgent.EnableSensitiveData = true), //Configure OpenTelemetry Middleware
//Optional (Rarely used)
MaxOutputTokens = 2000, //Max allow token
Id = "1234", //Set the ID of Agent (else a random GUID is assigned as ID)
Description = "My Description", //Description of the Agent (not used by the LLM)
LoggingMiddleware = new LoggingMiddleware( /* Configure custom logging */),
Services = null, //Setup Tool Calling Service Injection (See https://youtu.be/EGs-Myf5MB4 for more details)
LoggerFactory = null, //Setup logger Factory (Alternative to Middleware)
ChatHistoryProvider = new MyChatMessageStore(), //Set a custom message store
AIContextProviders = [new MyAIContextProvider()], //Set custom AI context providers
AdditionalChatClientAgentOptions = options =>
{
//Option to set even more options if not covered by AgentFrameworkToolkit
},
RawToolCallDetails = Console.WriteLine, //Raw Tool calling Middleware (if you just wish to log what tools are being called. ToolCallingMiddleware is a more advanced version of this)
RawHttpCallDetails = details => //Intercept the raw HTTP Call to the LLM (great for advanced debugging sessions)
{
Console.WriteLine(details.RequestUrl);
Console.WriteLine(details.RequestData);
Console.WriteLine(details.ResponseData);
},
ClientFactory = client =>
{
//Interact with the underlying Client-factory
return client;
}
});
AgentResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);
AzureOpenAIBatchRunner batchRunner = new("<endpoint>", "<apiKey>");
ChatBatchRun run = await batchRunner.RunChatBatchAsync(
new ChatBatchOptions
{
Model = "<deployment-name>"
},
[
ChatBatchRequest.Create("Summarize this text.")
]);
Note: Batch runner APIs are marked experimental with
AFT999. In Azure OpenAI,Modelis your deployment name.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
Showing the top 1 popular GitHub repositories that depend on AgentFrameworkToolkit.AzureOpenAI:
| Repository | Stars |
|---|---|
|
rwjdk/MicrosoftAgentFrameworkSamples
Samples demonstrating the Microsoft Agent Framework in C#
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.0 | 86 | 6/10/2026 |
| 1.9.0 | 359 | 6/4/2026 |
| 1.8.0 | 251 | 5/28/2026 |
| 1.7.0 | 67 | 5/27/2026 |
| 1.6.2 | 85 | 5/20/2026 |
| 1.6.1 | 125 | 5/14/2026 |
| 1.5.0 | 62 | 5/14/2026 |
| 1.4.0 | 149 | 5/5/2026 |
| 1.3.0 | 1,114 | 4/24/2026 |
| 1.2.0 | 134 | 4/22/2026 |
| 1.1.0 | 542 | 4/10/2026 |
| 1.0.0 | 638 | 4/2/2026 |
| 1.0.0-rc5 | 120 | 3/31/2026 |
| 1.0.0-rc4.2 | 72 | 3/31/2026 |
| 1.0.0-rc4.1 | 71 | 3/31/2026 |
| 1.0.0-rc4 | 1,063 | 3/12/2026 |
| 1.0.0-rc3.1 | 218 | 3/8/2026 |
| 1.0.0-rc3 | 112 | 3/4/2026 |
| 1.0.0-rc2 | 578 | 2/26/2026 |
| 1.0.0-rc1 | 382 | 2/21/2026 |