Skip to main content

Module agent_output

Module agent_output 

Source
Expand description

Structured output of the Agent block (SPEC_DRONE_REAL_WORLD_JOBS_2026_11_11.md §4.1, §6.3).

A node may declare output_schema: the few short fields its reply must carry, so the next node branches on a field ({{<id>.output.confidence}}) and not on prose. The block adds the reply format to the prompt, takes the JSON object out of the reply, and checks it against the schema; a reply that does not fit fails the node.

The schema is an object of field: spec. A spec is one of:

  • "string", "number", "boolean" (a string is cut to DEFAULT_MAX characters);
  • {"type": "string", "max": N}: a string cut to N characters (N is at most LIMIT_MAX);
  • {"enum": ["ok", "findings", "failed"]}: one of a closed set, which is what makes a value clean to branch on.

Every declared field is required, and a field the schema does not declare is dropped. A string is one line: its line breaks and control characters become spaces, so a field stays a short label, never a block of prose carrying someone else’s words onward.

Structs§

Field 🔒
Schema
A parsed output_schema.

Enums§

Kind 🔒

Constants§

DEFAULT_MAX
How many characters a string field keeps unless its spec says less or more.
LIMIT_MAX
The most characters any string field may keep: the fields are short by design.
MAX_FIELDS
The most fields a schema may declare.
MAX_TRIES 🔒
SEARCH_BYTES 🔒
The most of a reply’s end that is searched for the object, and the most places in it tried.

Functions§

article 🔒
json_objects 🔒
Every JSON object in the end of the text, in order: each of the last MAX_TRIES { that starts one that parses (the text after it is ignored), skipping the ones inside an object already found. A stray { in prose costs one try.
one_line 🔒
One line of at most max characters: breaks and control characters become spaces, runs of spaces one space.
parse_kind 🔒
valid_name 🔒