Themis.Inference.Foundry
1.7.1
dotnet add package Themis.Inference.Foundry --version 1.7.1
NuGet\Install-Package Themis.Inference.Foundry -Version 1.7.1
<PackageReference Include="Themis.Inference.Foundry" Version="1.7.1" />
<PackageVersion Include="Themis.Inference.Foundry" Version="1.7.1" />
<PackageReference Include="Themis.Inference.Foundry" />
paket add Themis.Inference.Foundry --version 1.7.1
#r "nuget: Themis.Inference.Foundry, 1.7.1"
#:package Themis.Inference.Foundry@1.7.1
#addin nuget:?package=Themis.Inference.Foundry&version=1.7.1
#tool nuget:?package=Themis.Inference.Foundry&version=1.7.1
Themis.Inference.Foundry
Use this optional package to request typed Themis decisions from a remote
model exposed through a Microsoft Foundry project endpoint. It implements
IDecisionInferenceProvider; it does not create Foundry agents, run local
models, or provide Laya/GGUF inference.
Requirements and limits
- A Foundry project endpoint, in the form
https://<resource>.services.ai.azure.com/api/projects/<project>. - A deployed model name supplied by the Themis router.
- A model deployment that supports the Foundry Responses API and strict structured JSON Schema output. Not every model or connection supports these features; verify the exact deployment before using it.
- An identity with permission to invoke the model. The default registration
uses
DefaultAzureCredential; register a differentTokenCredentialbefore calling the registration method when the host requires another identity.
The adapter asks the model to return Choice, Score, and Noul probability data. It rejects incomplete, mismatched, non-finite, out-of-range, or non-normalized probability output. It derives answer confidence and the expected score from the returned probabilities; it does not claim that those model-generated probabilities are calibrated. Remote inference failures and cancellation are propagated.
The model receives the complete request context, including extras. In
particular, extras.maf.systemMessages, when present, must be an array of
strings and is treated as caller-provided instructions; other extras remain
contextual data. These instructions cannot override the typed answer contract.
The model response must contain exactly one typed answer for every requested
question and no unknown fields. Choice answers include a selected allowed
label and probabilities for every label; Score answers include probabilities
for every score label; Noul answers include one probability in [0,1].
Choice/Score distributions must sum to one within 0.001. The provider returns
the normal DecisionResponse; it does not require the model to echo request
fields. Violations of the request/output contract fail with
InvalidDataException; no fallback answer is generated.
The response types used by the Foundry Responses API are marked experimental
by the underlying OpenAI .NET SDK (OPENAI001) and may change. The adapter is
limited to Foundry deployments that accept the strict schema generated for
the supplied decision request. This package has no live deployment
compatibility claim without a successful check against that exact model.
The request state, questions, and extras are sent to Foundry. Confirm that the selected endpoint and model meet your application's data handling and residency requirements. The adapter does not override Foundry's response storage or abuse-monitoring policy; review the service's current data controls for the selected project and deployment.
Registration
Add Themis and Themis.Inference.Foundry to the host.
Azure.Identity is included transitively; register a different
TokenCredential before registration when the host requires another
identity. The provider uses DefaultAzureCredential by default. Register it
through AddThemis so it is selected instead of the default ONNX decision
provider:
using Azure.Core;
using Azure.Identity;
using Themis;
using Themis.Inference.Foundry;
services.AddSingleton<TokenCredential>(_ => new DefaultAzureCredential());
services.AddThemis(
options =>
{
options.DefaultModel = "your-deployment-name";
options.RouteUnspecifiedRequestsToDefaultModel = true;
},
configureServices: registrations =>
registrations.AddThemisFoundryDecisionInference(options =>
options.ProjectEndpoint = new Uri(
"https://your-resource.services.ai.azure.com/api/projects/your-project")));
MAF integration
Maf can call this provider through its existing typed decision client; the Foundry provider remains responsible for remote inference and response validation:
using Themis.Maf.Extensions;
services.AddThemisDecisionMaf(
"foundry-decision",
configureThemis: options =>
{
options.DefaultModel = "your-deployment-name";
options.RouteUnspecifiedRequestsToDefaultModel = true;
},
configureServices: registrations =>
registrations.AddThemisFoundryDecisionInference(options =>
options.ProjectEndpoint = new Uri(
"https://your-resource.services.ai.azure.com/api/projects/your-project")));
Alternatively, Maf's AddThemisDecisionMafProxy can constrain a host-registered
IChatClient. This Foundry package does not convert its registered
ProjectResponsesClient into an IChatClient; use the typed provider path
above unless the host supplies a separately verified IChatClient adapter.
| 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
- Azure.AI.Extensions.OpenAI (>= 2.0.0)
- Azure.Identity (>= 1.21.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- Themis.Common (>= 1.7.1)
- Themis.Core (>= 1.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.