ask
Pauses the agent and asks the user for one or more inputs. When the user answers, the agent resumes at this command, with the answers as the command's result.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
inputs | list of input object | The inputs to ask the user for. | |
message | dynamic string | "Please provide these inputs" | Shown to the user above the input fields. |
Each element of inputs describes one control:
| Field | Type | Default | Description |
|---|---|---|---|
namerequired | string | The name of the input. The user's answer is returned under this name. | |
label | string | The label shown next to the input. | |
description | string | Help text shown to the user under the input. | |
options | list of string | The values the user chooses from, for chooseOne and chooseMany. | |
default | string | The value the input starts with. | |
hidden | boolean | false | Sent back from the UI without being shown to the user. |
How a pause works
The agent's position — every function, loop and tool call in progress — is saved with the conversation. The run then ends with a result that tells the UI what to ask. The user's next message on the conversation carries the answers. The agent resumes at the same position, which returns a dict of the answers keyed by input name. Execution then continues. Inputs the user did not answer are asked for again. Hidden inputs come back with their default. Variables set before the pause keep their values.
Example
"ask": {
"message": "A few details to book the trip:",
"inputs": [
{ "name": "departure", "type": "str", "label": "Departure city" },
{ "name": "seat", "type": "chooseOne", "label": "Seat", "options": ["aisle", "window"], "default": "aisle" },
{ "name": "notes", "type": "text", "label": "Anything else", "description": "Optional" }
]
},
"var": { "answers": "{ result }" },
"progress": "{ f'Booking from {answers['departure']}, {answers['seat']} seat' }"Rules
- An input cannot be named
query. askis not allowed inside aforblock, in error handling, or in a function run byparallel, nor in any function called from those places. The agent fails validation.askis allowed inside a function that the LLM calls as a tool. The tool loop resumes where the agent paused.- Values typed as
passwordare masked in the UI but are ordinary strings to the agent. They are best not stored in agent or conversation variables.

