# AI classify

> Asks an AI model one question and saves one of the allowed answers as flow.ai.

Slow: put it after anything the visitor waits for.

| | |
|---|---|
| Type | `aiClassify` |
| Group | Data |
| Slow | Yes. Put it after the last step the visitor sees |

## Exits

| Exit | Name |
|---|---|
| `next` | Next |

## Settings

| Key | Label | Takes | Default | Notes |
|---|---|---|---|---|
| `question` | Question | A string. May hold several lines. |  | What the model is asked. Only this text is sent to it, with any field in &#123;&#123;braces}} filled in, so it sees what you name here and nothing else. May hold fields in braces. |
| `answers` | Allowed answers | A string. May hold several lines. |  | One a line, from 2 to 20. The model must pick one. It is saved as flow.ai. |
| `onFailure` | If the model does not answer | `continue` Carry on, `stop` Stop the flow | `continue` |  |
| `fallback` | Answer to use then | A string. |  | Saved as flow.ai when the model does not answer and the flow carries on. Blank: flow.ai is empty. |

## Fields it adds

| Field | What |
|---|---|
| `flow.ai` | What the model answered (one of the step's allowed answers) |

## In a flow document

```json
{
  "id": "aiClassify1",
  "type": "aiClassify",
  "settings": {
    "onFailure": "continue"
  }
}
```
