OpenAIToolkit 1.0.0
See the version list below for details.
dotnet add package OpenAIToolkit --version 1.0.0
NuGet\Install-Package OpenAIToolkit -Version 1.0.0
<PackageReference Include="OpenAIToolkit" Version="1.0.0" />
<PackageVersion Include="OpenAIToolkit" Version="1.0.0" />
<PackageReference Include="OpenAIToolkit" />
paket add OpenAIToolkit --version 1.0.0
#r "nuget: OpenAIToolkit, 1.0.0"
#:package OpenAIToolkit@1.0.0
#addin nuget:?package=OpenAIToolkit&version=1.0.0
#tool nuget:?package=OpenAIToolkit&version=1.0.0
OpenAI Toolkit
OpenAI Toolkit is a .NET library designed to offer a simple and intuitive way to interact with the OpenAI API, making it easier to incorporate OpenAI's advanced language models into your .NET applications.
Features
This library comes with a range of features designed to streamline the process of integrating OpenAI's capabilities into your projects, including:
- Support for OpenAI's Chat Completion API: Directly access one of the most powerful features of the OpenAI API.
- Easy-to-use Client: A straightforward client interface for making API requests without hassle.
- Strongly-typed Request and Response DTOs: Ensures type safety and easier handling of data.
- Comprehensive Error Handling and Logging: Provides detailed insights into the workings and issues for easier debugging.
- Asynchronous Methods: Support for non-blocking API calls to enhance application performance.
- Extensible Design: Built with flexibility in mind, allowing for future additions of other OpenAI APIs.
Installation
The OpenAI Toolkit can be seamlessly integrated into your project using either NuGet Package Manager or the .NET CLI.
Via NuGet Package Manager
For those using Visual Studio, the library can be installed directly through the NuGet Package Manager by executing the following command:
Using .NET CLI
Alternatively, the package can be added using the .NET CLI with the command below:
Usage
To begin utilizing the OpenAI Toolkit within your application, you'll need to instantiate the OpenAIClient class with your OpenAI API key and an ILogger instance as demonstrated in the following snippet:
var apiKey = Configuration["OpenAIApiKey"];
var loggerFactory = LoggerFactory.Create(builder => {
builder.AddConsole(); // Additional logging providers can be configured as needed.
});
var logger = loggerFactory.CreateLogger<OpenAIClient>();
var client = new OpenAIClient(apiKey, logger);
var request = new ChatCompletionRequest {
Model = "gpt-3.5-turbo",
Messages = new List<ChatMessage> {
new ChatMessage { Role = "system", Content = "You are a helpful assistant." },
new ChatMessage { Role = "user", Content = "Hello! How are you?" }
}
};
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.