Menu
CoddyTech

When Data Is Missing

Part of the Prompting Techniques section of Coddy's AI Prompts journey. Lesson 13 of 24.

Extraction prompts often ask for something the text simply does not contain. A small model then fills the gap somehow: an empty string, a placeholder, or worse, an invented value. A program reading the JSON cannot tell any of those from real data.

Extract the hotel name, city and nightly price from this review: "Loved our stay at Hotel Mira, great breakfast!" Return only a JSON object with the keys "hotel", "city" and "price".
{"hotel": "Hotel Mira", "city": "", "price": ""}

Add one sentence, Use null for anything the review does not say, and the same prompt returns {"hotel": "Hotel Mira", "city": null, "price": null}. In JSON, null means no value: code can check for it and ask the customer, instead of storing an empty city or a made up price.

challenge icon

Challenge

Medium

The chat already shows an extraction that went wrong: the message never gives a price, but the AI invented one. With one follow-up, get the JSON again with the missing price handled properly.

The AI's response must:

  • Be a JSON object with product, color and price
  • Have price set to null
bugsy Main icon

Start this challenge with Coddy's AI tutor

What is Bugsy?
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Prompting Techniques