Soenneker.Maf.Pool.OpenAI
11.0.231
Prefix Reserved
dotnet add package Soenneker.Maf.Pool.OpenAI --version 11.0.231
NuGet\Install-Package Soenneker.Maf.Pool.OpenAI -Version 11.0.231
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="Soenneker.Maf.Pool.OpenAI" Version="11.0.231" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Maf.Pool.OpenAI" Version="11.0.231" />
<PackageReference Include="Soenneker.Maf.Pool.OpenAI" />
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 Soenneker.Maf.Pool.OpenAI --version 11.0.231
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Maf.Pool.OpenAI, 11.0.231"
#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 Soenneker.Maf.Pool.OpenAI@11.0.231
#: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=Soenneker.Maf.Pool.OpenAI&version=11.0.231
#tool nuget:?package=Soenneker.Maf.Pool.OpenAI&version=11.0.231
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Maf.Pool.OpenAI
Provides OpenAI-specific registration extensions for IMafPool, enabling integration via Microsoft Agent Framework.
Install
dotnet add package Soenneker.Maf.Pool.OpenAI
Usage
using Soenneker.Maf.Pool.OpenAI;
using Soenneker.Maf.Pool.Abstract;
await pool.AddOpenAI(
poolId: "chat",
key: "openai-primary",
modelId: "gpt-5-mini",
apiKey: configuration["OPENAI_API_KEY"]!,
rpm: 60,
instructions: "Answer concisely.",
cancellationToken: cancellationToken);
(AIAgent? agent, IMafPoolEntry? entry) =
await pool.GetAvailable("chat", cancellationToken);
Omit endpoint for OpenAI's default service. A custom endpoint must expose an API compatible with the OpenAI .NET chat client.
What you get
MafPoolOpenAIExtension— Provides OpenAI-specific registration extensions forIMafPool, enabling integration via Microsoft Agent Framework.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
MafPoolOpenAIExtension.AddOpenAI(pool, poolId, key, modelId, apiKey, endpoint, rps, rpm, rpd, tokensPerDay, instructions, cancellationToken) |
Registers an OpenAI model in the agent pool with optional rate/token limits. | A task that completes when the openai addition is complete. |
MafPoolOpenAIExtension.RemoveOpenAI(pool, poolId, key, cancellationToken) |
Unregisters an OpenAI model from the agent pool and removes the associated cache entry. | True if the entry existed and was removed; false if it was not present. |
Practical notes
- The agent is created lazily and reused until its entry is removed.
- Store the API key in a secret provider; the pool retains it in the entry options while the entry is registered.
- Omitted instructions default to
You are a helpful assistant. - Checkout consumes one request from the configured quota.
tokensPerDayis not reconciled against actual provider token usage.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net11.0
- Microsoft.Extensions.AI.OpenAI (>= 11.0.0)
- Soenneker.Maf.Pool (>= 11.0.203)
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 |
|---|---|---|
| 11.0.231 | 40 | 11/15/2026 |
| 11.0.230 | 150 | 11/11/2026 |
| 11.0.229 | 66 | 11/11/2026 |
| 11.0.228 | 66 | 11/11/2026 |
| 11.0.227 | 47 | 11/11/2026 |
| 11.0.226 | 54 | 11/11/2026 |
| 11.0.225 | 61 | 11/11/2026 |
| 11.0.224 | 160 | 11/7/2026 |
| 11.0.223 | 222 | 11/3/2026 |
| 11.0.222 | 105 | 11/3/2026 |
| 11.0.221 | 103 | 11/2/2026 |
| 11.0.220 | 128 | 10/31/2026 |
| 11.0.219 | 111 | 10/30/2026 |
| 11.0.218 | 152 | 10/27/2026 |
| 11.0.217 | 94 | 10/27/2026 |
| 11.0.216 | 99 | 10/27/2026 |
| 11.0.215 | 97 | 10/27/2026 |
| 11.0.214 | 108 | 10/27/2026 |
| 11.0.213 | 102 | 10/26/2026 |
| 11.0.212 | 99 | 10/26/2026 |
Loading failed
Updated Soenneker.Maf.Pool to 11.0.203