const questions = { intent: choice("What does the customer need?", { greeting: "Only a greeting or thanks", order_status: "Only asks where an order is", password_reset: "Only asks how to reset the password", complex: "Anything else: a problem, a complaint…", }), };
const { answers } = await jev.systemOne({ state: message, questions }); const { choice: intent, probabilities } = answers.intent; const p = probabilities[intent]; // "order_status", 0.99
if (intent in templates && p >= threshold) return { route: "template", reply: templates[intent](message) }; // everything else, or when Jev isn't sure: Gemini const { text } = await generateText({ model, prompt: message });