Loading Larkspur mini
Larkspur mini · no schemaThe prompt: “Order 1042 status as JSON:”
Chapter 2 of 7
A schema is a contract
Larkspur mini answered in prose. The team writes down exactly what the order system expects, and has the host check every answer against it, as Tool calling’s host checks tool arguments.
This chapter: What does checking the answer after it is written buy you, and what does it cost?
You will learn
- What a JSON schema says: which fields, which types, which values
- How a check after the answer turns a bad answer into a retry
- Why retries cost tokens and still guarantee nothing
Words you’ll meet (3)
- Schema
- A written description of the shape an answer must have: its fields, each one’s type, and the values allowed. Larkspur uses the same subset of JSON Schema as Tool calling.
- Validation
- Checking a finished answer against the schema. It can only say pass or fail, after the tokens are spent.
- Retry
- Asking again after a failed check, and paying for every token again.
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
The team writes down what the order system expects, as a schema: the same small subset of JSON Schema Tool calling checks tool arguments with. One field, status, whose value must be on time or delayed, and nothing else.
{
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"on time",
"delayed"
]
}
},
"required": [
"status"
],
"additionalProperties": false
}Loading Larkspur mini…