Loading video player…

See What a Model Does

In this video, you sent one customer email from the tea importer’s inbox to a language model and watched what came back. Hannah’s tin of Darjeeling first flush, order 4417, hasn’t arrived, and the request asked for a short, friendly reply from Leaf & Kettle Tea.

What a Model Does With a Request

Text in, text out. A request is plain text: here, an instruction followed by Hannah’s email. The model takes all of it as input and predicts a likely next token, adds it to the reply, and repeats with the request and the reply so far until the reply ends.

Tokens. A token is a short chunk of text, often a word with its space. The first reply was sent back as it was made, in 43 pieces of one token or more, and “Darjeeling” came in three of them. How text splits into tokens depends on the model. Tokens get their own lesson later in the course.

The same request, a different reply. At each step, the model picks one token from the likely ones, partly by chance, so the same request sent three times gave three wordings: “check on” in one, “look into” in the others, and “Best,” in only one. Your runs may differ in wording and even leave something out. All three named order 4417 and promised an update: that’s what your code checks a reply for, never its exact words.

Each call starts empty. After one request holding the order record (“Order 4417: shipped November 25, out for delivery December 1.”), a second request asking when order 4417 would be delivered got this reply:

I can’t access order 4417 directly. Please share the tracking link or the latest shipping status, and I can help estimate when it will arrive.

The second request held only the question. Each call starts empty: the model sees that request’s text and nothing from earlier calls, unless it’s sent again. A chat app seems to remember because it sends the earlier messages again with every request.

No lookup, and no clock. With the record in the same request as the email, the reply used it, but said the parcel “was out for delivery on December 1” on a run made on November 30: the model doesn’t know what day it is.

Asked “What’s today’s date? Reply in YYYY-MM-DD format, nothing else.” that same day, it returned 2026-10-12, and six more runs said it couldn’t tell. Neither is today’s date. With today’s date in the request, it returned 2026-11-30.

Facts from your code, and a check. So today’s date goes into Hannah’s request too. A reply can sound sure and still be wrong, so a draft’s dates have to be checked against the order record and today’s date before anything is sent: in this course’s project, the person who reviews each draft does that.

Comparing with the record alone would pass this reply, since both say December 1; it’s today’s date that shows “was” is wrong.

What Your Code Supplies

A model predicts text from the request and its training, and nothing else. When you hand a task to a model, ask what only your code has:

  • Current facts, such as today’s date
  • Your own records, such as an order’s status
  • A check of the facts the reply states

Drafting Hannah’s reply suits a model well, as long as your code brings the order record and today’s date, and the draft’s dates are checked against both before it’s sent. In this course’s project, the person who reviews each draft does that. Saying where her parcel is right now doesn’t: only the carrier’s tracking has that.

To send a request like these yourself, you need a key from a model provider. The next lesson, Get a Key and Set a Spending Limit, walks you through that.

00:00 A small online tea importer gets the same kinds of email every week, and you’re going to write a script that drafts the replies. Before any code, you’ll watch what a language model does with one request.

00:13 Here’s one email. Hannah’s tin of Darjeeling hasn’t arrived, and she wants to know where it is. The request is plain text: an instruction to draft a short, friendly reply from Leaf & Kettle Tea, followed by Hannah’s email.

00:30 Send the request, and the model takes all of its text as input. It predicts a likely next token, a short chunk of text, often a word with its space, and adds it to the reply.

00:41 Then it takes the request and the reply so far, and predicts the next token. It repeats that until the reply ends.

00:50 This reply was sent back as it was made, in 43 pieces of one token or more. Darjeeling came in three of them. How text splits into tokens depends on the model.

01:03 Tokens get their own lesson later, and that’s all you need about them for now.

01:09 Send the same request again, and you get another reply. Send it a third time, and you get a third. All three are polite, but the wording differs. One says “check on” where the others say “look into”, and only one signs off with “Best”.

01:27 At each step, the model picks one token from the likely ones, partly by chance. Replies two and three start the same, pick differently halfway through, and go their own ways from there.

01:39 Your runs may differ in wording and even leave something out. All three here name order 4417 and promise an update. That’s what your code checks a reply for, never its exact words.

01:53 Give the model a fact in one call. A request holds the order record: order 4417 shipped November 25, and it’s out for delivery December 1. The model replies OK, as the request asks.

02:09 A second request asks when order 4417 will be delivered. The reply says it can’t access the order, and asks for the tracking details.

02:18 The second request holds only the question. Each call starts empty: the model sees that request’s text and nothing from earlier calls, unless it’s sent again.

02:29 Watch out if you’ve used a chat app. It seems to remember because it sends the earlier messages again with every request.

02:38 Now the record goes into the same request as Hannah’s email. This time the reply uses it: order 4417 shipped on November 25. But it says the parcel was out for delivery on December 1.

02:52 This ran on November 30, so that day hadn’t come yet. The model doesn’t know what day it is.

02:59 Asked for today’s date that same day, it returned October 12. Six more runs said it couldn’t tell. Neither is today’s date. With today’s date in the request, it returned November 30.

03:14 So today’s date goes into Hannah’s request too. A reply can sound sure and still be wrong, so your code checks its dates against the order record and today’s date before anything is sent.

03:27 A model predicts text from the request and its training, and nothing else. When you hand a task to a model, ask what your code must supply. Today’s date and other current facts come from your code.

03:41 So do your own records, such as an order’s status, and a check of the facts the reply states.

03:48 Drafting Hannah’s reply suits a model well, as long as your code brings the order record and checks the dates. Saying where her parcel is right now doesn’t suit one, because only the carrier’s tracking has that.

04:00 To send a request like these yourself, you need a key from a model provider. The next lesson, Get a Key and Set a Spending Limit, walks you through that.

Become a Member to join the conversation.