Aiursoft.GptClient
9.0.37
dotnet add package Aiursoft.GptClient --version 9.0.37
NuGet\Install-Package Aiursoft.GptClient -Version 9.0.37
<PackageReference Include="Aiursoft.GptClient" Version="9.0.37" />
<PackageVersion Include="Aiursoft.GptClient" Version="9.0.37" />
<PackageReference Include="Aiursoft.GptClient" />
paket add Aiursoft.GptClient --version 9.0.37
#r "nuget: Aiursoft.GptClient, 9.0.37"
#:package Aiursoft.GptClient@9.0.37
#addin nuget:?package=Aiursoft.GptClient&version=9.0.37
#tool nuget:?package=Aiursoft.GptClient&version=9.0.37
Aiursoft GptClient
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:
using Aiursoft.GptClient;
using Aiursoft.GptClient.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Test
{
public abstract class Program
{
public static async Task Main()
{
// Keys
var apiKey = "";
var endpoint = "http://localhost:11434/api/chat";
var model = "qwen3:30b-a3b-thinking-2507-q8_0";
// Create a simple ChatGpt client.
var services = new ServiceCollection();
services.AddHttpClient();
services.AddLogging(logging => { logging.SetMinimumLevel(LogLevel.Warning); });
services.AddGptClient();
var serviceProvider = services.BuildServiceProvider();
var chatClient = serviceProvider.GetRequiredService<ChatClient>();
async Task<string> GetAnswer(string[] prompts)
{
return (await chatClient.AskString(
modelType: model,
completionApiUrl: endpoint,
token: apiKey,
content: prompts,
CancellationToken.None)).GetAnswerPart();
}
// Example usage
var answer = await GetAnswer(["Why is the sky blue?"]);
Console.WriteLine(answer);
}
}
}
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 | Versions 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. |
-
net9.0
- Aiursoft.CSTools (>= 9.0.3)
- Aiursoft.GptClient.Abstractions (>= 9.0.34)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
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 |
---|---|---|
9.0.37 | 28 | 9/4/2025 |
9.0.36 | 215 | 8/5/2025 |
9.0.35 | 146 | 7/9/2025 |
9.0.34 | 114 | 7/4/2025 |
9.0.33 | 112 | 7/4/2025 |
9.0.32 | 113 | 7/4/2025 |
9.0.31 | 112 | 7/4/2025 |
9.0.30 | 117 | 7/4/2025 |
9.0.29 | 140 | 6/25/2025 |
9.0.27 | 287 | 6/11/2025 |
9.0.26 | 286 | 6/11/2025 |
9.0.25 | 110 | 6/1/2025 |
9.0.24 | 185 | 4/9/2025 |
9.0.23 | 174 | 4/8/2025 |
9.0.22 | 162 | 4/7/2025 |
9.0.21 | 169 | 4/7/2025 |
9.0.20 | 163 | 3/31/2025 |
9.0.19 | 153 | 3/31/2025 |
9.0.18 | 152 | 3/31/2025 |
9.0.17 | 161 | 3/31/2025 |
9.0.16 | 158 | 3/31/2025 |
9.0.15 | 164 | 3/31/2025 |
9.0.14 | 154 | 3/31/2025 |
9.0.13 | 162 | 3/31/2025 |
9.0.12 | 155 | 3/31/2025 |
9.0.11 | 159 | 3/31/2025 |
9.0.10 | 149 | 3/31/2025 |
9.0.9 | 158 | 3/31/2025 |
9.0.8 | 168 | 3/12/2025 |
9.0.7 | 115 | 3/3/2025 |
9.0.6 | 107 | 3/3/2025 |
9.0.5 | 142 | 2/23/2025 |
9.0.4 | 127 | 2/12/2025 |
9.0.3 | 129 | 2/2/2025 |
9.0.0 | 135 | 2/2/2025 |