Primitives· Last updated

Structured instructions and field paths

Most questions are one sentence in instructions. When the state is a record, TypeSafe wants you to name the field:

"Does `ticket.messages[0].text` request a refund?"

Use a dot-and-index path in backticks so the model is not guessing which paragraph matters.

Structured instruction objects

instructions can be an object or array. Put the question in one field and supporting data in others, then refer to those fields by name in backticks — the same habit as pointing into state:

"instructions": {
  "potential_duplicate": {
    "name": "John Smith",
    "location": "Oakland, California",
    "last_employer": "Google"
  },
  "question": "Is the resume for the same person as `potential_duplicate`?"
}

This is useful when the extra context is part of the question, not the document under evaluation. Keep the document in state so every question can see it without duplication.

Reduce hops

The jaggedness note on indirection: questions about a property of a property, or double negatives, cost accuracy. Name the relevant part of state. Ask the direct question.

Sources

Public TypeSafe or adjacent documentation only. No private claims.