Lesson 2: Getting a reply your code can trust
15 min read·13 Oct 2026
Module 7 · Lesson 2 · About 40 minutes · Needs: Lesson 1 of this module (prompts), and Python classes and JSON from Module 1
The situation
Dev is wiring the answer engine into BrightCart's ticket system. For every reply his code needs three things: which queue, whether a person must look, and how sure the model was. A friendly paragraph tells a program none of that.
The ticket on his screen is the first in the shared set: "I was charged twice for one order." This lesson turns the model's reply into a typed object, a Reply with four fields, and makes sure a bad one never reaches Dev's code.