promptstringrequiredThe whole question, material included.
modelstringA fast cheap one by default.
schemastringThe shape of the answer, as JSON text. Gets an object back instead of prose.
instructionsstringA system instruction for it.
Why it exists
Fifty pages read into the conversation are paid for on every later turn. Sent to a second model, they are paid for once — and the agent gets back only the answer.
It is for volume
- Classify two hundred rows: one call each.
- Extract one field from fifty pages.
- Summarise twenty documents.
The instruction is explicit the other way too: never use it for something answerable in a sentence. A second model call to do what the agent can already do is pure cost.
Structured answers
generate({
prompt: "Classify this support message: …",
schema: '{"type":"object","properties":{"sentiment":{"type":"string"},"urgent":{"type":"boolean"}}}',
})# The call the model makes:
generate = {
"prompt": "Classify this support message: …",
"schema": '{"type":"object","properties":{"sentiment":{"type":"string"},"urgent":{"type":"boolean"}}}',
}It is billed
Like any model call, and it counts against the run's budget. Its category is write, so it is asked in ask mode and free in auto.