Soenneker.OpenAI.Client.Chat 2.1.248

Prefix Reserved
dotnet add package Soenneker.OpenAI.Client.Chat --version 2.1.248                
NuGet\Install-Package Soenneker.OpenAI.Client.Chat -Version 2.1.248                
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.248" />                
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.248                
#r "nuget: Soenneker.OpenAI.Client.Chat, 2.1.248"                
#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.248

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

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