Dive

Built-in tools

builtin__infer

Runs one model call over an instruction and returns text or structured JSON.

Behavior

  • Returns {text} by default.
  • With output_schema, returns JSON validated against it, so every declared field is present.
  • model picks a model role; omit it for the chat role.

When to use it

  • Classify, extract or summarize inside a plan.
  • Inside a map, interpolate {{item}} per call instead of passing the whole list.
LoadedKindEffect
AlwayspromptNot marked read-only

Input

instructionstringrequired

Complete, self-contained instruction, including the data to analyze (reference earlier step results with {{Ex...}} templates, or the current element with {{item}} inside a map body).

systemstring

Optional standing instructions sent as the system prompt instead of in the instruction. Keep it identical across calls that share it — across the items of a map, say — so the provider can cache it.

Optional JSON Schema for the result. When present, the output is structured JSON matching this schema instead of {text: ...}. Must be an object schema: give it a top-level "type": "object" and a "properties" map (a bare {properties, required} is coerced to object, but write the type explicitly).

on_mismatchenum<string>

What to do when the output still doesn't match output_schema after the automatic fix-up: "error" (the default) fails the step; "return" hands back the output as it is, for a caller that checks it itself and retries. Output the model cut off at its output limit is never fixed up or handed back: the step fails with an error naming the limit.

Available options: error, return

Output

Without output_schema, the result is {text}. With it, the result is an object matching that schema instead, with every field the schema declares present.

textstring

The model's answer, when the call passes no output_schema.

- id: E1
  tool_name: builtin__infer
  input:
    instruction: "{{input.instruction}}"