So I’m working on a chatbot that accepts free form text from the user. There are 5 slots they can fill. However, I want them to be able to opt-out at any point by typing “done” on a blank line. So I set up a done intent in the nlu. And I created stories that after the done intent deactivate the loop (see below). But the form is not getting deactivated. The done intent get’s detected but it returns to filling the form even though the story deactivates the loop. Can someone tell me what I’m doing wrong? @rctatman
Stories.yml
- story: done in reflection -- add more
steps:
- intent: reflection_submit
- action: utter_reflection_submit
- action: reflection_form
- active_loop: reflection_form
- intent: done
- action: action_deactivate_loop
- active_loop: null
- action: action_process_reflections
- action: utter_reflection_continue
- intent: reflection_retry
- action: utter_reflection_retry
- action: utter_reflection_text
- action: reflection_form
- active_loop: reflection_form
- story: done in reflection -- submit
steps:
- intent: reflection_submit
- action: utter_reflection_submit
- action: reflection_form
- active_loop: reflection_form
- intent: done
- action: action_deactivate_loop
- active_loop: null
- action: action_process_reflections
- action: utter_reflection_continue
- intent: submit_as_is
- action: utter_submit_as_is
nlu.yml
- intent: done
examples: |
- done
- Done
- I'm Done
- Im done
- be done
domain.yml
utter_submit_options:
- text: What do you want to submit?
buttons:
- payload: /kritik_submit
title: Article analysis to Kritik.io
- payload: /reflection_submit
title: Lecture Reflection
utter_reflection_submit:
- text: Ok! Tell me your thoughts about the lecture.
utter_reflection_continue:
- text: Would you like to add more?
buttons:
- payload: /reflection_retry
title: Add More
- payload: /submit_as_is
title: Submit As Is
utter_reflection_retry:
- text: Ok! Here's your current reflection. You can copy and paste it below and then add to it. Hit enter and type "done" when you are finished
utter_reflection_text:
- text: '{full_reflection}'
utter_submit_as_is:
- text: Your reflection has been recorded, you've gotten credit for this assignment.
actions:
- action_check_analysis
- action_get_date
- action_look_up
- action_wait
- utter_anything_else
- utter_articleanalysis
- utter_ask_email_form_email
- utter_greet
- utter_wait_continue
- validate_email_form
- action_purge_done
- action_process_reflections
forms:
email_form:
email:
- type: from_entity
entity: email
reflection_form:
reflection1:
- type: from_text
reflection2:
- type: from_text
reflection3:
- type: from_text
reflection4:
- type: from_text
reflection5:
- type: from_text