Games & simulation
Uses jev to control race cars on a virtual track
url: "https://api.typesafe.ai/v1/systemone",The link points at the commit we read, so the line number still holds.
These question sets are lifted from this project's source exactly as written.
from public/world.mjs:84
linechoiceWhich line should `driver` take through the next corner (see `track_ahead`), given `rivals`, `car.road_position` and the driver's `driver.traits`? Two cars in the same place make contact.
inside — Tight line, shortest distance, less forgiving if too fastmiddle — Neutral lineoutside — Wide line, more forgiving at speed, longer distancepacechoiceHow hard should `driver` push into `track_ahead.next`, given `car.situation`, `rivals` and `driver.traits`? The code brakes for corners at the chosen pace.
attack — Brake as late as possible and carry speed past the grip limit: faster if it sticks, a real risk of spinningsteady — Drive at the limit, brake normally and stay in controlcautious — Brake early and protect the position, giving up some timeovertaketrue/falseShould `driver` attempt to pass `rivals.ahead` before `track_ahead.next`? Going for it pulls the car out to the open side of the rival and pushes harder; staying put means following in their wheel tracks.
boosttrue/falseShould `driver` use the boost right now, considering `driver.boost`, `track_ahead` and `rivals`?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
line: { type: 'choice', instructions: 'Which line should `driver` take through the next corner (see `track_ahead`), given `rivals`, `car.road_position` and the driver\'s `driver.traits`? Two cars in the same place make contact.',
criteria: { inside: 'Tight line, shortest distance, less forgiving if too fast', middle: 'Neutral line', outside: 'Wide line, more forgiving at speed, longer distance' } },
pace: { type: 'choice', instructions: 'How hard should `driver` push into `track_ahead.next`, given `car.situation`, `rivals` and `driver.traits`? The code brakes for corners at the chosen pace.',
criteria: { attack: 'Brake as late as possible and carry speed past the grip limit: faster if it sticks, a real risk of spinning', steady: 'Drive at the limit, brake normally and stay in control', cautious: 'Brake early and protect the position, giving up some time' } },
overtake: { type: 'boolean', instructions: 'Should `driver` attempt to pass `rivals.ahead` before `track_ahead.next`? Going for it pulls the car out to the open side of the rival and pushes harder; staying put means following in their wheel tracks.' },
boost: { type: 'boolean', instructions: 'Should `driver` use the boost right now, considering `driver.boost`, `track_ahead` and `rivals`?' },
},
});