Skip to slide
039 / 221

CH 03 · Tool Design · 12/18

Read as one page

Structured input for deterministic output

When a tool produces formatted output (a document, a spreadsheet), prefer structured input over free text. Instead of "generate a contract" taking a blob of prose, have it take an array of sections with headings, levels, and tables. Then your code applies the formatting deterministically. This:

  • moves formatting from the unreliable model to reliable code,
  • lets you enforce house style/numbering/branding,
  • and makes the model responsible only for content.

Tell the model what not to do (don't type the numbers, don't repeat the title) because your generator handles those. This division, model decides content, code decides format, is one of the most reliable patterns for producing polished artifacts.

Finished this idea?

Your learning progress stays in this browser.