Soenneker.OpenAI.Client.Chat
4.0.1161
Prefix Reserved
dotnet add package Soenneker.OpenAI.Client.Chat --version 4.0.1161
NuGet\Install-Package Soenneker.OpenAI.Client.Chat -Version 4.0.1161
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.OpenAI.Client.Chat" Version="4.0.1161" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.OpenAI.Client.Chat" Version="4.0.1161" />
<PackageReference Include="Soenneker.OpenAI.Client.Chat" />
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.OpenAI.Client.Chat --version 4.0.1161
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.OpenAI.Client.Chat, 4.0.1161"
#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.OpenAI.Client.Chat@4.0.1161
#: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.OpenAI.Client.Chat&version=4.0.1161
#tool nuget:?package=Soenneker.OpenAI.Client.Chat&version=4.0.1161
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.OpenAI.Client.Chat
An async thread-safe singleton for the OpenAI Chat (completions) client
This library provides an implementation for interacting with the OpenAI service. It allows you to configure and utilize a ChatClient to perform various tasks using OpenAI's models.
For the Azure version of this: Soenneker.Azure.OpenAI.Client.Chat
Installation
dotnet add package Soenneker.OpenAI.Client.Chat
Register:
builder.services.AddOpenAIChatClientAsSingleton();
IConfiguration values:
"OpenAI:ApiKey"
"OpenAI:Model"
Usage
public class OpenAIService
{
private readonly IOpenAIChatClient _chatClient;
public OpenAIService(IOpenAIChatClient chatClient)
{
_chatClient = chatClient;
}
public async ValueTask<string> Chat(string prompt, CancellationToken cancellationToken = default)
{
var client = await _chatClient.Get(cancellationToken);
ChatCompletion completion = await client.CompleteChatAsync(prompt);
}
}
| Product | Versions 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.
-
net10.0
- OpenAI (>= 2.8.0)
- Soenneker.Extensions.Configuration (>= 4.0.767)
- Soenneker.Utils.AsyncSingleton (>= 4.0.748)
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.1161 | 33 | 2/12/2026 |
| 4.0.1160 | 40 | 2/10/2026 |
| 4.0.1159 | 77 | 2/10/2026 |
| 4.0.1158 | 84 | 2/5/2026 |
| 4.0.1157 | 85 | 2/4/2026 |
| 4.0.1156 | 87 | 1/28/2026 |
| 4.0.1155 | 89 | 1/22/2026 |
| 4.0.1154 | 90 | 1/22/2026 |
| 4.0.1153 | 82 | 1/20/2026 |
| 4.0.1152 | 81 | 1/19/2026 |
| 4.0.1151 | 89 | 1/14/2026 |
| 4.0.1150 | 82 | 1/13/2026 |
| 4.0.1149 | 88 | 1/13/2026 |
| 4.0.1148 | 85 | 1/12/2026 |
| 4.0.1147 | 95 | 1/12/2026 |
| 4.0.1146 | 94 | 1/8/2026 |
| 4.0.1145 | 93 | 1/7/2026 |
| 4.0.1144 | 89 | 1/7/2026 |
| 4.0.1143 | 90 | 1/6/2026 |
| 4.0.1142 | 86 | 1/6/2026 |
Loading failed