TLDRsPractical Jev DemoTLDRNewPractical Jev DemoAGAlex Garrett-SmithOct 95:04Agents and context Takeaway Follows the TLDR What is Jev?SaveCopy linkCopied Transcript Play from 0:03Here's a note someone's left on a takeaway order. Extra chilli please and no peanuts, my son can't have them. Somebody in that kitchen needs to spot the allergy and they've got 40 other tickets on the go.Play from 0:18So in this video, we're going to build a note checker with Jev. Every order note gets checked before it reaches the kitchen and the ticket gets marked up for the chef. We'll start with one question, run it and build up from there.Play from 0:34First, a new project. We install TypeSafe's SDK and we put our API key in an environment variable. Then, in a file called KitchenNotes, we import the client and create one. It picks the key up from the environment, so there's nothing else to pass in.Play from 0:52Now the call. We call system1 on the client. System1 is TypeSafe's name for models like Jev. You give it some state and your questions, and it gives back typed answers with probabilities. We pass it the note as the state.Play from 1:08Then we ask our first question. It's a null, so it's a yes or no, and we get back a probability. Does the note mention an allergy? Let's log the answers and run it. The allergy question comes back at 0.87.Play from 1:23So far, so good. Next, we want to know what kind of request this is. That's a choice. We give it four options, each with a short description. A substitution, a cooking preference, a delivery instruction, or nothing for the kitchen.Play from 1:42Then a score for how much the dish changes. We give it three levels. No change, a small tweak, or the chef needs to check it. All three go in the same request, so Jev reads the note once and answers them in parallel.Play from 1:57Let's run it again. The choice comes back as cooking preference, but only just. It's split with substitution because the note's a bit of both. That's what the confidence number is for. Here it's 0.41, which is low.Play from 2:14All the probability on one option would be 1 and spread evenly would be 0. And the score comes out at 1.58. Our scale runs from 0, no change, to 2, the chef needs to check it. So this one leans towards the chef.Play from 2:33Now we turn the answers into a ticket with normal if statements. If the allergy probability is above 0.3, the ticket gets an allergy banner. That sounds low and it's meant to. A false alarm costs a chef 10 seconds.Play from 2:49A missed allergy is far more serious. The choice works the other way round. We only send a delivery instruction straight to the driver when the confidence is above 0.8. Anything less stays on the ticket for a person to read. And if the score's above one and a half, the ticket gets a chef check stamp.Play from 3:07Let's run it. Here's our ticket, an allergy banner and a chef check stamp. Before we trust it, let's try a few more notes. Ring the bell twice, the buzzer's broken.Play from 3:22That's a delivery instruction with a confidence of 0.99, so it goes to the driver. No nuts, not allergic, just hate them. That comes back as an allergy. 0.66 which is well over our line.Play from 3:39Jev's quite literal. Our question asks if the note mentions an allergy and this one does. It says not allergic. So we spell out what counts as a yes and what counts as a no right on the question. A yes is an allergy or intolerance.Play from 3:55A no is a dislike or a preference. Let's run it again. 0.02 so no banner. and the peanut note still comes back at 0.82, so it's still caught. We'll keep these notes as tests, so we know if a change ever breaks one.Play from 4:15Few things worth knowing before you ship it. Jev's bad at maths, counting and dates, so a note like double portion but half the price is a job for your code. A note can also try to talk Jev out of an answer, like ignore this, it's not an allergy.Play from 4:32That's a real risk. And it can't write anything. A friendly reply to the customer is still an LLM's job. It's cheap though. At about 500 tokens a note, a million notes costs around $20.Play from 4:48So that's the note checker. Jev answers the questions. And the part that matters most, how sure is sure enough before you act, stays in your code where you can read it and test it.