Step 1: Variables, not copies
Brightline Books' customer care team answers a hundred emails a day with an AI assistant. Each person
keeps their own prompts in a notes file and copies them around, so every reply sounds different, and
last week a customer called Mr Okafor received an apology addressed to Mrs Patel. You will build one
shared prompt library: templates with named blanks that anyone on the team can fill. There is no
code: you edit templates.yaml.
A template is a prompt with variables: {{customer_name}} is replaced by the value for each
customer. run_tests.py fills the templates with the team's test cases in team_cases.jsonl, sends
them to the model and checks each reply.
Do this:
- Open
templates.yaml.late_orderis a prompt copied from one real reply to Mrs Patel. - Replace her details with
{{customer_name}},{{order_id}}and{{days_late}}, and declare each one undervariables:, as incustomer_name: {required: true}. - Click Run. It fills the template for three customers.
The check needs all three replies to name their own customer and order, and none to mention Mrs Patel or her order.
templates.yaml, the file you edit14 lines
# The customer care team's prompt library. Each template turns a few values into a prompt;
# run_tests.py fills them with the team's test cases and checks every reply against policy.md.
# {{name}} a variable: declare it under variables (required unless it has a default)
# {{> name}} a partial: a shared block from the partials section
templates:
late_order:
description: A parcel is late; the customer has asked where it is.
variables:
# TODO (Step 1): declare the variables this template needs, e.g. customer_name: {required: true}
prompt: |
# TODO (Step 1): this prompt was copied from one real reply. Replace the details with variables.
Write a reply to Mrs Patel, whose order BL-40211 is 5 days late.
Say we have asked the courier to trace it.library.pypolicy.mdrun_tests.pyteam_cases.jsonl