Skip to main content
form shows an inline form in the chat. The end user fills in every field and submits once, and your agent receives one structured answer. Use it when you need several details together, such as a booking, an address or an inspection checklist. For one to four quick multiple-choice questions, the model uses choice cards instead. The platform teaches the model this block only on chat apps that can show it. Those apps declare the forms-v1 capability; see Where it renders. Elsewhere the model uses it only when your persona or skill context includes the syntax, or when a tool returns a ready-made block. A form a channel can’t show is sent as its questions in plain text, so the end user can still answer.

Syntax

The body between ::: form and ::: is YAML. JSON also works.
YAML rules:
  • Quote a value that contains : or #, or that starts with a symbol.
  • Use | for text that spans several lines.
  • Never put ::: inside the body, and never wrap the form in a code fence.
Values are read as written, so phone numbers and codes keep their leading + and 0.

Form fields

Field types

options is a list of labels, or a list of { value, label, description, image } entries when you want stable values that differ from the labels. Without an appearance:
  • a choice with up to 7 options shows as radio buttons, or checkboxes for multiple;
  • a choice with more options shows as a dropdown.
A boolean with required: true must be ticked, which suits consent. With appearance: yes_no, it must be answered either way. Common names are accepted as shorthand:

Every input

Conditions

visible_if names an earlier field and one test:
Combine tests with all, any and not:
A hidden field is neither checked nor sent, and a field that depends on a hidden one counts it as blank.

The answer

When the end user submits, the chat sends one message with the answers, keyed by key:
  • status. "declined" means the end user chose to type an answer instead, and values is empty.
  • tz. The time zone of the device, for dates and times.
  • Files. File answers point at uploaded files. Uploaded photos also reach the model as images.
The chat app shows this message as a short “Submitted” card, and the form above it stays answered after a reload. The model reads the block directly. A tool can also read it from the message, because the JSON is on a single line.

Generating a form from a tool

A tool can return a form it builds from data, for example one checklist question per item, and tell the model to send the block as is. That keeps the form exact and leaves nothing to the model. Build it as an object and serialize it with JSON.stringify, which escapes quotes and line breaks in your data. JSON is valid inside the block. Keep ::: out of the values, because it would end the block early:

Where it renders

Limits

The older pipe syntax (key | Label | type | required) still renders, but write new forms in YAML.

See also