Soenneker.Maf.Pool.OpenAI 4.0.153

Prefix Reserved
dotnet add package Soenneker.Maf.Pool.OpenAI --version 4.0.153
                    
NuGet\Install-Package Soenneker.Maf.Pool.OpenAI -Version 4.0.153
                    
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="4.0.153" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Maf.Pool.OpenAI" Version="4.0.153" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Maf.Pool.OpenAI" />
                    
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 Soenneker.Maf.Pool.OpenAI --version 4.0.153
                    
#r "nuget: Soenneker.Maf.Pool.OpenAI, 4.0.153"
                    
#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@4.0.153
                    
#: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=4.0.153
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Maf.Pool.OpenAI&version=4.0.153
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 for IMafPool, 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. tokensPerDay is not reconciled against actual provider token usage.
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
4.0.153 36 9/10/2026
4.0.152 43 9/9/2026
4.0.151 49 9/8/2026
4.0.150 76 9/8/2026
4.0.149 86 9/7/2026
4.0.148 83 9/7/2026
4.0.147 103 9/5/2026
4.0.146 84 9/4/2026
4.0.145 82 9/4/2026
4.0.144 88 9/4/2026
4.0.143 101 9/1/2026
4.0.142 81 8/31/2026
4.0.141 87 8/31/2026
4.0.140 90 8/31/2026
4.0.139 91 8/31/2026
4.0.138 100 8/30/2026
4.0.137 92 8/30/2026
4.0.136 91 8/30/2026
4.0.135 97 8/29/2026
4.0.134 90 8/29/2026
Loading failed

Updated Soenneker.Maf.Pool to 4.0.138