WoW2.Sdk.Beta.Be.Ai.Providers
10.0.2-beta
Prefix Reserved
dotnet add package WoW2.Sdk.Beta.Be.Ai.Providers --version 10.0.2-beta
NuGet\Install-Package WoW2.Sdk.Beta.Be.Ai.Providers -Version 10.0.2-beta
<PackageReference Include="WoW2.Sdk.Beta.Be.Ai.Providers" Version="10.0.2-beta" />
<PackageVersion Include="WoW2.Sdk.Beta.Be.Ai.Providers" Version="10.0.2-beta" />
<PackageReference Include="WoW2.Sdk.Beta.Be.Ai.Providers" />
paket add WoW2.Sdk.Beta.Be.Ai.Providers --version 10.0.2-beta
#r "nuget: WoW2.Sdk.Beta.Be.Ai.Providers, 10.0.2-beta"
#:package WoW2.Sdk.Beta.Be.Ai.Providers@10.0.2-beta
#addin nuget:?package=WoW2.Sdk.Beta.Be.Ai.Providers&version=10.0.2-beta&prerelease
#tool nuget:?package=WoW2.Sdk.Beta.Be.Ai.Providers&version=10.0.2-beta&prerelease
WoW2.Sdk.Beta.Be.Ai.Providers
Named model providers on the Microsoft.Extensions.AI IChatClient seam, and a one-attempt caller over them.
- Kinds:
anthropic(the officialAnthropicSDK),openai(any OpenAI-compatible Chat Completions host: OpenAI, Groq, DeepSeek, Ollama's/v1) andollama(OllamaSharp, Ollama's native API). IAiModelCallercalls a model once and never throws for a provider failure: it returns the text as given, or a classifiedAiErrorKind, with token usage, latency and the provider's finish reason either way. Retries, routing, prices and the inference log belong to the Ai module;AiRetry.IsTransient(kind)says which failures to retry.IAiChatClientshands out one chat client per provider and model, wrapped with OpenTelemetry (gen_aispans and metrics on the sourceExperimental.Microsoft.Extensions.AI).
dotnet add package WoW2.Sdk.Beta.Be.Ai.Providers --prerelease
Configuration
Every child of Ai:Providers is one provider, named by its key. Keep keys in user secrets or the environment
(Ai__Providers__anthropic__ApiKey), never in a committed file.
{
"Ai": {
"Providers": {
"anthropic": { "ApiKey": "<from secrets>" },
"groq": { "Kind": "openai", "BaseUrl": "https://api.groq.com/openai/v1", "ApiKey": "<from secrets>", "TimeoutSeconds": 30 },
"ollama": { "BaseUrl": "http://localhost:11434", "TimeoutSeconds": 120 }
}
}
}
| Key | Meaning |
|---|---|
Kind |
anthropic, openai or ollama; empty takes the provider's name when it is one of these |
BaseUrl |
the host; empty takes the kind's public endpoint (https://api.anthropic.com, https://api.openai.com/v1, http://localhost:11434) and never an SDK environment variable |
ApiKey |
required for every kind but ollama; a provider without one stays unconfigured and its calls answer NotConfigured without a request. Ollama's /v1 through openai takes any non-empty key |
TimeoutSeconds |
the per-attempt timeout (default 60); passing it answers Timeout |
A model is referenced as {provider}/{model}: anthropic/claude-haiku-5-5, groq/openai/gpt-oss-20b,
ollama/llama3.2 (AiModelRef.TryParse).
Usage
services.AddAiProviders(configuration, providers =>
providers.Providers["anthropic"].TimeoutSeconds = 30); // optional: code runs after the binding
var result = await caller.CallAsync(new AiCallRequest
{
Model = new AiModelRef("anthropic", "claude-haiku-5-5"),
System = "You sort notes into one label.",
User = "Sort: buy milk",
JsonSchema = """{"type":"object","properties":{"label":{"type":"string"}},"required":["label"]}""",
SchemaName = "sort-note",
Effort = "none",
});
// result.Text, or result.ErrorKind + result.Error; result.InputTokens, CacheReadTokens, CacheWriteTokens, LatencyMs
A product that only wants a chat client registers one:
services.AddAiProviders(configuration).AddAiChatClient("ollama", "llama3.2");
// inject IChatClient
Behaviour
- Request: a system message (skipped when empty) and a user message;
ModelId,MaxOutputTokens,Temperature;JsonSchemaas a JSON-schema response format (Anthropicoutput_config.format, OpenAIresponse_format, Ollamaformat);Effortnone|low|medium|highasChatOptions.Reasoning(Anthropic:nonedisables thinking, the rest turn on adaptive thinking at that effort; OpenAI:reasoning_effort; Ollama:think). LeaveEffortempty for a model without reasoning.CacheSystemmarks Anthropic's system blockcache_control: ephemeral. - Usage:
InputTokensholds every input token, cache reads and writes included, for every kind;OutputTokensincludes reasoning. Ollama reports neither cache nor reasoning counts. - Errors: 401/403
Unauthorized, 408 and the provider timeoutTimeout, 429RateLimited, 5xx and Anthropic's 529Unavailable, other 4xxBadRequest, unreachable hostsNetwork, a refusal (refusal,content_filter)ContentFilteredwith no text, an empty answerInvalidResponse.Errorholds the provider's message, at most 500 characters, with the key removed. Every SDK runs a single attempt; the caller's own cancellation throws.
| 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
- Anthropic (>= 13.8.0)
- Microsoft.AspNetCore.SignalR.StackExchangeRedis (>= 10.0.15)
- Microsoft.Extensions.AI.OpenAI (>= 10.8.3)
- OpenAI (>= 2.12.0)
- WoW2.Sdk.Beta.Be (>= 10.0.111-beta)
- WoW2.Sdk.Beta.Be.Abstractions (>= 10.0.111-beta)
- WoW2.Sdk.Beta.Be.Ai.Abstractions (>= 10.0.2-beta)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on WoW2.Sdk.Beta.Be.Ai.Providers:
| Package | Downloads |
|---|---|
|
WoW2.Sdk.Beta.Be.Ai.Module
Ai Form 1: the in-process runner, prompt registry, model prices, inference log and evals over the consumer's PostgreSQL database, with its SQL migration set. |
|
|
WoW2.Sdk.Beta.Be.Ai.Hosting
Ai HTTP API: the routes under api/ai/ over the contract's brokers, with ai.* scope policies and per-caller data scopes, for any host to mount. |
|
|
WoW2.Sdk.Beta.Be.Ai.Testing
Ai test kit: a scripted model caller and the prompts and evals conformance suites every implementation must pass. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.2-beta | 0 | 11/17/2026 |
| 10.0.1-beta | 0 | 11/17/2026 |
| 10.0.0-beta | 16 | 11/17/2026 |