internalsGet Pro

AI Engineering · Module 03

Prompting and structured outputs

Lessons
12
Free
1
Reading
~3 h

Your progress

0 / 12 lessons done

Sign in to track

Lessons

  1. Prompt anatomy: instructions, context, examples, formatFreeWhen a model’s output misses the point, the cause is often a prompt that leaves out something a new colleague would need. Knowing the parts lets you find the missing one instead of guessing or paying for a bigger model.14 min
  2. System prompts: setting the role and the rulesEvery model feature you ship has standing rules: a tone, a format, things it must never say. Putting them in the right place makes them apply on every call and keeps them apart from what users type, and knowing their limit tells you when to add a check in code.7 min
  3. Few-shot prompting: teaching by exampleSome output styles are easier to show than to describe. Two good examples often fix a format that a paragraph of rules keeps missing, but they are paid for on every call and the model copies more from them than you meant.8 min
  4. Step-by-step prompting: asking for the reasoningMany AI features make decisions that depend on several rules: refunds, approvals, routing. Knowing what step-by-step prompting still does, and what it no longer does, keeps those decisions checkable without paying for work the model already did.8 min
  5. Structured outputs: getting reliable JSONMost AI features stop being demos when code, not a person, reads the model’s reply. Sorting, extracting and filling forms all depend on JSON that parses on every call, and on knowing which mistakes a valid reply can still contain.16 min
  6. Validating model output with PydanticEvery feature that turns model output into an action, such as moving a ticket, filling a form or calling a tool, needs a check between the model and the action. Valid JSON only tells you the shape is right; your own rules decide whether the values are safe to use.17 min
  7. Prompt templates and version controlA prompt edit changes what every output says without changing a single code path, so tests stay green while quality drops. Templates, version ids and a careful rollout are what let you find the change that did it, and undo it in minutes.17 min
  8. Long inputs: splitting work across many callsReports over thousands of tickets, reviews over a whole catalogue, notes over a year of meetings: many useful AI features read far more text than one call should. Splitting the work well decides whether the result is complete, cheap and repeatable.17 min
  9. Multimodal inputs: images, PDFs and audioCustomers explain problems with photos, screenshots, invoices and voice notes, not only words. Any AI feature that reads tickets, claims or forms has to decide how those files reach the model, what they cost and when to trust what the model saw.17 min
  10. Prompt pitfalls: ambiguity, drift and leakagePrompt bugs pass code review and unit tests, because no code path changes. They show up later as drafts that skip what the customer needs, a queue that slowly fills, or a customer reading another customer’s address.17 min
  11. Design: an invoice data extractorPulling fields out of documents is one of the most common AI features: invoices, receipts, forms, contracts. The model call is the easy part. The work is deciding which answers can go straight into a system of record and which must reach a person first.30 min
  12. Lab: turning messy emails into clean recordsMost AI features start by turning text people wrote into fields a program can use: a ticket record, an invoice line, a form. Running an extractor on messy real input, and counting what fails, is how you learn where it breaks before your users do.18 min

Practise with

Terms this module teaches 30

Open glossary

Base64 encoding

A way to write binary data, such as an image, as plain text characters, which makes it about a third larger.