Give Jev a typed choice
Send the current state with a Choice question, such as which event resource a guest needs.
Jev makes a structured choice. Your application maps it to a trusted URL. QRGen turns that URL into a code people can scan. Three clear steps connect an AI decision to a real-world action.
TypeSafe describes Jev as a System One model that returns typed values and probabilities for decisions such as choosing, scoring, and routing. QRGen accepts the destination your code selects and returns a QR image. The URL list stays in your application, so the model only chooses among routes you define.
Send the current state with a Choice question, such as which event resource a guest needs.
Use the returned choice and confidence in your own logic. Map allowed choices to known destinations.
URL-encode the chosen destination and call QRGen’s public image endpoint for PNG or SVG.
Switch between sample event routes to see how an application can turn an approved destination into a QR code.
https://qrgenapp.com/blog/event-checkin-qr/This preview switches sample routes locally; it does not send a request to Jev. In a real workflow, Jev supplies the typed choice and your server performs the mapping.
Keep the TypeSafe API key on your server. If the choice is uncertain, pause for review. Otherwise, look up the matching URL and give QRGen the final destination. Jev is currently available through TypeSafe’s early access program.
Based on TypeSafe’s quick start and QRGen’s API reference. Read the Jev announcement.
const guestMessage = 'Where do I check in?';
const destinations = {
checkin: 'https://qrgenapp.com/blog/event-checkin-qr/',
schedule: 'https://qrgenapp.com/calendar/',
contact: 'https://qrgenapp.com/vcard/'
};
const response = await fetch('https://api.typesafe.ai/v1/systemone', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TYPESAFE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'jev-latest',
state: guestMessage,
questions: {
route: {
type: 'choice',
instructions: 'Which event resource does this guest need?',
criteria: {
checkin: 'Check-in or event entry',
schedule: 'Times and agenda',
contact: 'Organizer contact details'
}
}
}
})
});
if (!response.ok) throw new Error('Jev request failed');
const { answers } = await response.json();
const { choice, confidence } = answers.route;
if (confidence < 0.7) throw new Error('Send decision for review');
const destination = destinations[choice];
if (!destination) throw new Error('Unknown route');
const qrUrl = `https://qrgenapp.com/api/qr?data=${encodeURIComponent(destination)}&size=512`;
console.log(qrUrl);