I want to set a slot value using buttons, with the slot being of type bool.
This should then influence the story
It’s not being recognised, i.e. I’m getting a fallback response when I click either button
I’m not sure where my problem lies:
- the payload for the button?
- the slot type?
- the logic in the
slot_mappings
for theactions
?
Struggling to troubleshoot this. So grateful if anyone can point out where I’m going wrong?!
domain.yml
slots:
proceed:
type: bool
templates:
utter_ask_proceed:
- buttons:
- payload: '/choose{"proceed": false}'
title: no
- payload: '/choose{"proceed": true}'
title: no
text: Do you want to proceed?
stories.md
* proceed
- proceed_form
- form{"name": "proceed_form"}
- form{"name": null}
- slot{"proceed": "True"}
- next_form
* stop
- proceed_form
- form{"name": "proceed_form"}
- form{"name": null}
- slot{"proceed": "False"}
- exit
from proceed_form
in actions.py
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked"""
return {
"proceed": [
self.from_text(),
]
}