Skip to content

Commit

Permalink
Passing entities with buttons in domain.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm207 authored Apr 26, 2021
1 parent 10433fa commit 13fb527
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/docs/responses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ Each button in the list of `buttons` should have two keys:
* `title`: The text displayed on the buttons that the user sees.
* `payload`: The message sent from the user to the assistant when the button is clicked.

If you would like the buttons to also pass entities to the assistant:

```yaml-rasa {4-8} title="domain.yml"
responses:
utter_greet:
- text: "Hey! Would you like to purchase motor or home insurance?"
buttons:
- title: "Motor insurance"
payload: '/inform{{"insurance":"motor"}}'
- title: "Home insurance"
payload: '/inform{{"insurance":"home"}}'
```
Passing multiple entities is also possible with:

```
'/intent_name{{"entity_type_1":"entity_value_1", "entity_type_2": "entity_value_2"}}'
```

:::note bypass nlu with buttons
It's common to use buttons as a shortcut to bypass the machine-learning-based NLU interpreter

Expand Down

0 comments on commit 13fb527

Please sign in to comment.