SubgenAI.SerenityStar.SDK.Extensions
1.0.0
See the version list below for details.
dotnet add package SubgenAI.SerenityStar.SDK.Extensions --version 1.0.0
NuGet\Install-Package SubgenAI.SerenityStar.SDK.Extensions -Version 1.0.0
<PackageReference Include="SubgenAI.SerenityStar.SDK.Extensions" Version="1.0.0" />
<PackageVersion Include="SubgenAI.SerenityStar.SDK.Extensions" Version="1.0.0" />
<PackageReference Include="SubgenAI.SerenityStar.SDK.Extensions" />
paket add SubgenAI.SerenityStar.SDK.Extensions --version 1.0.0
#r "nuget: SubgenAI.SerenityStar.SDK.Extensions, 1.0.0"
#:package SubgenAI.SerenityStar.SDK.Extensions@1.0.0
#addin nuget:?package=SubgenAI.SerenityStar.SDK.Extensions&version=1.0.0
#tool nuget:?package=SubgenAI.SerenityStar.SDK.Extensions&version=1.0.0
<p align="center"> <a href="https://serenitystar.ai/"> <h1 align="center">Serenity* AIHub SDK for .NET</h1> </a> </p>
<p align="center"> <a aria-label="try Serenity* AIHub" href="https://hub.serenitystar.ai/Identity/Account/Register"><b>Try Serenity AIHub</b></a> • <a aria-label="Serenity* documentation" href="https://docs.serenitystar.ai">Read the Documentation</a> • <a aria-label="Serenity* blog" href="https://docs.serenitystar.ai/blog">Learn more on our blog</a> • <a aria-label="Serenity* Discord channel" href="https://discord.gg/SrT3xP7tS8">Chat with us on Discord</a> </p>
Introduction
Official .NET SDK for Serenity AIHub API. This SDK provides a convenient way to interact with Serenity AIHub services from your .NET applications, allowing you to create conversations, send messages, and execute commands through a clean and intuitive interface.
🚀 Installation
Install the Serenity* AIHub SDK via NuGet:
dotnet add package SubgenAI.SerenityStar.SDK
If you want to use dependency injection:
dotnet add package SubgenAI.SerenityStar.SDK.Extensions
🔧 Usage
Direct Instantiation
Create and use the client directly by providing your API key:
using Serenity.AIHub.SDK.NET.Core.Client;
var client = SerenityAIHubClient.Create("your-api-key");
var conversation = await client.CreateConversation("assistantagent", null);
var response = await client.SendMessage("assistantagent", conversation.ChatId, "Hello!");
Using Dependency Injection
Register the client in your service collection:
// In your startup/program.cs
using Serenity.AIHub.SDK.NET.Extensions;
services.AddSerenityAIHub("your-api-key");
Inject and use the client in your services:
// In your service/controller
public class YourService
{
private readonly ISerenityAIHubClient _client;
public YourService(ISerenityAIHubClient client)
{
_client = client;
}
public async Task DoSomething()
{
var conversation = await _client.CreateConversation("assistantagent");
List<ExecuteParameter> input = [];
input.Add(new(
"chatId",
conversation.ChatId
));
input.Add(new(
"message",
"Hello, how are you?"
));
var response = await _client.Execute("assistantagent", input);
}
}
📚 Documentation
<p>Learn more about Serenity AIHub <a aria-label="serenity documentation" href="https://docs.serenitystar.ai">in our official docs!</a></p>
🗺 Project Structure
src/Serenity.AIHub.SDK.NET.Core
- Core SDK packagesrc/Serenity.AIHub.SDK.NET.Extensions
- Extension methods for dependency injectiontests
- Test projects for the SDK
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- SubgenAI.SerenityStar.SDK (>= 1.0.1)
-
net7.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- SubgenAI.SerenityStar.SDK (>= 1.0.1)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- SubgenAI.SerenityStar.SDK (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.