# AskUserMiddleware

> **Class** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/ask_user/AskUserMiddleware)

Middleware that provides an ask_user tool for interactive questioning.

This middleware adds an `ask_user` tool that allows agents to ask the user
questions during execution. Questions can be free-form text or multiple choice.
The tool uses LangGraph interrupts to pause execution and wait for user input.

## Signature

```python
AskUserMiddleware(
    self,
    *,
    system_prompt: str = ASK_USER_SYSTEM_PROMPT,
    tool_description: str = ASK_USER_TOOL_DESCRIPTION,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `system_prompt` | `str` | No | System-level instructions injected into every LLM request to guide `ask_user` usage. (default: `ASK_USER_SYSTEM_PROMPT`) |
| `tool_description` | `str` | No | Description string passed to the `ask_user` tool decorator, visible to the LLM in the tool schema. (default: `ASK_USER_TOOL_DESCRIPTION`) |

## Extends

- `AgentMiddleware[Any, ContextT, ResponseT]`

## Constructors

```python
__init__(
    self,
    *,
    system_prompt: str = ASK_USER_SYSTEM_PROMPT,
    tool_description: str = ASK_USER_TOOL_DESCRIPTION,
) -> None
```

| Name | Type |
|------|------|
| `system_prompt` | `str` |
| `tool_description` | `str` |


## Properties

- `system_prompt`
- `tool_description`
- `tools`

## Methods

- [`wrap_model_call()`](https://reference.langchain.com/python/deepagents-cli/ask_user/AskUserMiddleware/wrap_model_call)
- [`awrap_model_call()`](https://reference.langchain.com/python/deepagents-cli/ask_user/AskUserMiddleware/awrap_model_call)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a9e6e4f7ad7fe161dd9affc3d74bb19784aca70b/libs/cli/deepagents_cli/ask_user.py#L205)