# Question

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_ask_user_types/Question)

A question to ask the user.

## Signature

```python
Question()
```

## Extends

- `TypedDict`

## Constructors

```python
__init__(
    question: Annotated[str, AfterValidator(_validate_question_text), Field(description='The question text to display.', min_length=1)],
    type: Annotated[QuestionType, Field(description='Question type. \'text\' for free-form input, \'multiple_choice\' for picking exactly one predefined option, \'multi_select\' for picking one or more predefined options. Both choice types always append an \'Other\' free-form option automatically; multi-select can accept multiple custom Other values (filling one reveals another). A \'multi_select\' answer comes back as a JSON array of the selected values (including any custom Other text), e.g. ["a", "b"]; if nothing is selected on an optional question the answer is [].')],
    choices: NotRequired[Annotated[list[Annotated[Choice, AfterValidator(_validate_choice)]], Field(description="Options for 'multiple_choice' and 'multi_select' questions. Every choice needs a non-empty 'value'. An 'Other' free-form option is always appended automatically for both types; multi-select may collect multiple custom Other values. A 'multi_select' answer is a JSON array of the selected values, so values (including custom Other text) may contain commas, quotes, and newlines.")]],
    required: NotRequired[Annotated[bool, Field(description='Whether the user must answer. Defaults to true if omitted.', strict=True)]],
)
```

| Name | Type |
|------|------|
| `question` | `Annotated[str, AfterValidator(_validate_question_text), Field(description='The question text to display.', min_length=1)]` |
| `type` | `Annotated[QuestionType, Field(description='Question type. \'text\' for free-form input, \'multiple_choice\' for picking exactly one predefined option, \'multi_select\' for picking one or more predefined options. Both choice types always append an \'Other\' free-form option automatically; multi-select can accept multiple custom Other values (filling one reveals another). A \'multi_select\' answer comes back as a JSON array of the selected values (including any custom Other text), e.g. ["a", "b"]; if nothing is selected on an optional question the answer is [].')]` |
| `choices` | `NotRequired[Annotated[list[Annotated[Choice, AfterValidator(_validate_choice)]], Field(description="Options for 'multiple_choice' and 'multi_select' questions. Every choice needs a non-empty 'value'. An 'Other' free-form option is always appended automatically for both types; multi-select may collect multiple custom Other values. A 'multi_select' answer is a JSON array of the selected values, so values (including custom Other text) may contain commas, quotes, and newlines.")]]` |
| `required` | `NotRequired[Annotated[bool, Field(description='Whether the user must answer. Defaults to true if omitted.', strict=True)]]` |


## Properties

- `question`
- `type`
- `choices`
- `required`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3812967c84d90619848f3185f22470204fc88bd8/libs/code/deepagents_code/_ask_user_types.py#L269)