Tinker Structured outputs

by Kondasamy Jayaraman · drawn with Colorfigures by April Zhu

Loading Larkspur mini

Larkspur miniThe schema asks for order, a whole number.

Chapter 6 of 7

Valid isn’t right

Every answer now passes the check. Larkspur’s team is ready to ship, until someone reads what the answers say.

This chapter: If every answer fits the schema, is every answer right?

You will learn

  • That the mask forces a value even when the model doesn’t know one
  • How a well-formed answer can be wrong
  • What refusals and cut-off answers do to a schema
Words you’ll meet (3)
Valid
Fits the schema: the right fields, types and values. Says nothing about whether it is true.
Cut-off
An answer that stopped before it finished, because it ran out of room (a token limit). A cut-off JSON answer doesn’t parse.
Refusal
An answer in which the model declines the request. Providers return it in a way that may not follow your schema.

The picture on the left is live. Each step below asks you to do one thing in it; the story continues here as you go.

Step 1 of 4

Every answer passes the check now. The team asks for one more field, the order number, so the order system can match the answer to an order. The prompt even names it. Before you run it:

The schema asks for one field, order, a whole number. The prompt is “Where is order 1042?”. What will Larkspur mini write?