Hi all,
I’m experimenting a bit with conditional responses. For that, I have different slots in which the user gets ask e.g. did you like it? or did you try it? … These slots should be filled with from_intent with values no or yes (or true or false) respectively. However, if there is another affirm or deny intent somewhere else in the conversation the slots get just filled, even though they should be filled only when asked these questions.
Here is my implementation:
responses:
utter_continute:
- text: "Do you want to continue?"
utter_food_trying:
- text: " Ever tried it?"
utter_food_ask_if_tried_liked_it:
- condition:
- type: slot
name: tried_food
value: yes
text: "And did you like it?"
- condition:
- type: slot
name: tried_food
value: no
text: "Oh okay! I can just say it is great."
utter_food_liked_true_or_false:
- condition:
- type: slot
name: tried_food
value: yes
- type: slot
name: tried_food
value: no
text: "Me too!"
- condition:
- type: slot
name: tried_food
value: yes
- type: slot
name: liked_food
value: no
text: "Maybe you should give it another try."
- condition:
- type: slot
name: liked_food
value: no
text: "Okidoki."
slots:
tried_food:
type: bool
influence_conversation: true
mappings:
- type: from_intent
intent: affirm
value: yes
- type: from_intent
intent: deny
value: no
liked_food:
type: bool
influence_conversation: true
mappings:
- type: from_intent
intent: affirm
value: yes
- type: from_intent
intent: deny
value: no
And my story:
stories:
- story: happy path food
steps:
- action: utter_continute
- intent: affirm
- action: utter_food_trying
- or:
- intent: deny
- intent: affirm
- action: utter_food_ask_if_tried_liked_it
- or:
- intent: deny
- intent: affirm
- action: utter_food_liked_true_or_false
I could create different intents for telling whether the tried it or liked it but this would be very similar nlu training data as the affirm and deny intent. So how can I make sure that those slots are only filled in this context and not somewhere else in the interaction e.g. whether the user wants to know the time or anything else which would be answered with yes or no…
Many thanks!