bots-garden/mini-mepublic Fork
⑂ v0.7.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. bed1738Unverified · on v0.7.0 · k33g · 10d ago
let-the-agent-ask-you.md · 93 lines · 3.5 KBmarkdown
Blame HistoryOpen raw

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
  1. 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.
  2. For a yes or no, type y or n (o and non work too).
  3. For a free answer, type it. Enter on an empty line takes the default when there is one.
  4. 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:

  1. A choice: ↑↓ then Enter, or the option's number.
  2. Several choices: ↑↓, Space to tick each one, Enter to send.
  3. Yes or no: y or n.
  4. 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

 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
# 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:

```yaml
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:

```text
❓ 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
```

1. 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`.
2. For a yes or no, type `y` or `n` (`o` and `non` work too).
3. For a free answer, type it. Enter on an empty line takes the default when there is one.
4. 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:

1. A choice: ↑↓ then Enter, or the option's number.
2. Several choices: ↑↓, Space to tick each one, Enter to send.
3. Yes or no: `y` or `n`.
4. 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:

```yaml
askUserTool: false
```

For one run, without editing the file:

```bash
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:

```yaml
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](../reference/tools.md#ask_user)
- `askUserTool`, `mmConfigs.<name>.askUser`: [configuration reference](../reference/configuration.md); `AGENT_ASK_USER`: [CLI reference](../reference/cli.md)
- What is sent to an editor: [ACP reference](../reference/acp.md)
- Why it works this way: [asking the user](../explanation/asking-the-user.md)