TokenGuard.Core
1.0.0
See the version list below for details.
dotnet add package TokenGuard.Core --version 1.0.0
NuGet\Install-Package TokenGuard.Core -Version 1.0.0
<PackageReference Include="TokenGuard.Core" Version="1.0.0" />
<PackageVersion Include="TokenGuard.Core" Version="1.0.0" />
<PackageReference Include="TokenGuard.Core" />
paket add TokenGuard.Core --version 1.0.0
#r "nuget: TokenGuard.Core, 1.0.0"
#:package TokenGuard.Core@1.0.0
#addin nuget:?package=TokenGuard.Core&version=1.0.0
#tool nuget:?package=TokenGuard.Core&version=1.0.0
TokenGuard.Core
Core TokenGuard package for .NET 10 agent loops. Tracks conversation growth, prepares provider-ready snapshots, and compacts older history when token pressure builds.
Install
dotnet add package TokenGuard.Core
Use
services.AddConversationContext(builder => builder
.WithMaxTokens(25_000)
.WithCompactionThreshold(0.80));
using var conversation = serviceProvider
.GetRequiredService<IConversationContextFactory>()
.Create();
conversation.SetSystemPrompt("You are a careful coding assistant.");
conversation.AddUserMessage("Summarize repo status.");
var prepared = await conversation.PrepareAsync(cancellationToken);
Add TokenGuard.Extensions.OpenAI or TokenGuard.Extensions.Anthropic when you need provider adapters or LLM-backed summarization.
| 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
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TokenGuard.Core:
| Package | Downloads |
|---|---|
|
TokenGuard.Extensions.Anthropic
Anthropic integration for TokenGuard on .NET 10. Converts prepared TokenGuard messages to Anthropic request parts and lets TokenGuard use Anthropic to summarize older history when context gets tight. |
|
|
TokenGuard.Extensions.OpenAI
OpenAI integration for TokenGuard on .NET 10. Converts prepared TokenGuard messages to OpenAI chat messages and lets TokenGuard use OpenAI to summarize older history when context gets tight. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial public release of TokenGuard core. Includes token budget tracking, sliding-window masking, optional LLM summarization support, pinned messages, and emergency truncation safeguards.