← All demos
WATCH A DECISION MODEL DRIVE
Pick a lane.
Which lane should the car choose? Only the model steers. The road keeps moving while it decides.
Road
READYReady. Start driving to let the model take the wheel.
Blue car: model · Striped barriers: avoid · No manual steering
View C# example
using System.ComponentModel;
using DecisionsDotNet;
using var client = OpenRouterDecisionsClient.FromEnvironment();
var model = client.ForModel("typesafe/jev-1.14");
var state = """
Current lane: 2
Lanes: Lane 1 is left, lane 2 is center, lane 3 is right. You can cross intermediate lanes.
Obstacles:
- (lane 2, time to collision 900 ms)
- (lane 3, time to collision 1600 ms)
Goal: Avoid collisions with obstacles. Prefer staying in the current lane when it has no obstacles.
""";
// ChooseAsync<TEnum> offers every enum member, using [Description] as its criterion.
var lane = await model.ChooseAsync<Lane>(state, "Which lane should the car choose?");
Console.WriteLine($"Steer to lane {(int)lane.Value} ({lane.SelectedProbability:P0})");
foreach (var (option, probability) in lane.Probabilities)
Console.WriteLine($" {option}: {probability:P0}");
public enum Lane
{
[Description("Drive in the left lane.")] Left = 1,
[Description("Drive in the center lane.")] Center = 2,
[Description("Drive in the right lane.")] Right = 3
}