Soenneker.SemanticKernel.Pool.OpenAi 4.0.645

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.SemanticKernel.Pool.OpenAi --version 4.0.645
                    
NuGet\Install-Package Soenneker.SemanticKernel.Pool.OpenAi -Version 4.0.645
                    
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.SemanticKernel.Pool.OpenAi" Version="4.0.645" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SemanticKernel.Pool.OpenAi" Version="4.0.645" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.SemanticKernel.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.SemanticKernel.Pool.OpenAi --version 4.0.645
                    
#r "nuget: Soenneker.SemanticKernel.Pool.OpenAi, 4.0.645"
                    
#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.SemanticKernel.Pool.OpenAi@4.0.645
                    
#: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.SemanticKernel.Pool.OpenAi&version=4.0.645
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SemanticKernel.Pool.OpenAi&version=4.0.645
                    
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.SemanticKernel.Pool.OpenAi

OpenAI connector registration helpers for Soenneker.SemanticKernel.Pool.

Installation

dotnet add package Soenneker.SemanticKernel.Pool.OpenAi

Add an OpenAI entry

Resolve the pool and HTTP client cache from dependency injection, then register an entry:

using Soenneker.SemanticKernel.Enums.KernelType;
using Soenneker.SemanticKernel.Pool.OpenAi;

await pool.AddOpenAi(
    poolId: "chat",
    key: "openai-primary",
    type: KernelType.Chat,
    modelId: "chat-model-id",
    apiKey: configuration["OpenAI:ApiKey"]!,
    endpoint: "https://api.openai.com/v1",
    httpClientCache: httpClientCache,
    rps: 2,
    rpm: 60,
    rpd: 1_000,
    tokensPerDay: null,
    cancellationToken);

Supported types are:

  • KernelType.Chat for chat completion
  • KernelType.Embedding for embedding generation
  • KernelType.Audio for text-to-audio
  • KernelType.Image for text-to-image

Other types throw NotSupportedException when the pool first constructs the kernel.

Chat and embedding create an OpenAIClient using the supplied endpoint. Audio and image use Semantic Kernel connector overloads that receive the API key and cached HttpClient, but this adapter does not apply the supplied endpoint to those paths. Use this package's audio/image registrations only when the connector's default endpoint is appropriate.

The HTTP client is cached under openai:{poolId}:{key} with a five-minute timeout. Pool quota values are reservations made when GetAvailable selects the entry. tokensPerDay counts one unit per acquisition; it is not populated from provider token usage.

Remove the entry

Use the matching helper so both the pool entry and cached HTTP client are removed:

await pool.RemoveOpenAi(
    "chat",
    "openai-primary",
    httpClientCache,
    cancellationToken);

Keep the API key in a protected configuration provider and avoid logging or serializing the generated SemanticKernelOptions.

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.652 36 10/15/2026
4.0.651 36 10/15/2026
4.0.650 48 10/15/2026
4.0.648 49 10/14/2026
4.0.646 52 10/14/2026
4.0.645 50 10/14/2026
4.0.644 55 10/14/2026
4.0.637 56 10/13/2026
4.0.636 53 10/13/2026
4.0.635 51 10/13/2026
4.0.634 66 10/12/2026
4.0.633 62 10/12/2026
4.0.632 63 10/12/2026
4.0.630 62 10/12/2026
4.0.629 59 10/12/2026
4.0.628 71 10/11/2026
4.0.627 71 10/11/2026
4.0.626 69 10/11/2026
4.0.625 76 10/11/2026
4.0.624 108 10/6/2026
Loading failed

Update dependency dotnet-sdk to v10.0.402 (#1183)