Structured output · 2026-09-17

You need three fields from the model.

You let it answer in free prose, then scrape the values out with brittle regexes that break whenever the wording shifts.

  1. AWrite more regex patterns to cover every phrasing
  2. BAsk the model to return the three fields as a small structured object
  3. CLower temperature so the wording stays constant
  4. DAdd a second model that reads the prose and pulls the fields

Answer: B

Ask the model to return the three fields as a small structured object

Why

If you need structured data, ask for structured data - don’t coax prose and reverse-engineer it. Regex-scraping natural language is inherently fragile; letting the model emit the object directly removes the brittle layer entirely.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path