Skip to content
Rasmus Wulff Jensen edited this page Oct 10, 2026 · 2 revisions

NuGet README

Features

  • DecisionFactory (JevDecisionFactory)
  • Shared IDecisionFactory contract for choices, probabilities, scores, and typed or runtime-defined decisions
  • Confidence, probability distributions, score descriptions, and token usage

Package

dotnet add package AgentFrameworkToolkit.Jev

Quick start

using AgentFrameworkToolkit.Decisions;
using AgentFrameworkToolkit.Jev;

IDecisionFactory decisionFactory = new JevDecisionFactory("<api-key>", "<decision-model>");

bool damaged = await decisionFactory.IsTrueAsync(new ProbabilityRequest
{
    Input = "The screen arrived shattered.",
    Question = "Is the product damaged?",
    Threshold = 0.7
});

Supply the model explicitly; there is no default model.

Runtime-defined questions (1.24.2+)

DecisionResponse response = await decisionFactory.CreateDecisionAsync(
    new DynamicDecisionRequest
    {
        Input = "The screen arrived shattered.",
        Questions =
        [
            new ChoiceQuestion
            {
                Id = "department",
                Question = "Which department should handle this?",
                Choices =
                [
                    new() { Id = "returns", Description = "Damaged products and replacements" },
                    new() { Id = "billing", Description = "Charges and payments" }
                ]
            },
            new ProbabilityQuestion
            {
                Id = "damaged",
                Question = "Is the product damaged?",
                Threshold = 0.7
            }
        ]
    });

ChoiceAnswer department = response.GetChoice("department");
Console.WriteLine(department.Value.Id);
Console.WriteLine(department.Value.Probability);
Console.WriteLine(response.GetProbability("DAMAGED").IsTrue);
Console.WriteLine(response.TotalTokenCount);

Question IDs and answer lookup are case-insensitive. See runtime-defined questions for score questions, full answer details, and validation rules.

Connection options

  • ApiKey (required)
  • Endpoint (defaults to https://api.typesafe.ai/v1/systemone)
  • NetworkTimeout (optional per-request timeout)
  • HttpClientFactory (optional caller-owned HTTP client)
JevDecisionFactory decisionFactory = new(new JevConnection("<api-key>")
{
    NetworkTimeout = TimeSpan.FromSeconds(60)
}, "<decision-model>");

Dependency injection

builder.Services.AddJevDecisionFactory("<api-key>", "<decision-model>");

This registers JevDecisionFactory and IDecisionFactory as the same singleton.

Notes

  • Jev supports text decisions. Image requests and SafetyIdentifier are unsupported.
  • Score questions require 2–10 levels, whether supplied by an enum or a dynamic question.
  • See DecisionFactories for shared requests, question attributes, result types, and examples.

Clone this wiki locally