Examples Set the Format
Part of the Prompting Techniques section of Coddy's AI Prompts journey. Lesson 3 of 24.
Examples teach more than the answer. They teach its shape: which fields appear, in which order, with which separators. That is often the quickest way to get a format that would take a paragraph to describe.
Say you want capital cities as one tidy line each:
Write each fact in exactly the same format as the examples. Reply with the fact line only.
Paris is the capital of France.
City: Paris | Country: France
Ottawa is the capital of Canada.
City: Ottawa | Country: Canada
Canberra is the capital of Australia.City: Canberra | Country: Australia
The AI copied the field names, their order and the | separator. For that to work, every example must use exactly the same format. If one example says Country: France and another Country=Canada, the AI has to guess, and it may mix both.
Challenge
EasyYou log each purchase as one line in this format: Item: lamp | Price: 25.
Give the AI two example sentences with their log lines, then this new sentence:
We got a desk for 80 dollars.
The AI's response must:
- Have the desk's log line, in the same format, as its first line
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Prompting Techniques
1Show, Don't Tell
Zero-Shot vs Few-ShotLeave a Slot to FillExamples Set the FormatExamples Get CopiedRecap: Show, Don't Tell