rasa stories are able to recognize entities and “fill slots” but I’m wondering if there’s a way to use those values when uttering text back to the user?
eg is there a syntax like
// nlu.md
## intent:told_hobbies
- I like [fishing](hobby)
- I like [gym](hobby)
- when I have time I like [sports](hobby)
## lookup:hobby
data/hobbies.txt
to capture the user’s hobby, then we can use it later like:
// domain.yml
entities:
- hobby
responses:
utter_tell_hobby:
- text: "Oh, you like {hobby} eh"
If you want to use the value of the entity hobby in the response, you should define a slot with the same name. E.g. your domain file should look like this:
// domain.yml
entities:
- hobby
slots:
hobby:
type: text
responses:
utter_tell_hobby:
- text: "Oh, you like {hobby} eh"
If Rasa finds a hobby entity in the text and there is a slot with the same name, Rasa will copy over the value of that entity to the slot. Once that is done Rasa is able to use the value of the slot in the response.
You can read more about slots here Slots