Soenneker.OpenAI.Client.Chat 2.1.172

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.OpenAI.Client.Chat --version 2.1.172                
NuGet\Install-Package Soenneker.OpenAI.Client.Chat -Version 2.1.172                
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="2.1.172" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.OpenAI.Client.Chat --version 2.1.172                
#r "nuget: Soenneker.OpenAI.Client.Chat, 2.1.172"                
#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.
// Install Soenneker.OpenAI.Client.Chat as a Cake Addin
#addin nuget:?package=Soenneker.OpenAI.Client.Chat&version=2.1.172

// Install Soenneker.OpenAI.Client.Chat as a Cake Tool
#tool nuget:?package=Soenneker.OpenAI.Client.Chat&version=2.1.172                

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.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 Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.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
2.1.289 26 10/18/2024
2.1.288 30 10/17/2024
2.1.287 27 10/17/2024
2.1.286 30 10/17/2024
2.1.285 26 10/17/2024
2.1.284 44 10/15/2024
2.1.283 41 10/15/2024
2.1.282 58 10/15/2024
2.1.281 57 10/15/2024
2.1.280 61 10/14/2024
2.1.279 62 10/14/2024
2.1.278 64 10/12/2024
2.1.277 61 10/12/2024
2.1.276 61 10/12/2024
2.1.275 63 10/11/2024
2.1.274 65 10/11/2024
2.1.273 75 10/11/2024
2.1.272 69 10/9/2024
2.1.271 66 10/9/2024
2.1.270 63 10/9/2024
2.1.269 63 10/9/2024
2.1.268 65 10/9/2024
2.1.267 60 10/9/2024
2.1.266 71 10/8/2024
2.1.265 65 10/8/2024
2.1.264 68 10/8/2024
2.1.263 67 10/8/2024
2.1.262 62 10/8/2024
2.1.261 66 10/8/2024
2.1.260 62 10/8/2024
2.1.259 61 10/8/2024
2.1.258 64 10/8/2024
2.1.257 62 10/3/2024
2.1.256 50 10/3/2024
2.1.255 62 10/3/2024
2.1.254 63 10/3/2024
2.1.253 60 10/3/2024
2.1.252 61 10/3/2024
2.1.251 60 10/3/2024
2.1.250 63 10/3/2024
2.1.249 57 10/3/2024
2.1.248 61 10/2/2024
2.1.247 64 10/2/2024
2.1.246 62 10/2/2024
2.1.245 60 10/2/2024
2.1.244 62 10/2/2024
2.1.243 57 10/2/2024
2.1.242 64 10/2/2024
2.1.241 63 10/2/2024
2.1.240 59 10/2/2024
2.1.239 64 10/2/2024
2.1.238 61 10/1/2024
2.1.237 62 10/1/2024
2.1.236 65 10/1/2024
2.1.235 61 10/1/2024
2.1.234 61 10/1/2024
2.1.233 62 10/1/2024
2.1.232 64 10/1/2024
2.1.231 63 10/1/2024
2.1.230 63 10/1/2024
2.1.229 41 9/30/2024
2.1.228 42 9/29/2024
2.1.227 40 9/29/2024
2.1.226 40 9/29/2024
2.1.225 36 9/29/2024
2.1.224 38 9/29/2024
2.1.223 39 9/29/2024
2.1.222 42 9/29/2024
2.1.221 40 9/29/2024
2.1.220 40 9/29/2024
2.1.219 43 9/28/2024
2.1.218 36 9/27/2024
2.1.217 35 9/27/2024
2.1.216 41 9/27/2024
2.1.215 42 9/27/2024
2.1.214 42 9/27/2024
2.1.213 37 9/27/2024
2.1.212 39 9/27/2024
2.1.211 38 9/27/2024
2.1.210 40 9/27/2024
2.1.209 42 9/27/2024
2.1.208 40 9/27/2024
2.1.207 40 9/26/2024
2.1.206 37 9/26/2024
2.1.205 39 9/26/2024
2.1.204 38 9/26/2024
2.1.203 38 9/26/2024
2.1.202 38 9/26/2024
2.1.201 36 9/26/2024
2.1.200 41 9/26/2024
2.1.199 40 9/26/2024
2.1.198 41 9/26/2024
2.1.197 38 9/26/2024
2.1.195 42 9/26/2024
2.1.194 38 9/26/2024
2.1.193 40 9/23/2024
2.1.192 40 9/23/2024
2.1.191 40 9/23/2024
2.1.190 40 9/23/2024
2.1.189 37 9/23/2024
2.1.188 44 9/23/2024
2.1.187 40 9/23/2024
2.1.186 39 9/23/2024
2.1.185 40 9/23/2024
2.1.184 37 9/23/2024
2.1.183 43 9/23/2024
2.1.182 37 9/23/2024
2.1.181 42 9/23/2024
2.1.180 34 9/23/2024
2.1.179 40 9/23/2024
2.1.178 39 9/23/2024
2.1.177 35 9/23/2024
2.1.176 45 9/23/2024
2.1.175 40 9/23/2024
2.1.174 38 9/23/2024
2.1.173 36 9/23/2024
2.1.172 32 9/20/2024
2.1.171 39 9/18/2024
2.1.170 41 9/18/2024
2.1.169 41 9/18/2024
2.1.168 33 9/18/2024
2.1.167 41 9/18/2024
2.1.166 39 9/18/2024
2.1.165 37 9/18/2024
2.1.163 42 9/17/2024
2.1.162 41 9/17/2024
2.1.161 37 9/17/2024
2.1.160 36 9/17/2024
2.1.159 41 9/17/2024
2.1.158 42 9/17/2024
2.1.157 36 9/17/2024
2.1.156 36 9/17/2024
2.1.155 38 9/17/2024
2.1.154 38 9/17/2024
2.1.153 34 9/17/2024
2.1.152 37 9/17/2024
2.1.151 44 9/17/2024
2.1.150 38 9/17/2024
2.1.149 42 9/17/2024
2.1.148 45 9/17/2024
2.1.147 37 9/17/2024
2.1.146 40 9/17/2024
2.1.145 38 9/16/2024
2.1.144 60 9/16/2024
2.1.143 48 9/16/2024
2.1.142 50 9/16/2024
2.1.141 43 9/16/2024
2.1.140 44 9/12/2024
2.1.139 42 9/12/2024
2.1.138 46 9/12/2024
2.1.137 42 9/12/2024
2.1.136 44 9/12/2024
2.1.135 49 9/12/2024
2.1.134 47 9/11/2024
2.1.133 47 9/11/2024
2.1.132 49 9/11/2024
2.1.131 43 9/11/2024
2.1.130 48 9/11/2024
2.1.129 47 9/11/2024
2.1.128 48 9/11/2024
2.1.127 45 9/11/2024
2.1.125 48 9/11/2024
2.1.123 49 9/11/2024
2.1.122 43 9/11/2024
2.1.121 46 9/11/2024
2.1.120 46 9/11/2024
2.1.119 50 9/10/2024
2.1.118 40 9/10/2024
2.1.117 45 9/10/2024
2.1.116 41 9/10/2024
2.1.115 41 9/10/2024
2.1.114 40 9/10/2024
2.1.113 48 9/10/2024
2.1.112 41 9/9/2024
2.1.111 43 9/9/2024
2.1.108 43 9/9/2024
2.1.105 49 9/9/2024
2.1.104 45 9/9/2024
2.1.103 45 9/9/2024
2.1.102 41 9/9/2024
2.1.101 43 9/9/2024
2.1.100 43 9/9/2024
2.1.99 41 9/9/2024
2.1.98 51 9/9/2024
2.1.97 45 9/7/2024
2.1.96 47 9/7/2024
2.1.95 48 9/7/2024
2.1.94 45 9/7/2024
2.1.93 42 9/7/2024
2.1.92 52 9/6/2024
2.1.91 47 9/6/2024
2.1.90 46 9/6/2024
2.1.89 48 9/6/2024
2.1.88 46 9/6/2024
2.1.87 47 9/5/2024
2.1.86 37 9/5/2024
2.1.85 46 9/5/2024
2.1.84 45 9/5/2024
2.1.83 41 9/5/2024
2.1.82 46 9/5/2024
2.1.81 51 9/5/2024
2.1.80 48 9/5/2024
2.1.79 50 9/5/2024
2.1.78 45 9/5/2024
2.1.77 47 9/5/2024
2.1.76 47 9/5/2024
2.1.75 47 9/5/2024
2.1.74 44 9/5/2024
2.1.73 47 9/4/2024
2.1.72 40 9/4/2024
2.1.71 50 9/4/2024
2.1.70 46 9/4/2024
2.1.69 45 9/4/2024
2.1.68 46 9/4/2024
2.1.67 48 9/3/2024
2.1.66 46 9/3/2024
2.1.65 47 9/3/2024
2.1.64 43 9/3/2024
2.1.63 52 9/3/2024
2.1.62 44 9/3/2024
2.1.61 45 9/3/2024
2.1.60 41 9/3/2024
2.1.59 41 9/3/2024
2.1.58 43 9/3/2024
2.1.57 41 9/3/2024
2.1.56 48 8/29/2024
2.1.55 49 8/29/2024
2.1.54 46 8/29/2024
2.1.53 43 8/29/2024
2.1.52 41 8/29/2024
2.1.51 55 8/26/2024
2.1.50 46 8/26/2024
2.1.49 48 8/26/2024
2.1.48 51 8/26/2024
2.1.47 65 8/24/2024
2.1.46 75 8/21/2024
2.1.45 69 8/21/2024
2.1.44 59 8/21/2024
2.1.43 70 8/21/2024
2.1.42 73 8/20/2024
2.1.41 67 8/20/2024
2.1.40 59 8/20/2024
2.1.39 54 8/20/2024
2.1.38 56 8/20/2024
2.1.37 55 8/20/2024
2.1.36 68 8/20/2024
2.1.35 60 8/19/2024
2.1.34 71 8/15/2024
2.1.33 63 8/15/2024
2.1.32 64 8/15/2024
2.1.31 72 8/15/2024
2.1.30 68 8/13/2024
2.1.29 64 8/13/2024
2.1.28 48 8/7/2024
2.1.27 42 8/6/2024
2.1.26 34 8/6/2024
2.1.25 34 8/6/2024
2.1.24 49 8/1/2024
2.1.23 44 8/1/2024
2.1.22 46 8/1/2024
2.1.21 47 8/1/2024
2.1.20 47 8/1/2024
2.1.19 36 7/31/2024
2.1.18 40 7/26/2024
2.1.17 52 7/25/2024
2.1.16 49 7/25/2024
2.1.15 45 7/24/2024
2.1.14 41 7/24/2024
2.1.13 49 7/24/2024
2.1.12 50 7/24/2024
2.1.11 56 7/20/2024
2.1.10 54 7/20/2024
2.1.9 52 7/20/2024
2.1.8 56 7/20/2024
2.1.7 59 7/20/2024
2.1.6 47 7/15/2024
2.1.5 61 7/14/2024
2.1.4 56 7/14/2024
2.1.3 46 7/12/2024
2.1.2 48 7/12/2024
2.1.1 44 7/12/2024