Incursa.OpenAI.ChatKit
3.0.5
dotnet add package Incursa.OpenAI.ChatKit --version 3.0.5
NuGet\Install-Package Incursa.OpenAI.ChatKit -Version 3.0.5
<PackageReference Include="Incursa.OpenAI.ChatKit" Version="3.0.5" />
<PackageVersion Include="Incursa.OpenAI.ChatKit" Version="3.0.5" />
<PackageReference Include="Incursa.OpenAI.ChatKit" />
paket add Incursa.OpenAI.ChatKit --version 3.0.5
#r "nuget: Incursa.OpenAI.ChatKit, 3.0.5"
#:package Incursa.OpenAI.ChatKit@3.0.5
#addin nuget:?package=Incursa.OpenAI.ChatKit&version=3.0.5
#tool nuget:?package=Incursa.OpenAI.ChatKit&version=3.0.5
Incursa.OpenAI.ChatKit
Incursa.OpenAI.ChatKit is the core .NET runtime for ChatKit.
It contains the protocol models, request routing, thread and item primitives, streaming event types, store abstractions, and server base classes used to implement a ChatKit-compatible backend in .NET.
Choose this package when
- you need the ChatKit protocol and server runtime in a non-ASP.NET Core host
- you want to own the HTTP layer yourself
- you are building stores, server logic, or tests against the ChatKit model
- you plan to pair it with
Incursa.OpenAI.ChatKit.AspNetCorefor HTTP endpoints or Razor UI hosting
If you want ASP.NET Core endpoint mapping or Razor tag helpers, install Incursa.OpenAI.ChatKit.AspNetCore as well.
What this package includes
- ChatKit request, response, event, item, widget, and primitive models
ChatKitServer<TContext>for request routing and response generationChatKitProcessResult,StreamingResult, andNonStreamingResult- store abstractions and the in-memory implementation
- helper types for widgets and agent integration
WidgetDefinitionloaders andBuild(...)support for exported.widgetfiles, their encoded widget payloads, schema validation, and Jinja-backed rendering intoWidgetRoot
Minimal example
using Incursa.OpenAI.ChatKit;
InMemoryChatKitStore<Dictionary<string, object?>> store = new();
DemoChatKitServer server = new(store);
byte[] requestBytes = ChatKitJson.SerializeToUtf8Bytes<ChatKitRequest>(new ThreadsGetByIdRequest
{
Params = new ThreadGetByIdParams
{
ThreadId = "thr_1",
},
});
ChatKitProcessResult result = await server.ProcessAsync(
requestBytes,
new Dictionary<string, object?>(),
CancellationToken.None);
public sealed class DemoChatKitServer : ChatKitServer<Dictionary<string, object?>>
{
public DemoChatKitServer(InMemoryChatKitStore<Dictionary<string, object?>> store)
: base(store)
{
}
public override async IAsyncEnumerable<ThreadStreamEvent> RespondAsync(
ThreadMetadata thread,
UserMessageItem? inputUserMessage,
Dictionary<string, object?> context,
[System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default)
{
yield return new ThreadItemDoneEvent
{
Item = new AssistantMessageItem
{
Id = "msg_1",
ThreadId = thread.Id,
CreatedAt = ChatKitClock.Now(),
Content = [new AssistantMessageContent { Text = "Hello from ChatKit." }],
},
};
await Task.CompletedTask;
}
}
Pairing with ASP.NET Core
For ASP.NET Core hosts:
- install
Incursa.OpenAI.ChatKit - install
Incursa.OpenAI.ChatKit.AspNetCore - register your
ChatKitServer<TContext> - map
MapChatKit<TServer, TContext>(...)
Compatibility and scope
- Targets
.NET 10 - Translates the maintained server-side surface from
openai/chatkit-python - Keeps the core runtime separate from ASP.NET Core-specific hosting concerns
Related package
Incursa.OpenAI.ChatKit.AspNetCore: ASP.NET Core endpoint mapping, Razor tag helpers, and packaged browser assets
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Incursa.Jinja (>= 1.0.18)
- Incursa.OpenAI.Agents (>= 2.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Incursa.OpenAI.ChatKit:
| Package | Downloads |
|---|---|
|
Incursa.OpenAI.ChatKit.AspNetCore
ASP.NET Core hosting, Razor tag helpers, and packaged UI assets for Incursa.OpenAI.ChatKit. |
GitHub repositories
This package is not used by any popular GitHub repositories.