So I’m trying to create test for my form. I’m having trouble, because I would like to provide few “inform” sentences, from which form extract entities. It works well for 1 sentence, but it’s not working for more then 1.
- story: make an appointment, happy path
steps:
- user: |
Cześć
intent: greet
- action: utter_greet
- user: |
Chciałem się zapisać na wizytę do lekarza
intent: make_appointment
- action: action_reset_make_appointment_slots
- action: make_appointment_form
- active_loop: make_appointment_form
- user: |
[Jarosław Nowak](persName)
intent: inform
- user: |
[18 stycznia 1900](time)
intent: inform
- action: make_appointment_form <------ Here it fails, because it predicts: action_reset_make_appointment_slots and it should just keep going on gathering information
- active_loop: null
- action: utter_make_appointment_slots_values
- action: utter_ask_data_correctness
- user: |
Tak
intent: affirm
- action: action_submit_make_appointment_form
- action: utter_ask_if_date_suitable
- user: |
Tak.
intent: affirm
- action: action_make_appointment
- action: utter_ask_continue
- user: |
Nie, to wszystko.
intent: deny
- action: utter_thank_you
How should it look like? Or it’s not possible to provide few inform sentences, from which form extract entities? If I remove the sencond user response (after form activation), then it works just fine.
- story: make appointment (MA) and stop at data verification checkpoint
steps:
- or:
- intent: make_appointment
- intent: greet+make_appointment
- intent: greet+make_appointment+inform
- action: action_reset_make_appointment_slots
- action: make_appointment_form
- active_loop: make_appointment_form
- active_loop: null
- action: utter_make_appointment_slots_values
- action: utter_ask_data_correctness
- checkpoint: check_data_correctness
- story: 1a - handle user deny MA data correctness
steps:
- checkpoint: check_data_correctness
- or:
- intent: deny
- intent: stop
- action: action_reset_make_appointment_slots
- action: make_appointment_form
- active_loop: make_appointment_form
- active_loop: null
- action: utter_make_appointment_slots_values
- action: utter_ask_data_correctness
- checkpoint: check_data_correctness
- story: 1b - handle user affirm MA data correctness and stop at date confirmation
steps:
- checkpoint: check_data_correctness
- intent: affirm
- action: action_submit_make_appointment_form
- action: utter_ask_if_date_suitable
- checkpoint: check_date_confirmation
- story: 2a - handle user negates appointment date
steps:
- checkpoint: check_date_confirmation
- or:
- intent: deny
- intent: stop
- action: action_submit_make_appointment_form
- action: utter_ask_if_date_suitable
- checkpoint: check_date_confirmation
- story: 2b - handle user confirms appointment date
steps:
- checkpoint: check_date_confirmation
- intent: affirm
- action: action_make_appointment
- action: utter_ask_continue
- checkpoint: check_if_want_to_continue
- story: 3a - handle user don't want to continue after making appointment
steps:
- checkpoint: check_if_want_to_continue
- or:
- intent: deny
- intent: stop
- action: utter_thank_you
- story: 3b - handle user want to continue after making appointment
steps:
- checkpoint: check_if_want_to_continue
- intent: affirm
- action: action_listen
I know, that after form activation I have “action_reset_make_appointment_slots” in rules, but… I would like to write tests, where I activate form once and then provide multiple information sentences (just like in normal conversation).
Why would it? It’s just a sentence that contains intents: greet, make_appointment and also contains additional information, that would be used as mappings to slots on form initialization (thus also intent inform). Besides, dropping this intent doesn’t seem to be a solution to badly predicted next action in test (because I’m using make_appointment as form trigger either way).