Frontmatec.AI.Tools
0.0.7
dotnet add package Frontmatec.AI.Tools --version 0.0.7
NuGet\Install-Package Frontmatec.AI.Tools -Version 0.0.7
<PackageReference Include="Frontmatec.AI.Tools" Version="0.0.7" />
<PackageVersion Include="Frontmatec.AI.Tools" Version="0.0.7" />
<PackageReference Include="Frontmatec.AI.Tools" />
paket add Frontmatec.AI.Tools --version 0.0.7
#r "nuget: Frontmatec.AI.Tools, 0.0.7"
#:package Frontmatec.AI.Tools@0.0.7
#addin nuget:?package=Frontmatec.AI.Tools&version=0.0.7
#tool nuget:?package=Frontmatec.AI.Tools&version=0.0.7
Frontmatec.AI
LLM agents, tools, prompts, and threads for building AI-powered .NET applications.
This repo ships two NuGet packages and is also browsable on GitHub:
- Frontmatec.AI — core agent loop, prompt templates, thread persistence, and provider clients (Anthropic, OpenAI, Gemini, Ollama).
- Frontmatec.AI.Windows — WPF chat, thread list, and tool-approval views built on
Frontmatec.Windows.
A small WPF test app (WINAI) wires both packages together as a reference.
API keys
Provider API keys are read from AI:Clients:{Provider}:ApiKey in IConfiguration. The test app pattern: declare the keys in appsettings.json with empty values, then override them in appsettings.Development.local.json (gitignored). Ollama runs locally and needs no key.
// appsettings.Development.local.json
{
"AI": {
"Clients": {
"Anthropic": { "ApiKey": "sk-ant-..." },
"OpenAI": { "ApiKey": "sk-proj-..." },
"Gemini": { "ApiKey": "AIza..." }
}
}
}
Roadmap
Two known gaps in the agent loop. Neither blocks current usage; both are pure additions.
Transient-error retry/backoff
The agent loop currently surfaces any client-side failure (429, 503, 529 overload, socket timeout) as a single LlmAgentClientErrorEvent and ends the turn — the host has to retry the whole user turn.
Plan: add retry at the HTTP layer, not the agent layer, so each provider client (AnthropicClient, OpenAIClient, GeminiClient, OllamaClient) retries with exponential backoff on transient signals before the first chunk is read (the only safe window for a streaming response — once a delta has been yielded to the UI, replaying would duplicate text). Options live per-client alongside TimeoutMinutes:
"AI": {
"Clients": {
"Anthropic": {
"Retry": { "MaxAttempts": 3, "BaseDelayMs": 500 }
}
}
}
Polly is the obvious dependency, but a ~10-line Task.Delay exponential-backoff wrapper inside each *Client.StreamAsync is enough at this scale.
Extended / interleaved thinking
Claude 4.x supports two reasoning features the loop doesn't currently expose:
- Extended thinking — opt-in per request via
"thinking": { "type": "enabled", "budget_tokens": 8000 }. The model emits a separatethinkingcontent-block stream before its visible answer. Costs extra output tokens; buys noticeably better quality on multi-step reasoning, math, and ambiguous tool selection. - Interleaved thinking — header-gated (
anthropic-beta: interleaved-thinking-2025-05-14). Lets the model think between tool calls in a ReAct loop, not just once at turn start. With real tool feedback in scope, the model can reason about whether the result answers the question or whether a different tool is needed.
Plan: add ThinkingBudgetTokens and InterleavedThinking to LlmStreamOptions, wire them into the Anthropic client's request body and header. The loop itself only needs a new chunk type (LlmThinkingChunk) forwarded as LlmAgentThinkingDeltaEvent so hosts can render a collapsible "reasoning" block.
Tradeoff: higher time-to-first-visible-token and higher cost. The right shape is per-role, default off — leave Default alone, opt in via a future Reasoning role or a per-turn override for hard tasks.
| 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
- Frontmatec.AI (>= 0.0.7)
- HtmlAgilityPack (>= 1.11.71)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.