CourseAI Engineering: The Complete Course · Module 7: LLM Engineering · part 52 of 105
Part 52 · Module 7: LLM Engineering

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.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.