Soenneker.OpenAI.Client.Chat 2.1.43

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.43                
NuGet\Install-Package Soenneker.OpenAI.Client.Chat -Version 2.1.43                
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.43" />                
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.43                
#r "nuget: Soenneker.OpenAI.Client.Chat, 2.1.43"                
#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.43

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

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