Aiursoft.GptClient.Abstractions 9.0.22

dotnet add package Aiursoft.GptClient.Abstractions --version 9.0.22
                    
NuGet\Install-Package Aiursoft.GptClient.Abstractions -Version 9.0.22
                    
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="Aiursoft.GptClient.Abstractions" Version="9.0.22" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aiursoft.GptClient.Abstractions" Version="9.0.22" />
                    
Directory.Packages.props
<PackageReference Include="Aiursoft.GptClient.Abstractions" />
                    
Project file
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 Aiursoft.GptClient.Abstractions --version 9.0.22
                    
#r "nuget: Aiursoft.GptClient.Abstractions, 9.0.22"
                    
#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.
#addin nuget:?package=Aiursoft.GptClient.Abstractions&version=9.0.22
                    
Install as a Cake Addin
#tool nuget:?package=Aiursoft.GptClient.Abstractions&version=9.0.22
                    
Install as a Cake Tool

Aiursoft GptClient

MIT licensed Pipeline stat Test Coverage NuGet version (Aiursoft.GptClient) NuGet version (Aiursoft.GptClient.ChatConsole) ManHours

The SDK for ChatGpt. Simple implementation and easy to use.

How to install

First, install Aiursoft.GptClient to your ASP.NET Core project from nuget.org:

dotnet add package Aiursoft.GptClient

Exposed API in ChatClient:

public Task<CompletionData> AskModel(OpenAiModel model);
public Task<CompletionData> AskString(string gptModelType, params string[] content);

Required IConfiguration keys:

{
    "OpenAI:Token": "YourOpenAIKey",
    "OpenAI:CompletionApiUrl": "https://api.openai.com/v1/engines/davinci/completions"
}

For example, you can use the following code to create a simple ChatGpt client:

var model = GptModel.DeepseekR170B;
var services = new ServiceCollection();
services.AddHttpClient();
services.AddLogging(logging =>
{
    logging.SetMinimumLevel(LogLevel.Warning);
});
services.AddGptClient();
var serviceProvider = services.BuildServiceProvider();
var chatClient = serviceProvider.GetRequiredService<ChatClient>();

var history = new OpenAiModel
{
    Model = modelName
};
while (true)
{
    var nextQuestion = AskUser("USER:", null);
    history.Messages.Add(new MessagesItem
    {
        Role = "user",
        Content = nextQuestion
    });

    var result = await chatClient.AskModel(history, endpoint, apiKey);
    Console.WriteLine("AI:");
    Console.WriteLine(result.GetAnswerPart());
    
    history.Messages.Add(new MessagesItem
    {
        Role = "assistant",
        Content = result.GetAnswerPart()
    });
}

Now you have built a simple ChatGpt client.

How to contribute

There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.

Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.

We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aiursoft.GptClient.Abstractions:

Package Downloads
Aiursoft.GptClient

Automatic dependencies management system which powers Aiursoft

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.22 99 6/25/2025
9.0.20 211 3/31/2025
9.0.19 147 3/31/2025
9.0.18 160 3/31/2025
9.0.17 157 3/31/2025
9.0.16 156 3/31/2025
9.0.11 192 3/31/2025
9.0.10 162 3/31/2025
9.0.9 157 3/31/2025
9.0.7 114 3/3/2025
9.0.0 180 2/2/2025