How to let the agent ask you questions
This guide shows how to answer the questions an agent puts to you with its ask_user tool — a choice, several choices, a text, a yes or no — in each front end, and how to turn the tool off, including for the agents another agent calls. It assumes you already run mm with a model that calls tools.
Make sure the tool is there
ask_user is on by default. Nothing to add to the configuration file, unless it says askUserTool: false. An agent with a structuredOutput never has it.
To make your agent use it, say so in its system prompt, for instance:
system: |
When a decision belongs to the user, ask them with the ask_user tool
before acting.
Answer in the terminal (line mode)
Each question is printed with numbered options:
❓ ask_user: 1 question(s)
❓ Which framework would you like to use?
1. React
2. Vue
3. Svelte
number, or another answer · /skip to decline
? 2
- Type the number of an option, or its text, or its first letters (
sv), and press Enter. For several choices, type the numbers separated by commas:1,3. - For a yes or no, type
yorn(oandnonwork too). - For a free answer, type it. Enter on an empty line takes the default when there is one.
- Several questions come one after the other.
To refuse to answer, type /skip. /abort stops the turn, question included.
Answer in the window (mm -tui)
The question replaces the input box, its options over the bottom of the conversation:
- A choice: ↑↓ then Enter, or the option's number.
- Several choices: ↑↓, Space to tick each one, Enter to send.
- Yes or no:
yorn. - A text: type it in the box, then Enter.
Escape refuses to answer.
Answer in an editor (ACP)
Nothing to do on mm's side: an editor that supports ACP's elicitation forms shows the questions as a form. One that does not shows each choice or yes/no question as a dialog whose buttons are the options, plus Decline. With such an editor, free-text and several-choice questions cannot be asked: the agent is told so and assumes.
Turn the tool off
For one agent, in its file:
askUserTool: false
For one run, without editing the file:
AGENT_ASK_USER=false mm -config agent.yaml
Decide for the agents your agent calls
An agent called by ask_agent or /ask keeps its own askUserTool. When it is on, its questions come up to you, through your agent's front end, prefixed with its name (homer asks: Which environment?). To decide in its place, set askUser in its mmConfigs entry:
mmConfigs:
homer:
path: agent.homer.yaml
askUser: false # homer never asks: it assumes
milo:
path: agent.milo.yaml
askUser: true # milo may ask, whatever its own file says
With mm --ask, nobody is there to answer: a called agent's questions get "the user cannot be asked", and it goes on with an assumption.
Variants
- In a one-shot run (
mm -p), nobody can answer either: the tool tells the model at once, without waiting. - A question waits as long as you need: the watchdog does not end the turn while it waits.
See also
- The tool's fields, results and messages: tools reference
askUserTool,mmConfigs.<name>.askUser: configuration reference;AGENT_ASK_USER: CLI reference- What is sent to an editor: ACP reference
- Why it works this way: asking the user
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|