Themis.Maf 4.0.2

dotnet add package Themis.Maf --version 4.0.2
                    
NuGet\Install-Package Themis.Maf -Version 4.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Themis.Maf" Version="4.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Themis.Maf" Version="4.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Themis.Maf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Themis.Maf --version 4.0.2
                    
#r "nuget: Themis.Maf, 4.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Themis.Maf@4.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Themis.Maf&version=4.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Themis.Maf&version=4.0.2
                    
Install as a Cake Tool

Themis.Maf

Themis.Maf adapts typed Themis decision inference to Microsoft.Extensions.AI and Microsoft Agent Framework integrations. It does not implement general chat generation; use a separate provider package for conversational tasks.

The package targets .NET 10. Its keyed decision client and function helpers route DecisionRequest values to IDecisionInferenceProvider.

Decision inference

Register a keyed decision-backed IChatClient when the caller already has a DecisionRequest serialized as the text of one MAF user message:

services.AddThemisDecisionMaf(
    "decision",
    configureServices: registrations =>
        registrations.AddSingleton<IDecisionInferenceProvider, MyDecisionProvider>());

var client = serviceProvider.GetRequiredKeyedService<IChatClient>("decision");

The JSON object must contain state, centralQuestion, and questions; it may also contain model, task, lang, and extras. Optional text-only System message text is added, in order, to extras.maf.systemMessages; existing extras are preserved, and an existing maf.systemMessages array is extended. The response message is JSON with the original user request value in request and the typed DecisionResponse in decision. ChatOptions.ModelId overrides the request's model when set; otherwise Themis routing uses the request fields.

This connector accepts exactly one user text message and optional text-only System messages per call. It does not generate natural language, interpret conversation history, execute MAF tools, or stream. Unsupported message shapes, tool/generation options, and streaming fail explicitly. Use the keyed decision-agent helper to expose typed inference as an executable function to a separate generative MAF agent:

services.AddThemisDecisionAgent(
    "risk",
    model: "decision-model",
    configureServices: registrations =>
        registrations.AddSingleton<IDecisionInferenceProvider, MyDecisionProvider>());
services.RegisterThemisAsTool("risk", "evaluate_decision", "Evaluates a structured decision request.");

var decisionTool = serviceProvider.GetRequiredKeyedService<AIFunction>("risk");

RegisterThemisAsTool takes a JSON string argument named requestJson, which must use the same decision-request shape. The resulting function returns the echoed request and typed decision response. This tool does not itself provide a generative agent or perform the outer agent's tool-selection loop.

Constraining a host chat client

When an application already has a Microsoft.Extensions.AI.IChatClient, keep that client registered under its own key and add an opt-in Maf proxy under a different key:

services.AddKeyedSingleton<IChatClient>("remote", (_, _) => remoteChatClient);
services.AddThemisDecisionMafProxy("remote-decision", "remote");

var decisionClient = serviceProvider
    .GetRequiredKeyedService<IChatClient>("remote-decision");

The proxy invokes the registered client, but only accepts the same single-user JSON DecisionRequest contract as the keyed decision client. It supplies a question-specific JSON Schema response format, maps validated probability output to typed Choice, Score, and Noul answers, and returns the original request with a DecisionResponse in the decision field. The proxy rejects invalid requests or output, unsupported generation options, and streaming. The underlying chat client must support structured JSON responses; output is validated even when the client does not enforce the supplied schema. The proxy does not replace the host's original client. The host remains responsible for general chat generation and any agent tool-selection loop.

Application-input mapping and queued decision handling are outside this package and are maintained separately.

License

Themis' adapter code is licensed under MIT, and the NuGet package includes the Themis license text. Microsoft.Extensions.AI retains its own terms; model assets and providers are also separately licensed.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2 48 10/27/2026
4.0.1 60 10/27/2026
4.0.0 54 10/26/2026
2.0.3 86 10/25/2026
2.0.1 88 10/25/2026
1.7.1 89 10/22/2026
1.7.0 252 10/22/2026
1.5.1 88 10/19/2026
1.3.0 101 10/17/2026
1.2.0 90 10/17/2026
1.0.0 99 10/15/2026