Hi all,
I tried to use conditional response variation within a form (Rasa 3.1) but for some reason it does not work. Now I am wondering whether I did something wrong or whether conditional response variation within the domain.yml is not meant to be used within a form?
This is my implementation:
DOMAIN:
intents:
- rate_food
- rate_color
- rate_drink
entities:
- food
- color
- drink
responses:
utter_ready_flow_form:
- text: "Ready for the flow form?"
utter_ask_flow_form_food:
- text: "Which has more delicious pizza, pasta or rice?"
utter_ask_flow_form_color:
- condition:
- type: slot
name: food
value: "pizza"
text: "You said pizza. What is nicer green, red or yellow?"
- condition:
- type: slot
name: food
value: "pasta"
text: "You said pasta. What is nicer green, red or yellow?"
- condition:
- type: slot
name: food
value: "rice"
text: "You said rice. What is nicer green, red or yellow?"
- text: "You said something else for the food question, that is the default answer."
utter_ask_flow_form_drink:
- condition:
- type: slot
name: color
value: "green"
text: "You said green. What tasts better, tea, coffee or milkS?"
- condition:
- type: slot
name: color
value: "red"
text: "You said red. What tasts better, tea, coffee or milkS?"
- condition:
- type: slot
name: color
value: "yellow"
text: "You said yellow. What tasts better, tea, coffee or milkS?"
- text: "You said something for the color question, that is the default answer."
utter_reached_end:
- text: "It has worked"
slots:
food:
type: categorical
influence_conversation: true
mappings:
- type: from_entity
entity: food
conditions:
- active_loop: flow_form
requested_slot: food
color:
type: categorical
influence_conversation: true
mappings:
- type: from_entity
entity: color
conditions:
- active_loop: flow_form
requested_slot: color
drink:
type: categorical
influence_conversation: true
mappings:
- type: from_entity
entity: drink
conditions:
- active_loop: flow_form
requested_slot: drink
forms:
flow_form:
required_slots:
- food
- color
- drink
NLU:
nlu:
- intent: rate_food
examples: |
- i say [pizza](food)
- definitely [pizza](food)
- my fav is [pasta](food)
- I say [pasta](food) is my favorite
- [rice](food) is the best
- the most delicious is [rice](food)
- intent: rate_color
examples: |
- i say [green](color)
- [green](color) is my favorite color
- i like [red](color) the most
- [yellow](color) is the most beautiful
- [red](color) is the nicest
- beautiful is [yellow](color)
- intent: rate_drink
examples: |
- i say [tea](drink)
- i only drink [coffee](drink)
- [milk](drink) is nice
- [tea](drink) is a good one
- best choice is [coffee](drink)
STORIES:
stories:
- story: happy path flow form
steps:
- action: utter_ready_flow_form
- intent: affirm
- action: flow_form
- active_loop: flow_form
- active_loop: null
- action: utter_reached_end
Would be great if someone could point me either to my mistake or explain why conditional response variation does not work within a form!
Many thanks!