Repository navigation
Jev
Rasmus Wulff Jensen edited this page Oct 10, 2026
·
2 revisions
- DecisionFactory (
JevDecisionFactory) - Shared
IDecisionFactorycontract for choices, probabilities, scores, and typed or runtime-defined decisions - Confidence, probability distributions, score descriptions, and token usage
dotnet add package AgentFrameworkToolkit.Jev
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.
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.
-
ApiKey(required) -
Endpoint(defaults tohttps://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>");builder.Services.AddJevDecisionFactory("<api-key>", "<decision-model>");This registers JevDecisionFactory and IDecisionFactory as the same singleton.
- Jev supports text decisions. Image requests and
SafetyIdentifierare 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.