# ask_user

Canonical URL: https://developers.iagenify.com/pt/sdk/agent/tools/ask-user/
Language: pt

`ask_user({ question, options? })`

Pregunt-te e attende. Esiste solo quando fornisce onPregunta — sin di essa, l'agente non ha modo de chiedere.

Status: category: read · needs onQuestion · not for subagents

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `question` | string | obrigatório | - Cee que si chiede. |
| `options` | string[] |  | Due a quattro risposte breves, quando può offrir. |

## Quando il sollevi {#when}

- La richiesta è ambigua e la scelta è genuinamente tua.
- Dopo due tentazioni fallite a la stessa approccio — si dice a chiedere piuttosto que improvvisare un tercio.

## L'abre {#wiring}

```javascript
api.agents.create({
  runtime: "local", machine: pc, model,
  onQuestion: async ({ question, options }) => askThePerson(question, options),
});
```

Un evento `question` è emitit prima che il callback sia atteso, per cui un'interfàcia puè pinturar il dialog mentre il loop attende.

## Senza il callback {#without}

> **L'utenda non è dichiarat**
>
> Un agente senza interrogazione è instruit a fare un giudizio o explicar lo che blocca. Que è un run differente, non un blocched — ma significa un agente non vigilat va a scegliere per voi.

## Un subagente non lo capisce mai {#subagents}

Un dei tre strumenti che un subagente fa senza, insieme con `todo_write` e `memory`. Se dice non può parlare con voi e deve informar in cambio.

- [interrogazione](/pt/sdk/agent/events/question): L'evento.
- [Ferramentas do agente](/pt/sdk/agent/tools): The 35, by family.

```python
api.agents.create(
    runtime="local", machine=pc, model=model,
    on_question=lambda request: ask_the_person(request["question"], request["options"]),
)
```
