From 2e637ff9bd6dddde9fa996519bc3c305d16623d9 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Tue, 28 May 2024 12:42:27 +0200 Subject: [PATCH 01/15] consistency in flows --- data/flows/add_contact.yml | 10 +- data/flows/book_restaurant.yml | 6 +- data/flows/check_balance.yml | 1 - data/flows/list_contacts.yml | 2 +- data/flows/patterns.yml | 14 +- data/flows/register_to_vote_in_california.yml | 2 +- data/flows/remove_contact.yml | 14 +- data/flows/replace_card.yml | 4 +- data/flows/replace_eligible_card.yml | 4 +- data/flows/setup_recurrent_payment.yml | 8 +- data/flows/transfer_money.yml | 10 +- domain/add_card.yml | 2 +- domain/add_contact.yml | 16 +- domain/book_restaurant.yml | 5 +- domain/check_balance.yml | 1 - domain/health_advice.yml | 2 +- domain/list_contacts.yml | 2 +- domain/patterns.yml | 7 +- domain/register_to_vote_in_california.yml | 2 +- domain/remove_contact.yml | 10 +- domain/replace_card.yml | 16 +- domain/setup_recurrent_payment.yml | 32 +-- domain/transfer_money.yml | 4 +- domain/verify_account.yml | 8 +- ...ks_restaurant_with_fixed_date_indirect.yml | 6 +- .../user_tries_to_use_abstract_values.yml | 2 +- ...uestion_and_then_cancels_the_flow_hard.yml | 2 - ...to_skip_a_question_multiple_times_hard.yml | 5 +- ...ser_tries_to_skip_a_question_once_hard.yml | 2 +- .../user_sets_up_recurrent_payment.yml | 2 +- ...to_skip_a_question_multiple_times_easy.yml | 9 - .../user_cancels_during_a_correction.yml | 2 +- .../user_changes_mind_based_on_new_info.yml | 2 +- .../corrections/user_cancels_correction.yml | 4 +- ...ts_amount_of_money_in_the_next_message.yml | 6 +- ...er_corrects_mentioning_old_value_first.yml | 4 +- ...ser_corrects_mentioning_old_value_last.yml | 6 +- ...corrects_recipient_in_the_next_message.yml | 4 +- .../user_corrects_recipient_late.yml | 8 +- .../corrections/user_corrects_string_slot.yml | 10 +- .../user_corrects_twice_in_row.yml | 2 +- .../digressions/user_asks_what_info_is.yml | 2 +- .../user_asks_why_information_is_needed.yml | 4 +- .../user_refuses_to_provide_information.yml | 2 +- .../user_sets_up_recurrent_payment.yml | 20 +- ...sfer_money_mentioning_one_slot_upfront.yml | 1 + ...fer_money_mentioning_two_slots_upfront.yml | 1 + ..._recurrent_payment_with_invalid_values.yml | 12 +- .../knowledge_question_during_flow.yml | 2 +- ...uestion_and_then_cancels_the_flow_easy.yml | 2 - ...stion_and_then_cancels_the_flow_medium.yml | 2 - ..._skip_a_question_multiple_times_medium.yml | 6 +- poetry.lock | 201 +++++++++--------- pyproject.toml | 2 +- 54 files changed, 250 insertions(+), 265 deletions(-) diff --git a/data/flows/add_contact.yml b/data/flows/add_contact.yml index db42c92..1843d7a 100644 --- a/data/flows/add_contact.yml +++ b/data/flows/add_contact.yml @@ -3,11 +3,11 @@ flows: description: add a contact to your contact list name: add a contact steps: - - collect: "add_contact_handle" - description: "a user handle starting with @" - - collect: "add_contact_name" - description: "a name of a person" - - collect: "add_contact_confirmation" + - collect: add_contact_handle + description: a user handle starting with @ + - collect: add_contact_name + description: a name of a person + - collect: add_contact_confirmation ask_before_filling: true next: - if: not slots.add_contact_confirmation diff --git a/data/flows/book_restaurant.yml b/data/flows/book_restaurant.yml index 64ae2ba..98ce7f9 100644 --- a/data/flows/book_restaurant.yml +++ b/data/flows/book_restaurant.yml @@ -14,15 +14,15 @@ flows: - if: not slots.is_restaurant_available then: - action: utter_restaurant_not_available - - id: "ask_alternative" + - id: ask_alternative collect: book_restaurant_alternative_dummy description: do not fill this slot, instead fill the given parts of the alternative into their respective slots - next: "ask_alternative" + next: ask_alternative - else: available - id: available - action: "utter_restaurant_available" + action: utter_restaurant_available - collect: book_restaurant_reservation_name ask_before_filling: true - collect: book_restaurant_confirmation diff --git a/data/flows/check_balance.yml b/data/flows/check_balance.yml index b364f59..4f86890 100644 --- a/data/flows/check_balance.yml +++ b/data/flows/check_balance.yml @@ -2,7 +2,6 @@ flows: check_balance: name: check your balance description: check the user's account balance. - steps: - action: check_balance - action: utter_current_balance diff --git a/data/flows/list_contacts.yml b/data/flows/list_contacts.yml index eabee59..a3ed3ae 100644 --- a/data/flows/list_contacts.yml +++ b/data/flows/list_contacts.yml @@ -5,7 +5,7 @@ flows: steps: - action: list_contacts next: - - if: "slots.contacts_list" + - if: slots.contacts_list then: - action: utter_list_contacts next: END diff --git a/data/flows/patterns.yml b/data/flows/patterns.yml index 11cab80..d89a4be 100644 --- a/data/flows/patterns.yml +++ b/data/flows/patterns.yml @@ -35,14 +35,14 @@ flows: pattern_cancel_flow: description: A meta flow that's started when a flow is cancelled. steps: - - id: "decide_cancel_step" + - id: decide_cancel_step noop: true next: - - if: "context.canceled_name = 'transfer money'" - then: "inform_user" - - else: "cancel_flow" # skips the inform step - - id: "inform_user" + - if: context.canceled_name = "transfer money" + then: inform_user + - else: cancel_flow # skips the inform step + - id: inform_user action: utter_flow_cancelled_rasa - next: "cancel_flow" - - id: "cancel_flow" + next: cancel_flow + - id: cancel_flow action: action_cancel_flow diff --git a/data/flows/register_to_vote_in_california.yml b/data/flows/register_to_vote_in_california.yml index 629fc79..1a8ceaa 100644 --- a/data/flows/register_to_vote_in_california.yml +++ b/data/flows/register_to_vote_in_california.yml @@ -1,6 +1,6 @@ flows: register_to_vote_in_california: - description: To enable a california resident to register to vote." + description: To enable a california resident to register to vote. if: slots.based_in_california steps: - action: utter_register_to_vote_in_california diff --git a/data/flows/remove_contact.yml b/data/flows/remove_contact.yml index e0412ff..06b37ae 100644 --- a/data/flows/remove_contact.yml +++ b/data/flows/remove_contact.yml @@ -3,24 +3,24 @@ flows: name: remove a contact description: remove a contact from your contact list steps: - - collect: "remove_contact_handle" - description: "a contact handle starting with @" - - collect: "remove_contact_confirmation" + - collect: remove_contact_handle + description: a contact handle starting with @ + - collect: remove_contact_confirmation ask_before_filling: true next: - - if: "not slots.remove_contact_confirmation" + - if: not slots.remove_contact_confirmation then: - action: utter_remove_contact_cancelled next: END - else: remove_contact - - id: "remove_contact" + - id: remove_contact action: remove_contact next: - - if: "slots.return_value == 'success'" + - if: "slots.return_value = 'success'" then: - action: utter_remove_contact_success next: END - - if: "slots.return_value == 'not_found'" + - if: "slots.return_value = 'not_found'" then: - action: utter_contact_not_in_list next: END diff --git a/data/flows/replace_card.yml b/data/flows/replace_card.yml index c68c684..e3aac33 100644 --- a/data/flows/replace_card.yml +++ b/data/flows/replace_card.yml @@ -6,9 +6,9 @@ flows: - collect: confirm_correct_card ask_before_filling: true next: - - if: "slots.confirm_correct_card" + - if: slots.confirm_correct_card then: - - link: "replace_eligible_card" + - link: replace_eligible_card - else: - action: utter_relevant_card_not_linked next: END diff --git a/data/flows/replace_eligible_card.yml b/data/flows/replace_eligible_card.yml index ad7b6a8..88fc5cc 100644 --- a/data/flows/replace_eligible_card.yml +++ b/data/flows/replace_eligible_card.yml @@ -5,7 +5,7 @@ flows: steps: - collect: replacement_reason next: - - if: slots.replacement_reason == "lost" + - if: slots.replacement_reason = "lost" then: - collect: was_card_used_fraudulently ask_before_filling: true @@ -15,7 +15,7 @@ flows: - action: utter_report_fraud next: END - else: start_replacement - - if: "slots.replacement_reason == 'damaged'" + - if: slots.replacement_reason = "damaged" then: start_replacement - else: - action: utter_unknown_replacement_reason_handover diff --git a/data/flows/setup_recurrent_payment.yml b/data/flows/setup_recurrent_payment.yml index d03151e..d50350b 100644 --- a/data/flows/setup_recurrent_payment.yml +++ b/data/flows/setup_recurrent_payment.yml @@ -27,16 +27,16 @@ flows: then: - action: utter_payment_cancelled next: END - - else: "execute_payment" - - id: "execute_payment" + - else: execute_payment + - id: execute_payment action: action_execute_recurrent_payment next: - if: slots.setup_recurrent_payment_successful then: - action: utter_payment_complete next: END - - else: "payment_failed" - - id: "payment_failed" + - else: payment_failed + - id: payment_failed action: utter_payment_failed - action: utter_failed_payment_handover - action: utter_failed_handoff diff --git a/data/flows/transfer_money.yml b/data/flows/transfer_money.yml index 35765c1..7bdd6b1 100644 --- a/data/flows/transfer_money.yml +++ b/data/flows/transfer_money.yml @@ -5,7 +5,7 @@ flows: steps: - collect: transfer_money_recipient description: the name of a person - - id: "ask_amount" # we keep this id, because we use it for a jump + - id: ask_amount # we keep this id, because we use it for a jump collect: transfer_money_amount_of_money description: the amount of money without any currency designation - action: check_transfer_funds @@ -16,7 +16,7 @@ flows: - set_slots: - transfer_money_amount_of_money: null - transfer_money_has_sufficient_funds: null - next: "ask_amount" + next: ask_amount - else: transfer_money_final_confirmation - id: transfer_money_final_confirmation collect: transfer_money_final_confirmation @@ -26,7 +26,7 @@ flows: - if: not slots.transfer_money_final_confirmation then: - action: utter_transfer_cancelled - next: "END" + next: END - else: execute_transfer - id: execute_transfer action: execute_transfer @@ -34,7 +34,7 @@ flows: - if: slots.transfer_money_transfer_successful then: - action: utter_transfer_complete - next: "END" + next: END - else: - action: utter_transfer_failed - next: "END" + next: END diff --git a/domain/add_card.yml b/domain/add_card.yml index 18e14d6..7abaece 100644 --- a/domain/add_card.yml +++ b/domain/add_card.yml @@ -2,4 +2,4 @@ version: "3.1" responses: utter_card_added: - - text: "Okay, added another card." + - text: Okay, added another card. diff --git a/domain/add_contact.yml b/domain/add_contact.yml index ff5bcae..1d6fec2 100644 --- a/domain/add_contact.yml +++ b/domain/add_contact.yml @@ -21,19 +21,19 @@ responses: utter_ask_add_contact_confirmation: - text: Do you want to add {add_contact_name}({add_contact_handle}) to your contacts? buttons: - - payload: "yes" - title: Yes - - payload: "no" - title: No, cancel + - payload: yes + title: "Yes" + - payload: no + title: "No, cancel" utter_ask_add_contact_handle: - text: What's the handle of the user you want to add? utter_ask_add_contact_name: - text: What's the name of the user you want to add? utter_add_contact_error: - - text: "Something went wrong, please try again." + - text: Something went wrong, please try again. utter_add_contact_cancelled: - - text: "Okay, I am cancelling this adding of a contact." + - text: Okay, I am cancelling this adding of a contact. utter_contact_already_exists: - - text: "There's already a contact with that handle in your list." + - text: There's already a contact with that handle in your list. utter_contact_added: - - text: "Contact added successfully." + - text: Contact added successfully. diff --git a/domain/book_restaurant.yml b/domain/book_restaurant.yml index 9ef2960..1b10080 100644 --- a/domain/book_restaurant.yml +++ b/domain/book_restaurant.yml @@ -1,6 +1,5 @@ version: "3.1" - actions: - check_restaurant_availability @@ -74,9 +73,9 @@ responses: - text: A table for {book_restaurant_number_of_people} at {book_restaurant_name_of_restaurant} for {book_restaurant_date}, {book_restaurant_time}. Do you confirm the booking? buttons: - payload: yes - title: Yes + title: "Yes" - payload: no - title: No, Cancel + title: "No, Cancel" utter_restaurant_available: - text: They have a table available for you at that time. utter_ask_book_restaurant_reservation_name: diff --git a/domain/check_balance.yml b/domain/check_balance.yml index 196ef7d..7a736b9 100644 --- a/domain/check_balance.yml +++ b/domain/check_balance.yml @@ -1,6 +1,5 @@ version: "3.1" - slots: current_balance: type: float diff --git a/domain/health_advice.yml b/domain/health_advice.yml index 69082c2..0b3776f 100644 --- a/domain/health_advice.yml +++ b/domain/health_advice.yml @@ -5,5 +5,5 @@ intents: responses: utter_cant_advice_on_health: - - text: "I'm sorry, I can't give you advice on your health." + - text: I'm sorry, I can't give you advice on your health. \ No newline at end of file diff --git a/domain/list_contacts.yml b/domain/list_contacts.yml index b4237a7..1ae61a0 100644 --- a/domain/list_contacts.yml +++ b/domain/list_contacts.yml @@ -11,6 +11,6 @@ slots: responses: utter_no_contacts: - - text: "You have no contacts in your list." + - text: You have no contacts in your list. utter_list_contacts: - text: "You currently have the following contacts:\n {contacts_list}" diff --git a/domain/patterns.yml b/domain/patterns.yml index 85804a7..75073cc 100644 --- a/domain/patterns.yml +++ b/domain/patterns.yml @@ -11,14 +11,13 @@ responses: - text: "Do you want to update the {{ context.corrected_slots.keys()|join(', ') }}?" buttons: - payload: yes - title: Yes + title: "Yes" - payload: no - title: No, please keep the previous information + title: "No, please keep the previous information" metadata: rephrase: True template: jinja - utter_not_corrected_previous_input: - - text: "Ok, I did not correct the previous input." + - text: Ok, I did not correct the previous input. metadata: rephrase: True diff --git a/domain/register_to_vote_in_california.yml b/domain/register_to_vote_in_california.yml index 1e7da98..58a3997 100644 --- a/domain/register_to_vote_in_california.yml +++ b/domain/register_to_vote_in_california.yml @@ -2,4 +2,4 @@ version: "3.1" responses: utter_register_to_vote_in_california: - - text: "Confirmed, you are now registered to vote in california." + - text: Confirmed, you are now registered to vote in california. diff --git a/domain/remove_contact.yml b/domain/remove_contact.yml index fec41f6..b0ca475 100644 --- a/domain/remove_contact.yml +++ b/domain/remove_contact.yml @@ -21,18 +21,18 @@ responses: utter_ask_remove_contact_handle: - text: What's the handle of the user you want to remove? utter_contact_not_in_list: - - text: "That contact is not in your list." + - text: That contact is not in your list. utter_remove_contact_error: - - text: "Something went wrong, please try again." + - text: Something went wrong, please try again. utter_remove_contact_success: - text: "Removed {remove_contact_handle}({remove_contact_name}) from your contacts." utter_ask_remove_contact_confirmation: - buttons: - payload: "yes" - title: Yes + title: "Yes" - payload: "false" - title: No, cancel the removal + title: "No, cancel the removal" text: "Should I remove {remove_contact_handle} from your contact list?" utter_remove_contact_cancelled: - - text: "Okay, I am cancelling this removal of a contact." + - text: Okay, I am cancelling this removal of a contact. diff --git a/domain/replace_card.yml b/domain/replace_card.yml index ffa385c..0e36ba7 100644 --- a/domain/replace_card.yml +++ b/domain/replace_card.yml @@ -21,23 +21,23 @@ responses: utter_ask_confirm_correct_card: - text: I've found the card with number ****3452 on file. Is this the card you want to replace? utter_relevant_card_not_linked: - - text: "Seems like I don't have the card you're asking about on file." + - text: Seems like I don't have the card you're asking about on file. utter_ask_replacement_reason: - - text: "Why do you need to replace your card?" + - text: Why do you need to replace your card? buttons: - title: "Lost" payload: "lost" - title: "Damaged" payload: "damaged" utter_ask_was_card_used_fraudulently: - - text: "Is it possible that someone else has managed to use your card?" + - text: Is it possible that someone else has managed to use your card? utter_will_cancel_and_send_new: - - text: "Alright, I'll cancel your card and send you a new one." + - text: Alright, I'll cancel your card and send you a new one. utter_new_card_has_been_ordered: - - text: "Your new card should arrive in 3 to 5 business days in a white envelope." + - text: Your new card should arrive in 3 to 5 business days in a white envelope. utter_report_fraud: - - text: "I am sorry to hear that. Unfortunately, I can't directly handle fraudulently used cards. Please go to FinX.com/disputes, to report the fraud on your account." + - text: I am sorry to hear that. Unfortunately, I can't directly handle fraudulently used cards. Please go to FinX.com/disputes, to report the fraud on your account. utter_unknown_replacement_reason_handover: - - text: "Let me connect you to an agent, to get the details of what happened to your card." + - text: Let me connect you to an agent, to get the details of what happened to your card. utter_failed_handoff: - - text: "I am sorry, I was not able to connect you to an agent. I have created a support ticket for you. Someone will reach out to you shortly." + - text: I am sorry, I was not able to connect you to an agent. I have created a support ticket for you. Someone will reach out to you shortly. diff --git a/domain/setup_recurrent_payment.yml b/domain/setup_recurrent_payment.yml index fe6092f..a05718c 100644 --- a/domain/setup_recurrent_payment.yml +++ b/domain/setup_recurrent_payment.yml @@ -42,52 +42,52 @@ slots: responses: utter_ask_recurrent_payment_type: - - text: "What type of payment would you like to set up?" + - text: What type of payment would you like to set up? buttons: - title: "Direct Debit" payload: "direct debit" - title: "Standing Order" payload: "standing order" utter_invalid_recurrent_payment_type: - - text: "Sorry, you requested a payment type that is not valid. Please select one of the available options." + - text: Sorry, you requested a payment type that is not valid. Please select one of the available options. utter_ask_recurrent_payment_recipient: - - text: "Who should receive the payment?" + - text: Who should receive the payment? utter_ask_recipient: - - text: "What is the name of the recipient?" + - text: What is the name of the recipient? utter_ask_recurrent_payment_amount_of_money: - - text: "How much money should be transferred?" + - text: How much money should be transferred? utter_ask_recurrent_payment_frequency: - - text: "How often should the payment be made?" + - text: How often should the payment be made? buttons: - title: "Monthly" payload: "monthly" - title: "Yearly" payload: "yearly" utter_invalid_recurrent_payment_frequency: - - text: "Sorry, you requested a payment frequency that is not valid. Please select one of the available options." + - text: Sorry, you requested a payment frequency that is not valid. Please select one of the available options. utter_ask_recurrent_payment_start_date: - - text: "When should the payment start?" + - text: When should the payment start? utter_ask_recurrent_payment_end_date: - - text: "When should the payment end?" + - text: When should the payment end? utter_invalid_recurrent_payment_end_date: - - text: "Sorry, you requested an end date that is before the start date." + - text: Sorry, you requested an end date that is before the start date. utter_ask_recurrent_payment_confirmation: - - text: "Please confirm that you want to set up this payment." + - text: Please confirm that you want to set up this payment. buttons: - title: "Yes" payload: "True" - title: "No" payload: "False" utter_payment_complete: - - text: "Your payment has been set up." + - text: Your payment has been set up. utter_payment_failed: - - text: "Sorry, your payment could not be set up." + - text: Sorry, your payment could not be set up. utter_payment_cancelled: - - text: "Your payment has been cancelled." + - text: Your payment has been cancelled. utter_failed_payment_handover: - - text: "Let me connect you to an agent, to get the details of what happened to your payment." + - text: Let me connect you to an agent, to get the details of what happened to your payment. utter_invalid_date: - - text: "Sorry, the date that you provided could not be validated." + - text: Sorry, the date that you provided could not be validated. actions: - action_execute_recurrent_payment diff --git a/domain/transfer_money.yml b/domain/transfer_money.yml index a496452..b4d7c93 100644 --- a/domain/transfer_money.yml +++ b/domain/transfer_money.yml @@ -44,7 +44,7 @@ responses: utter_ask_transfer_money_final_confirmation: - buttons: - payload: yes - title: Yes + title: "Yes" - payload: no - title: No, cancel the transaction + title: "No, cancel the transaction" text: Would you like to transfer {transfer_money_amount_of_money} to {transfer_money_recipient}? diff --git a/domain/verify_account.yml b/domain/verify_account.yml index 0c5d9a9..ca54136 100644 --- a/domain/verify_account.yml +++ b/domain/verify_account.yml @@ -49,9 +49,9 @@ responses: text: Your email address is {verify_account_email} and you are based in California with a yearly income exceeding 100,000$, correct? buttons: - payload: "yes" - title: Yes + title: "Yes" - payload: "no" - title: No, cancel + title: "No, cancel" - condition: - type: slot name: based_in_california @@ -59,6 +59,6 @@ responses: text: Your email address is {verify_account_email} and you are not based in California, correct? buttons: - payload: "yes" - title: Yes + title: "Yes" - payload: "no" - title: No, cancel + title: "No, cancel" diff --git a/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml b/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml index 48df6ef..4b5baf8 100644 --- a/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml +++ b/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml @@ -6,7 +6,7 @@ test_cases: - utter: utter_ask_book_restaurant_alternative_dummy - user: we won't have a babysitter then - utter: utter_ask_confirm_slot_correction - - user: yes + - user: "yes" - slot_was_set: - book_restaurant_is_date_flexible: false - utter: utter_corrected_previous_input @@ -14,7 +14,7 @@ test_cases: - utter: utter_ask_book_restaurant_alternative_dummy - user: that works too! - utter: utter_ask_confirm_slot_correction - - user: yes + - user: "yes" - slot_was_set: - book_restaurant_name_of_restaurant: Prometheus Pizza - utter: utter_corrected_previous_input @@ -22,5 +22,5 @@ test_cases: - utter: utter_ask_book_restaurant_reservation_name - user: Eliza - utter: utter_ask_book_restaurant_confirmation - - user: yes + - user: "yes" - utter: utter_confirm_restaurant_booking diff --git a/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml b/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml index 78544f7..4a6beab 100644 --- a/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml +++ b/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml @@ -9,5 +9,5 @@ test_cases: - utter: utter_ask_transfer_money_amount_of_money - user: "50" - utter: utter_ask_transfer_money_final_confirmation - - user: yes + - user: "yes" - utter: utter_transfer_complete diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml index a64e4fd..2b7d71d 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml @@ -3,11 +3,9 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: i don't want to answer this - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: i don't want to continue - utter: utter_flow_cancelled_rasa - utter: utter_can_do_something_else diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml index 5fccb81..d89e379 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml @@ -3,16 +3,13 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: i don't want to answer this for now - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: i don't want to answer this - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: okay 50 - utter: utter_ask_transfer_money_final_confirmation - - user: yes + - user: "yes" - utter: utter_transfer_complete diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml index 5a17863..8ff1cc0 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml @@ -8,5 +8,5 @@ test_cases: - utter: utter_ask_transfer_money_amount_of_money - user: okay 50 - utter: utter_ask_transfer_money_final_confirmation - - user: yes + - user: "yes" - utter: utter_transfer_complete diff --git a/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml b/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml index fa6c525..64b759d 100644 --- a/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml +++ b/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml @@ -5,5 +5,5 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: stand order - slot_was_set: - - recurrent_payment_type: "standing order" + - recurrent_payment_type: standing order - utter: utter_ask_recipient diff --git a/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml b/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml index 16417c0..f7f37ed 100644 --- a/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml +++ b/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml @@ -3,39 +3,30 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: skip this question - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: skip this step - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: go to next question - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: go to next step - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: skip this - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: next one - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: skip - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: next - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: okay 50 - utter: utter_ask_transfer_money_final_confirmation - user: "yes" diff --git a/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml b/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml index 95e9ff3..74125c9 100644 --- a/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml +++ b/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml @@ -5,6 +5,6 @@ test_cases: - utter: utter_ask_transfer_money_amount_of_money - user: oh sorry I meant John - utter: utter_ask_confirm_slot_correction - - user: nevermind, cancel the transfer + - user: never mind, cancel the transfer - utter: utter_flow_cancelled_rasa - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml b/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml index 2c40df1..39720ff 100644 --- a/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml +++ b/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml @@ -7,5 +7,5 @@ test_cases: - utter: utter_transactions - utter: utter_flow_continue_interrupted - utter: utter_ask_transfer_money_amount_of_money - - user: Ah nevermind, I already sent the money earlier + - user: Ah never mind, I already sent the money earlier - utter: utter_flow_cancelled_rasa \ No newline at end of file diff --git a/e2e_tests/passing/corrections/user_cancels_correction.yml b/e2e_tests/passing/corrections/user_cancels_correction.yml index e5aeea4..64519d1 100644 --- a/e2e_tests/passing/corrections/user_cancels_correction.yml +++ b/e2e_tests/passing/corrections/user_cancels_correction.yml @@ -4,9 +4,9 @@ test_cases: - user: send John 50 - slot_was_set: - transfer_money_amount_of_money: "50" - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_final_confirmation - - user: "Ah wait I think I actually owe him 60" + - user: Ah wait I think I actually owe him 60 - utter: utter_ask_confirm_slot_correction - user: "No" - utter: utter_not_corrected_previous_input diff --git a/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml b/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml index de6a09b..7b28cdf 100644 --- a/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml +++ b/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml @@ -5,13 +5,13 @@ test_cases: - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_amount_of_money - - user: "100 USD" + - user: 100 USD - slot_was_set: - transfer_money_amount_of_money: "100" - utter: utter_ask_transfer_money_final_confirmation - - user: "Ah, scratch that, I meant 110$" + - user: Ah, scratch that, I meant 110$ - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml index 534d11f..d420803 100644 --- a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml +++ b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml @@ -5,13 +5,13 @@ test_cases: - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_amount_of_money - user: "50" - slot_was_set: - transfer_money_amount_of_money: "50" - utter: utter_ask_transfer_money_final_confirmation - - user: "Ah, not 50, I meant 55" + - user: Ah, not 50, I meant 55 - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml index 0c76bbc..a810803 100644 --- a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml +++ b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml @@ -5,16 +5,16 @@ test_cases: - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_amount_of_money - user: Sorry, I meant to say Jimmy, not John - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: - - transfer_money_recipient: "Jimmy" + - transfer_money_recipient: Jimmy - utter: utter_corrected_previous_input - utter: utter_ask_transfer_money_amount_of_money - - user: "50$" + - user: 50$ - utter: utter_ask_transfer_money_final_confirmation - user: "yes" - utter: utter_transfer_complete diff --git a/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml b/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml index 4a16a46..682e418 100644 --- a/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml +++ b/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml @@ -5,13 +5,13 @@ test_cases: - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_amount_of_money - user: Sorry, I meant to say Joe - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: - - transfer_money_recipient: "Joe" + - transfer_money_recipient: Joe - utter: utter_corrected_previous_input - utter: utter_ask_transfer_money_amount_of_money - user: "50" diff --git a/e2e_tests/passing/corrections/user_corrects_recipient_late.yml b/e2e_tests/passing/corrections/user_corrects_recipient_late.yml index 6c0469f..c28b9da 100644 --- a/e2e_tests/passing/corrections/user_corrects_recipient_late.yml +++ b/e2e_tests/passing/corrections/user_corrects_recipient_late.yml @@ -5,17 +5,17 @@ test_cases: - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: - - transfer_money_recipient: "John" + - transfer_money_recipient: John - utter: utter_ask_transfer_money_amount_of_money - - user: "50 USD" + - user: 50 USD - slot_was_set: - transfer_money_amount_of_money: "50" - utter: utter_ask_transfer_money_final_confirmation - - user: "Oh wait, I want to send it to James!" + - user: Oh wait, I want to send it to James! - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: - - transfer_money_recipient: "James" + - transfer_money_recipient: James - utter: utter_corrected_previous_input - utter: utter_ask_transfer_money_final_confirmation - user: "yes" diff --git a/e2e_tests/passing/corrections/user_corrects_string_slot.yml b/e2e_tests/passing/corrections/user_corrects_string_slot.yml index 1f07d66..f404173 100644 --- a/e2e_tests/passing/corrections/user_corrects_string_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_string_slot.yml @@ -1,18 +1,18 @@ test_cases: - test_case: user corrects string slot steps: - - user: "I want to add Peter to my contacts" + - user: I want to add Peter to my contacts - slot_was_set: - - add_contact_name: "Peter" + - add_contact_name: Peter - utter: utter_ask_add_contact_handle - - user: "It's @PeterPark" + - user: It's @PeterPark - slot_was_set: - add_contact_handle: "@PeterPark" - utter: utter_ask_add_contact_confirmation - - user: "Ah, please use Spidey as the name" + - user: Ah, please use Spidey as the name - utter: utter_ask_confirm_slot_correction - user: "yes" - utter: utter_corrected_previous_input - utter: utter_ask_add_contact_confirmation - - user: yes + - user: "yes" - utter: utter_contact_added diff --git a/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml b/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml index e3df8ad..7fa5c7a 100644 --- a/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml +++ b/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml @@ -9,6 +9,6 @@ test_cases: - utter: utter_ask_confirm_slot_correction - user: "yes" - slot_was_set: - - transfer_money_recipient: "Alex" + - transfer_money_recipient: Alex - utter: utter_corrected_previous_input - utter: utter_ask_transfer_money_amount_of_money diff --git a/e2e_tests/passing/digressions/user_asks_what_info_is.yml b/e2e_tests/passing/digressions/user_asks_what_info_is.yml index 057f716..0f2b970 100644 --- a/e2e_tests/passing/digressions/user_asks_what_info_is.yml +++ b/e2e_tests/passing/digressions/user_asks_what_info_is.yml @@ -8,5 +8,5 @@ test_cases: - utter: utter_ask_add_contact_handle - user: Ah okay she sent it to me, it's @KatePurry - utter: utter_ask_add_contact_confirmation - - user: yes + - user: "yes" - utter: utter_contact_added diff --git a/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml b/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml index 3e5d8c5..57b321e 100644 --- a/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml +++ b/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml @@ -8,7 +8,7 @@ test_cases: - user: Why do you need to know this? - utter: utter_california_compliance - utter: utter_ask_based_in_california - - user: No + - user: "No" - utter: utter_ask_verify_account_confirmation - - user: Yes + - user: "Yes" - utter: utter_verify_account_success diff --git a/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml b/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml index 987a0b7..ff769c4 100644 --- a/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml +++ b/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml @@ -10,5 +10,5 @@ test_cases: - user: Why is that your business? - utter: utter_california_compliance - utter: utter_ask_verify_account_sufficient_california_income - - user: nevermind then!! + - user: never mind then!! - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/happy_path/user_sets_up_recurrent_payment.yml b/e2e_tests/passing/happy_path/user_sets_up_recurrent_payment.yml index 56725a1..9b904f6 100644 --- a/e2e_tests/passing/happy_path/user_sets_up_recurrent_payment.yml +++ b/e2e_tests/passing/happy_path/user_sets_up_recurrent_payment.yml @@ -5,11 +5,11 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: direct debit - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient - user: Jane Doe - slot_was_set: - - recurrent_payment_recipient: "Jane Doe" + - recurrent_payment_recipient: Jane Doe - utter: utter_ask_recurrent_payment_amount_of_money - user: 100 euros - slot_was_set: @@ -17,13 +17,13 @@ test_cases: - utter: utter_ask_recurrent_payment_frequency - user: monthly - slot_was_set: - - recurrent_payment_frequency: "monthly" + - recurrent_payment_frequency: monthly - utter: utter_ask_recurrent_payment_start_date - - user: "Jan 1st, 2050" + - user: Jan 1st, 2050 - slot_was_set: - recurrent_payment_start_date - utter: utter_ask_recurrent_payment_end_date - - user: "Jan 1st, 2051" + - user: Jan 1st, 2051 - slot_was_set: - recurrent_payment_end_date - utter: utter_ask_recurrent_payment_confirmation @@ -36,7 +36,7 @@ test_cases: steps: - user: I want to set up a new standing order payment. - slot_was_set: - - recurrent_payment_type: "standing order" + - recurrent_payment_type: standing order - utter: utter_ask_recipient - test_case: user wants to set up a new recurrent payment, but specifies the type incompletely @@ -45,7 +45,7 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: direct - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient - test_case: user wants to set up a new recurrent payment, but specifies the type incompletely, example 2 @@ -54,7 +54,7 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: d debit - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient - test_case: user wants to set up a new recurrent payment, but specifies over specifies the type @@ -63,7 +63,7 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: direct debit transfer payment - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient - test_case: user wants to set up a new recurrent payment, but specifies the type with spelling mistakes @@ -72,5 +72,5 @@ test_cases: - utter: utter_ask_recurrent_payment_type - user: direct debt - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient diff --git a/e2e_tests/passing/happy_path/user_transfer_money_mentioning_one_slot_upfront.yml b/e2e_tests/passing/happy_path/user_transfer_money_mentioning_one_slot_upfront.yml index 5f2168c..1ab01ae 100644 --- a/e2e_tests/passing/happy_path/user_transfer_money_mentioning_one_slot_upfront.yml +++ b/e2e_tests/passing/happy_path/user_transfer_money_mentioning_one_slot_upfront.yml @@ -11,6 +11,7 @@ test_cases: - utter: utter_ask_transfer_money_final_confirmation - user: "yes" - utter: utter_transfer_complete + - test_case: user transfers money mentioning money slot upfront steps: - user: I want to send 50 dollars diff --git a/e2e_tests/passing/happy_path/user_transfer_money_mentioning_two_slots_upfront.yml b/e2e_tests/passing/happy_path/user_transfer_money_mentioning_two_slots_upfront.yml index 5e14eda..32ea5ff 100644 --- a/e2e_tests/passing/happy_path/user_transfer_money_mentioning_two_slots_upfront.yml +++ b/e2e_tests/passing/happy_path/user_transfer_money_mentioning_two_slots_upfront.yml @@ -9,6 +9,7 @@ test_cases: - utter: utter_ask_transfer_money_final_confirmation - user: "yes" - utter: utter_transfer_complete + - test_case: user transfers money mentioning two slots upfront eg 2 steps: - user: I want to send 413$ to Maria diff --git a/e2e_tests/passing/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml b/e2e_tests/passing/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml index e7b26b8..cd2a7b5 100644 --- a/e2e_tests/passing/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml +++ b/e2e_tests/passing/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml @@ -3,11 +3,11 @@ test_cases: steps: - user: I want to set up a new standing order payment. - slot_was_set: - - recurrent_payment_type: "standing order" + - recurrent_payment_type: standing order - utter: utter_ask_recipient - user: Jane Doe - slot_was_set: - - recurrent_payment_recipient: "Jane Doe" + - recurrent_payment_recipient: Jane Doe - utter: utter_ask_recurrent_payment_amount_of_money - user: 20 pounds - slot_was_set: @@ -22,11 +22,11 @@ test_cases: steps: - user: i want to set up a new direct debit payment - slot_was_set: - - recurrent_payment_type: "direct debit" + - recurrent_payment_type: direct debit - utter: utter_ask_recipient - user: Jane Doe - slot_was_set: - - recurrent_payment_recipient: "Jane Doe" + - recurrent_payment_recipient: Jane Doe - utter: utter_ask_recurrent_payment_amount_of_money - user: 20 pounds - slot_was_set: @@ -34,9 +34,9 @@ test_cases: - utter: utter_ask_recurrent_payment_frequency - user: monthly - slot_was_set: - - recurrent_payment_frequency: "monthly" + - recurrent_payment_frequency: monthly - utter: utter_ask_recurrent_payment_start_date - - user: "01/10/20" + - user: 01/10/20 - utter: utter_invalid_date - slot_was_set: - recurrent_payment_start_date: null diff --git a/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml b/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml index 5cba0ef..2d454ed 100644 --- a/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml +++ b/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml @@ -8,5 +8,5 @@ test_cases: - utter: utter_ask_transfer_money_amount_of_money - user: great, 50$ then - utter: utter_ask_transfer_money_final_confirmation - - user: yes + - user: "yes" - utter: utter_transfer_complete diff --git a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_easy.yml b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_easy.yml index db9a776..6c9c188 100644 --- a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_easy.yml +++ b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_easy.yml @@ -3,11 +3,9 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: skip this question - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: cancel - utter: utter_flow_cancelled_rasa - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_medium.yml b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_medium.yml index 875523a..ba6b542 100644 --- a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_medium.yml +++ b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_medium.yml @@ -3,11 +3,9 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: ask me something else - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: one moment, stop that - utter: utter_flow_cancelled_rasa - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_multiple_times_medium.yml b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_multiple_times_medium.yml index 9923828..2c88341 100644 --- a/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_multiple_times_medium.yml +++ b/e2e_tests/passing/skip_question/user_tries_to_skip_a_question_multiple_times_medium.yml @@ -3,20 +3,16 @@ test_cases: steps: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - - user: ask me something else - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: proceed to the next one - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: i want to answer next question first - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - - user: okay 50 - utter: utter_ask_transfer_money_final_confirmation - - user: yes + - user: "yes" - utter: utter_transfer_complete diff --git a/poetry.lock b/poetry.lock index 9e2f8be..a1e7a3d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1214,23 +1214,23 @@ packaging = "*" [[package]] name = "dnspython" -version = "2.3.0" +version = "2.6.1" description = "DNS toolkit" optional = false -python-versions = ">=3.7,<4.0" +python-versions = ">=3.8" files = [ - {file = "dnspython-2.3.0-py3-none-any.whl", hash = "sha256:89141536394f909066cabd112e3e1a37e4e654db00a25308b0f130bc3152eb46"}, - {file = "dnspython-2.3.0.tar.gz", hash = "sha256:224e32b03eb46be70e12ef6d64e0be123a64e621ab4c0822ff6d450d52a540b9"}, + {file = "dnspython-2.6.1-py3-none-any.whl", hash = "sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50"}, + {file = "dnspython-2.6.1.tar.gz", hash = "sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc"}, ] [package.extras] -curio = ["curio (>=1.2,<2.0)", "sniffio (>=1.1,<2.0)"] -dnssec = ["cryptography (>=2.6,<40.0)"] -doh = ["h2 (>=4.1.0)", "httpx (>=0.21.1)", "requests (>=2.23.0,<3.0.0)", "requests-toolbelt (>=0.9.1,<0.11.0)"] -doq = ["aioquic (>=0.9.20)"] -idna = ["idna (>=2.1,<4.0)"] -trio = ["trio (>=0.14,<0.23)"] -wmi = ["wmi (>=1.5.1,<2.0.0)"] +dev = ["black (>=23.1.0)", "coverage (>=7.0)", "flake8 (>=7)", "mypy (>=1.8)", "pylint (>=3)", "pytest (>=7.4)", "pytest-cov (>=4.1.0)", "sphinx (>=7.2.0)", "twine (>=4.0.0)", "wheel (>=0.42.0)"] +dnssec = ["cryptography (>=41)"] +doh = ["h2 (>=4.1.0)", "httpcore (>=1.0.0)", "httpx (>=0.26.0)"] +doq = ["aioquic (>=0.9.25)"] +idna = ["idna (>=3.6)"] +trio = ["trio (>=0.23)"] +wmi = ["wmi (>=1.5.1)"] [[package]] name = "docopt" @@ -4316,85 +4316,93 @@ model = ["milvus-model (>=0.1.0)"] [[package]] name = "pymongo" -version = "4.3.3" +version = "4.6.3" description = "Python driver for MongoDB " optional = false python-versions = ">=3.7" files = [ - {file = "pymongo-4.3.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:74731c9e423c93cbe791f60c27030b6af6a948cef67deca079da6cd1bb583a8e"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux1_i686.whl", hash = "sha256:66413c50d510e5bcb0afc79880d1693a2185bcea003600ed898ada31338c004e"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:9b87b23570565a6ddaa9244d87811c2ee9cffb02a753c8a2da9c077283d85845"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux2014_i686.whl", hash = "sha256:695939036a320f4329ccf1627edefbbb67cc7892b8222d297b0dd2313742bfee"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux2014_ppc64le.whl", hash = "sha256:ffcc8394123ea8d43fff8e5d000095fe7741ce3f8988366c5c919c4f5eb179d3"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux2014_s390x.whl", hash = "sha256:943f208840777f34312c103a2d1caab02d780c4e9be26b3714acf6c4715ba7e1"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:01f7cbe88d22440b6594c955e37312d932fd632ffed1a86d0c361503ca82cc9d"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdb87309de97c63cb9a69132e1cb16be470e58cffdfbad68fdd1dc292b22a840"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d86c35d94b5499689354ccbc48438a79f449481ee6300f3e905748edceed78e7"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a966d5304b7d90c45c404914e06bbf02c5bf7e99685c6c12f0047ef2aa837142"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be1d2ce7e269215c3ee9a215e296b7a744aff4f39233486d2c4d77f5f0c561a6"}, - {file = "pymongo-4.3.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:55b6163dac53ef1e5d834297810c178050bd0548a4136cd4e0f56402185916ca"}, - {file = "pymongo-4.3.3-cp310-cp310-win32.whl", hash = "sha256:dc0cff74cd36d7e1edba91baa09622c35a8a57025f2f2b7a41e3f83b1db73186"}, - {file = "pymongo-4.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:cafa52873ae12baa512a8721afc20de67a36886baae6a5f394ddef0ce9391f91"}, - {file = "pymongo-4.3.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:599d3f6fbef31933b96e2d906b0f169b3371ff79ea6aaf6ecd76c947a3508a3d"}, - {file = "pymongo-4.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c0640b4e9d008e13956b004d1971a23377b3d45491f87082161c92efb1e6c0d6"}, - {file = "pymongo-4.3.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:341221e2f2866a5960e6f8610f4cbac0bb13097f3b1a289aa55aba984fc0d969"}, - {file = "pymongo-4.3.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e7fac06a539daef4fcf5d8288d0d21b412f9b750454cd5a3cf90484665db442a"}, - {file = "pymongo-4.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3a51901066696c4af38c6c63a1f0aeffd5e282367ff475de8c191ec9609b56d"}, - {file = "pymongo-4.3.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3055510fdfdb1775bc8baa359783022f70bb553f2d46e153c094dfcb08578ff"}, - {file = "pymongo-4.3.3-cp311-cp311-win32.whl", hash = "sha256:524d78673518dcd352a91541ecd2839c65af92dc883321c2109ef6e5cd22ef23"}, - {file = "pymongo-4.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:b8a03af1ce79b902a43f5f694c4ca8d92c2a4195db0966f08f266549e2fc49bc"}, - {file = "pymongo-4.3.3-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:39b03045c71f761aee96a12ebfbc2f4be89e724ff6f5e31c2574c1a0e2add8bd"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:6fcfbf435eebf8a1765c6d1f46821740ebe9f54f815a05c8fc30d789ef43cb12"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:7d43ac9c7eeda5100fb0a7152fab7099c9cf9e5abd3bb36928eb98c7d7a339c6"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:3b93043b14ba7eb08c57afca19751658ece1cfa2f0b7b1fb5c7a41452fbb8482"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:c09956606c08c4a7c6178a04ba2dd9388fcc5db32002ade9c9bc865ab156ab6d"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux2014_ppc64le.whl", hash = "sha256:b0cfe925610f2fd59555bb7fc37bd739e4b197d33f2a8b2fae7b9c0c6640318c"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:4d00b91c77ceb064c9b0459f0d6ea5bfdbc53ea9e17cf75731e151ef25a830c7"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:c6258a3663780ae47ba73d43eb63c79c40ffddfb764e09b56df33be2f9479837"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c29e758f0e734e1e90357ae01ec9c6daf19ff60a051192fe110d8fb25c62600e"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12f3621a46cdc7a9ba8080422262398a91762a581d27e0647746588d3f995c88"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:47f7aa217b25833cd6f0e72b0d224be55393c2692b4f5e0561cb3beeb10296e9"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c2fdc855149efe7cdcc2a01ca02bfa24761c640203ea94df467f3baf19078be"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5effd87c7d363890259eac16c56a4e8da307286012c076223997f8cc4a8c435b"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6dd1cf2995fdbd64fc0802313e8323f5fa18994d51af059b5b8862b73b5e53f0"}, - {file = "pymongo-4.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:bb869707d8e30645ed6766e44098600ca6cdf7989c22a3ea2b7966bb1d98d4b2"}, - {file = "pymongo-4.3.3-cp37-cp37m-win32.whl", hash = "sha256:49210feb0be8051a64d71691f0acbfbedc33e149f0a5d6e271fddf6a12493fed"}, - {file = "pymongo-4.3.3-cp37-cp37m-win_amd64.whl", hash = "sha256:54c377893f2cbbffe39abcff5ff2e917b082c364521fa079305f6f064e1a24a9"}, - {file = "pymongo-4.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c184ec5be465c0319440734491e1aa4709b5f3ba75fdfc9dbbc2ae715a7f6829"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:dca34367a4e77fcab0693e603a959878eaf2351585e7d752cac544bc6b2dee46"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cd6a4afb20fb3c26a7bfd4611a0bbb24d93cbd746f5eb881f114b5e38fd55501"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:0c466710871d0026c190fc4141e810cf9d9affbf4935e1d273fbdc7d7cda6143"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:d07d06dba5b5f7d80f9cc45501456e440f759fe79f9895922ed486237ac378a8"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux2014_ppc64le.whl", hash = "sha256:711bc52cb98e7892c03e9b669bebd89c0a890a90dbc6d5bb2c47f30239bac6e9"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:34b040e095e1671df0c095ec0b04fc4ebb19c4c160f87c2b55c079b16b1a6b00"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:4ed00f96e147f40b565fe7530d1da0b0f3ab803d5dd5b683834500fa5d195ec4"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef888f48eb9203ee1e04b9fb27429017b290fb916f1e7826c2f7808c88798394"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:316498b642c00401370b2156b5233b256f9b33799e0a8d9d0b8a7da217a20fca"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa7e202feb683dad74f00dea066690448d0cfa310f8a277db06ec8eb466601b5"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:52896e22115c97f1c829db32aa2760b0d61839cfe08b168c2b1d82f31dbc5f55"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7c051fe37c96b9878f37fa58906cb53ecd13dcb7341d3a85f1e2e2f6b10782d9"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5134d33286c045393c7beb51be29754647cec5ebc051cf82799c5ce9820a2ca2"}, - {file = "pymongo-4.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a9c2885b4a8e6e39db5662d8b02ca6dcec796a45e48c2de12552841f061692ba"}, - {file = "pymongo-4.3.3-cp38-cp38-win32.whl", hash = "sha256:a6cd6f1db75eb07332bd3710f58f5fce4967eadbf751bad653842750a61bda62"}, - {file = "pymongo-4.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:d5571b6978750601f783cea07fb6b666837010ca57e5cefa389c1d456f6222e2"}, - {file = "pymongo-4.3.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:81d1a7303bd02ca1c5be4aacd4db73593f573ba8e0c543c04c6da6275fd7a47e"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:016c412118e1c23fef3a1eada4f83ae6e8844fd91986b2e066fc1b0013cdd9ae"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:8fd6e191b92a10310f5a6cfe10d6f839d79d192fb02480bda325286bd1c7b385"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:e2961b05f9c04a53da8bfc72f1910b6aec7205fcf3ac9c036d24619979bbee4b"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:b38a96b3eed8edc515b38257f03216f382c4389d022a8834667e2bc63c0c0c31"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux2014_ppc64le.whl", hash = "sha256:c1a70c51da9fa95bd75c167edb2eb3f3c4d27bc4ddd29e588f21649d014ec0b7"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:8a06a0c02f5606330e8f2e2f3b7949877ca7e4024fa2bff5a4506bec66c49ec7"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:6c2216d8b6a6d019c6f4b1ad55f890e5e77eb089309ffc05b6911c09349e7474"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eac0a143ef4f28f49670bf89cb15847eb80b375d55eba401ca2f777cd425f338"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:08fc250b5552ee97ceeae0f52d8b04f360291285fc7437f13daa516ce38fdbc6"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704d939656e21b073bfcddd7228b29e0e8a93dd27b54240eaafc0b9a631629a6"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1074f1a6f23e28b983c96142f2d45be03ec55d93035b471c26889a7ad2365db3"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b16250238de8dafca225647608dddc7bbb5dce3dd53b4d8e63c1cc287394c2f"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7761cacb8745093062695b11574effea69db636c2fd0a9269a1f0183712927b4"}, - {file = "pymongo-4.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:fd7bb378d82b88387dc10227cfd964f6273eb083e05299e9b97cbe075da12d11"}, - {file = "pymongo-4.3.3-cp39-cp39-win32.whl", hash = "sha256:dc24d245026a72d9b4953729d31813edd4bd4e5c13622d96e27c284942d33f24"}, - {file = "pymongo-4.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:fc28e8d85d392a06434e9a934908d97e2cf453d69488d2bcd0bfb881497fd975"}, - {file = "pymongo-4.3.3.tar.gz", hash = "sha256:34e95ffb0a68bffbc3b437f2d1f25fc916fef3df5cdeed0992da5f42fae9b807"}, + {file = "pymongo-4.6.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e344d0afdd7c06c1f1e66a4736593293f432defc2191e6b411fc9c82fa8c5adc"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux1_i686.whl", hash = "sha256:731a92dfc4022db763bfa835c6bd160f2d2cba6ada75749c2ed500e13983414b"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:c4726e36a2f7e92f09f5b8e92ba4db7525daffe31a0dcbcf0533edc0ade8c7d8"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux2014_i686.whl", hash = "sha256:00e6cfce111883ca63a3c12878286e0b89871f4b840290e61fb6f88ee0e687be"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux2014_ppc64le.whl", hash = "sha256:cc7a26edf79015c58eea46feb5b262cece55bc1d4929a8a9e0cbe7e6d6a9b0eb"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux2014_s390x.whl", hash = "sha256:4955be64d943b30f2a7ff98d818ca530f7cb37450bc6b32c37e0e74821907ef8"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:af039afc6d787502c02089759778b550cb2f25dbe2780f5b050a2e37031c3fbf"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ccc15a7c7a99aed7d0831eaf78a607f1db0c7a255f96e3d18984231acd72f70c"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8e97c138d811e9367723fcd07c4402a9211caae20479fdd6301d57762778a69f"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ebcc145c74d06296ce0cad35992185064e5cb2aadef719586778c144f0cd4d37"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:664c64b6bdb31aceb80f0556951e5e2bf50d359270732268b4e7af00a1cf5d6c"}, + {file = "pymongo-4.6.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4056bc421d4df2c61db4e584415f2b0f1eebb92cbf9222f7f38303467c37117"}, + {file = "pymongo-4.6.3-cp310-cp310-win32.whl", hash = "sha256:cdbea2aac1a4caa66ee912af3601557d2bda2f9f69feec83601c78c7e53ece64"}, + {file = "pymongo-4.6.3-cp310-cp310-win_amd64.whl", hash = "sha256:6cec7279e5a1b74b257d0270a8c97943d745811066630a6bc6beb413c68c6a33"}, + {file = "pymongo-4.6.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:138b9fa18d40401c217bc038a48bcde4160b02d36d8632015b1804971a2eaa2f"}, + {file = "pymongo-4.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60931b0e07448afe8866ffff764cd5bf4b1a855dc84c7dcb3974c6aa6a377a59"}, + {file = "pymongo-4.6.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9b35f8bded43ff91475305445fedf0613f880ff7e25c75ae1028e1260a9b7a86"}, + {file = "pymongo-4.6.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:872bad5c83f7eec9da11e1fef5f858c6a4c79fe4a83c7780e7b0fe95d560ae3f"}, + {file = "pymongo-4.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2ad3e5bfcd345c0bfe9af69a82d720860b5b043c1657ffb513c18a0dee19c19"}, + {file = "pymongo-4.6.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e208f2ab7b495eff8fd175022abfb0abce6307ac5aee3f4de51fc1a459b71c9"}, + {file = "pymongo-4.6.3-cp311-cp311-win32.whl", hash = "sha256:4670edbb5ddd71a4d555668ef99b032a5f81b59e4145d66123aa0d831eac7883"}, + {file = "pymongo-4.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:1c2761302b6cbfd12e239ce1b8061d4cf424a361d199dcb32da534985cae9350"}, + {file = "pymongo-4.6.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:722f2b709b63311c0efda4fa4c603661faa4bec6bad24a6cc41a3bc6d841bf09"}, + {file = "pymongo-4.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:994386a4d6ad39e18bcede6dc8d1d693ec3ed897b88f86b1841fbc37227406da"}, + {file = "pymongo-4.6.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:391aea047bba928006114282f175bc8d09c53fe1b7d8920bf888325e229302fe"}, + {file = "pymongo-4.6.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4330c022024e7994b630199cdae909123e4b0e9cf15335de71b146c0f6a2435"}, + {file = "pymongo-4.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01277a7e183c59081368e4efbde2b8f577014431b257959ca98d3a4e8682dd51"}, + {file = "pymongo-4.6.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d30d5d7963453b478016bf7b0d87d7089ca24d93dbdecfbc9aa32f1b4772160a"}, + {file = "pymongo-4.6.3-cp312-cp312-win32.whl", hash = "sha256:a023804a3ac0f85d4510265b60978522368b5815772262e61e3a2222a8b315c9"}, + {file = "pymongo-4.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:2a6ae9a600bbc2dbff719c98bf5da584fb8a4f2bb23729a09be2e9c3dbc61c8a"}, + {file = "pymongo-4.6.3-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:3b909e5b1864de01510079b39bbdc480720c37747be5552b354bc73f02c24a3c"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:48c60bd32ec141c0d45d8471179430003d9fb4490da181b8165fb1dce9cc255c"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:36d7049fc183fe4edda3eae7f66ea14c660921429e082fe90b4b7f4dc6664a70"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:18e5c161b18660f1c9d1f78236de45520a436be65e42b7bb51f25f74ad22bdde"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:e458e6fc2b7dd40d15cda04898bd2d8c9ff7ae086c516bc261628d54eb4e3158"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux2014_ppc64le.whl", hash = "sha256:e420e74c6db4594a6d09f39b58c0772679006cb0b4fc40901ba608794d87dad2"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:9c9340c7161e112e36ebb97fbba1cdbe7db3dfacb694d2918b1f155a01f3d859"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:26d036e0f5de09d0b21d0fc30314fcf2ae6359e4d43ae109aa6cf27b4ce02d30"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7cf28d9c90e40d4e385b858e4095739829f466f23e08674085161d86bb4bb10"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9066dff9dc0a182478ca5885d0b8a2b820b462e19459ada109df7a3ced31b272"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1e1586ebdebe0447a24842480defac17c496430a218486c96e2da3f164c0f05"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b3853fb66bf34ce1b6e573e1bbb3cb28763be9d1f57758535757faf1ab2f24a"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:462684a6f5ce6f2661c30eab4d1d459231e0eed280f338e716e31a24fc09ccb3"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0a4ea44e5a913bdb7c9abd34c69e9fcfac10dfaf49765463e0dc1ea922dd2a9d"}, + {file = "pymongo-4.6.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:098d420a8214ad25f872de7e8b309441995d12ece0376218a04d9ed5d2222cf3"}, + {file = "pymongo-4.6.3-cp37-cp37m-win32.whl", hash = "sha256:7330245253fbe2e09845069d2f4d35dd27f63e377034c94cb0ddac18bc8b0d82"}, + {file = "pymongo-4.6.3-cp37-cp37m-win_amd64.whl", hash = "sha256:151361c101600a85cb1c1e0db4e4b28318b521fcafa9b62d389f7342faaaee80"}, + {file = "pymongo-4.6.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:4d167d546352869125dc86f6fda6dffc627d8a9c8963eaee665825f2520d542b"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:eaf3d594ebfd5e1f3503d81e06a5d78e33cda27418b36c2491c3d4ad4fca5972"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7ee79e02a7c5ed34706ecb5dad19e6c7d267cf86d28c075ef3127c58f3081279"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af5c5112db04cf62a5d9d224a24f289aaecb47d152c08a457cca81cee061d5bd"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:6b5aec78aa4840e8d6c3881900259892ab5733a366696ca10d99d68c3d73eaaf"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux2014_ppc64le.whl", hash = "sha256:9757602fb45c8ecc1883fe6db7c59c19d87eb3c645ec9342d28a6026837da931"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:dde9fb6e105ce054339256a8b7a9775212ebb29596ef4e402d7bbc63b354d202"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:7df8b166d3db6cfead4cf55b481408d8f0935d8bd8d6dbf64507c49ef82c7200"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53451190b8628e1ce7d1fe105dc376c3f10705127bd3b51fe3e107b9ff1851e6"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:75107a386d4ccf5291e75cce8ca3898430e7907f4cc1208a17c9efad33a1ea84"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4a0660ce32d8459b7f12dc3ca0141528fead62d3cce31b548f96f30902074cc0"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa310096450e9c461b7dfd66cbc1c41771fe36c06200440bb3e062b1d4a06b6e"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5f465cca9b178e7bb782f952dd58e9e92f8ba056e585959465f2bb50feddef5f"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c67c19f653053ef2ebd7f1837c2978400058d6d7f66ec5760373a21eaf660158"}, + {file = "pymongo-4.6.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:c701de8e483fb5e53874aab642235361aac6de698146b02c644389eaa8c137b6"}, + {file = "pymongo-4.6.3-cp38-cp38-win32.whl", hash = "sha256:90525454546536544307e6da9c81f331a71a1b144e2d038fec587cc9f9250285"}, + {file = "pymongo-4.6.3-cp38-cp38-win_amd64.whl", hash = "sha256:3e1ba5a037c526a3f4060c28f8d45d71ed9626e2bf954b0cd9a8dcc3b45172ee"}, + {file = "pymongo-4.6.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:14a82593528cddc93cfea5ee78fac95ae763a3a4e124ca79ee0b24fbbc6da1c9"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:cd6c15242d9306ff1748681c3235284cbe9f807aeaa86cd17d85e72af626e9a7"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:6de33f1b2eed91b802ec7abeb92ffb981d052f3604b45588309aae9e0f6e3c02"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:0182899aafe830f25cf96c5976d724efeaaf7b6646c15424ad8dd25422b2efe1"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:8d0ea740a2faa56f930dc82c5976d96c017ece26b29a1cddafb58721c7aab960"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux2014_ppc64le.whl", hash = "sha256:5c8a4982f5eb767c6fbfb8fb378683d09bcab7c3251ba64357eef600d43f6c23"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:becfa816545a48c8e740ac2fd624c1c121e1362072d68ffcf37a6b1be8ea187e"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:ff7d1f449fcad23d9bc8e8dc2b9972be38bcd76d99ea5f7d29b2efa929c2a7ff"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e097f877de4d6af13a33ef938bf2a2350f424be5deabf8b857da95f5b080487a"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:705a9bfd619301ee7e985d6f91f68b15dfcb2f6f36b8cc225cc82d4260d2bce5"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2ef1b4992ee1cb8bb16745e70afa0c02c5360220a7a8bb4775888721f052d0a6"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3d10bdd46cbc35a2109737d36ffbef32e7420569a87904738ad444ccb7ac2c5"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17c1c143ba77d6e21fc8b48e93f0a5ed982a23447434e9ee4fbb6d633402506b"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9e51e30d67b468a2a634ade928b30cb3e420127f148a9aec60de33f39087bdc4"}, + {file = "pymongo-4.6.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:bec8e4e88984be157408f1923d25869e1b575c07711cdbdde596f66931800934"}, + {file = "pymongo-4.6.3-cp39-cp39-win32.whl", hash = "sha256:98877a9c4ad42df8253a12d8d17a3265781d1feb5c91c767bd153f88feb0b670"}, + {file = "pymongo-4.6.3-cp39-cp39-win_amd64.whl", hash = "sha256:6d5b35da9e16cda630baed790ffc3d0d01029d269523a7cec34d2ec7e6823e75"}, + {file = "pymongo-4.6.3.tar.gz", hash = "sha256:400074090b9a631f120b42c61b222fd743490c133a5d2f99c0208cefcccc964e"}, ] [package.dependencies] @@ -4402,10 +4410,11 @@ dnspython = ">=1.16.0,<3.0.0" [package.extras] aws = ["pymongo-auth-aws (<2.0.0)"] -encryption = ["pymongo-auth-aws (<2.0.0)", "pymongocrypt (>=1.3.0,<2.0.0)"] -gssapi = ["pykerberos"] -ocsp = ["certifi", "pyopenssl (>=17.2.0)", "requests (<3.0.0)", "service-identity (>=18.1.0)"] +encryption = ["certifi", "pymongo[aws]", "pymongocrypt (>=1.6.0,<2.0.0)"] +gssapi = ["pykerberos", "winkerberos (>=0.5.0)"] +ocsp = ["certifi", "cryptography (>=2.5)", "pyopenssl (>=17.2.0)", "requests (<3.0.0)", "service-identity (>=18.1.0)"] snappy = ["python-snappy"] +test = ["pytest (>=7)"] zstd = ["zstandard"] [[package]] @@ -4740,20 +4749,20 @@ fire = "*" [[package]] name = "rasa-pro" -version = "3.8.1" +version = "3.8.5" description = "State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development." optional = false python-versions = ">=3.8.1,<3.11" files = [ - {file = "rasa_pro-3.8.1-py3-none-any.whl", hash = "sha256:5336449bb2d2d810ec0403de43b3baec9b5489a288b507f5f4cb8f095af75d6f"}, - {file = "rasa_pro-3.8.1.tar.gz", hash = "sha256:206686e638a3b3d48c6469807516f4e0eae6bb6b694c8e6718c8636681a578af"}, + {file = "rasa_pro-3.8.5-py3-none-any.whl", hash = "sha256:007529440af6151db9c35542b58b2e59ed5704d47fa320d8ca26540a47e66ead"}, + {file = "rasa_pro-3.8.5.tar.gz", hash = "sha256:c04b71c539d4af3c5235fea145cca0b60a6ca21ad3e20d5bfa9a045c18d330d9"}, ] [package.dependencies] absl-py = ">=2.0,<2.1" aio-pika = ">=8.2.3,<8.2.4" aiogram = ">=2.15,<2.26" -aiohttp = ">=3.9.3,<3.10" +aiohttp = ">=3.9.4,<3.10" apscheduler = ">=3.10,<3.11" attrs = ">=23.1,<23.2" azure-storage-blob = ">=12.16.0,<12.17.0" @@ -4769,7 +4778,7 @@ confluent-kafka = ">=2.3.0,<3.0.0" cryptography = ">=42.0.5" cvg-python-sdk = ">=0.5.1,<0.6.0" dask = {version = "2022.10.2", markers = "python_version >= \"3.8\" and python_version < \"3.11\""} -dnspython = "2.3.0" +dnspython = "2.6.1" faiss-cpu = ">=1.7.4,<2.0.0" faker = ">=19.13.0,<20.0.0" fbmessenger = ">=6.0.0,<6.1.0" @@ -4812,7 +4821,7 @@ pydot = ">=1.4,<1.5" PyJWT = {version = ">=2.8.0,<3.0.0", extras = ["crypto"]} pykwalify = ">=1.8,<1.9" pymilvus = ">=2.3.6,<3.0.0" -pymongo = {version = ">=4.3.3,<4.4", extras = ["srv", "tls"]} +pymongo = {version = ">=4.6.3,<4.7", extras = ["srv", "tls"]} pypred = ">=0.4.0,<0.5.0" python-dateutil = ">=2.8.2,<2.9.0" python-dotenv = ">=1.0.1,<2.0.0" @@ -7207,4 +7216,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.11" -content-hash = "04188c31b3cafd6c94be9b46f364e220416101c405d155d9bb3217b1af231d9e" +content-hash = "9dfaf55a59761e6f74b530486db0ac26e6ea35916bdebb0c989eb9258a3a0372" diff --git a/pyproject.toml b/pyproject.toml index f789c2c..7d2349e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ priority = "supplemental" [tool.poetry.dependencies] python = ">=3.8.1,<3.11" -rasa-pro = "3.8.1" +rasa-pro = "3.8.5" [tool.poetry.group.dev.dependencies] toml = "^0.10.2" From 997ab9cbdde0874bb0cfc579175aa9b812bde5e8 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 13:47:12 +0200 Subject: [PATCH 02/15] add dm1 skill book restaurant --- README.md | 2 +- actions/ask_for_slot_action.py | 59 ++++++ actions/db.py | 15 +- actions/list_contacts.py | 2 +- actions/list_restaurants.py | 34 +++ actions/validate_restaurant_form.py | 50 +++++ config.yml | 43 +++- data/flows/book_restaurant.yml | 37 ---- data/flows/check_balance.yml | 2 +- data/flows/hotel_search.yml | 7 - data/{ => flows}/nlu.yml | 0 data/flows/replace_card.yml | 2 +- data/flows/replace_eligible_card.yml | 3 +- data/flows/setup_recurrent_payment.yml | 2 +- data/flows/transfer_money.yml | 2 +- data/nlu-based/nlu.yml | 174 +++++++++++++++ data/nlu-based/rules.yml | 36 ++++ data/nlu-based/stories.yml | 23 ++ db/restaurants.json | 198 ++++++++++++++++++ domain/{ => CALM}/_knowledge.yml | 0 domain/{ => CALM}/add_card.yml | 0 domain/{ => CALM}/add_contact.yml | 0 domain/{ => CALM}/check_balance.yml | 0 domain/{ => CALM}/health_advice.yml | 0 domain/{ => CALM}/hotel_search.yml | 0 domain/{ => CALM}/list_contacts.yml | 0 domain/{ => CALM}/patterns.yml | 0 .../register_to_vote_in_california.yml | 0 domain/{ => CALM}/remove_contact.yml | 0 domain/{ => CALM}/replace_card.yml | 0 domain/{ => CALM}/setup_recurrent_payment.yml | 0 domain/{ => CALM}/transaction_search.yml | 0 domain/{ => CALM}/transfer_money.yml | 0 domain/{ => CALM}/verify_account.yml | 0 domain/_shared.yml | 2 + domain/book_restaurant.yml | 90 -------- domain/nlu-based/restaurant.yml | 91 ++++++++ 37 files changed, 721 insertions(+), 153 deletions(-) create mode 100644 actions/ask_for_slot_action.py create mode 100644 actions/list_restaurants.py create mode 100644 actions/validate_restaurant_form.py delete mode 100644 data/flows/book_restaurant.yml delete mode 100644 data/flows/hotel_search.yml rename data/{ => flows}/nlu.yml (100%) create mode 100644 data/nlu-based/nlu.yml create mode 100644 data/nlu-based/rules.yml create mode 100644 data/nlu-based/stories.yml create mode 100644 db/restaurants.json rename domain/{ => CALM}/_knowledge.yml (100%) rename domain/{ => CALM}/add_card.yml (100%) rename domain/{ => CALM}/add_contact.yml (100%) rename domain/{ => CALM}/check_balance.yml (100%) rename domain/{ => CALM}/health_advice.yml (100%) rename domain/{ => CALM}/hotel_search.yml (100%) rename domain/{ => CALM}/list_contacts.yml (100%) rename domain/{ => CALM}/patterns.yml (100%) rename domain/{ => CALM}/register_to_vote_in_california.yml (100%) rename domain/{ => CALM}/remove_contact.yml (100%) rename domain/{ => CALM}/replace_card.yml (100%) rename domain/{ => CALM}/setup_recurrent_payment.yml (100%) rename domain/{ => CALM}/transaction_search.yml (100%) rename domain/{ => CALM}/transfer_money.yml (100%) rename domain/{ => CALM}/verify_account.yml (100%) delete mode 100644 domain/book_restaurant.yml create mode 100644 domain/nlu-based/restaurant.yml diff --git a/README.md b/README.md index 7f92687..fe0c599 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ domain definitions for each: Rasa ships with a default behavior for every [conversation repair case](https://rasa.com/docs/rasa-pro/concepts/conversation-repair/#conversation-repair-cases) which is handled through a [default pattern flow](https://rasa.com/docs/rasa-pro/concepts/conversation-repair/#conversation-repair-cases). In addition to its core functionality, the demo bot also includes an examples of -pattern overriding in [`data/flows/patterns.yml`](./data/flows/patterns.yml). +pattern overriding in [`data/flows/patterns.yml`](data/flows/patterns.yml). ## Running the project diff --git a/actions/ask_for_slot_action.py b/actions/ask_for_slot_action.py new file mode 100644 index 0000000..c550f2d --- /dev/null +++ b/actions/ask_for_slot_action.py @@ -0,0 +1,59 @@ +from typing import Dict, Text, List + +from rasa_sdk import Tracker +from rasa_sdk.events import EventType, ActionExecutionRejected +from rasa_sdk.executor import CollectingDispatcher +from rasa_sdk import Action + +from actions.db import get_restaurants + + +class AskForRestaurantFormCuisine(Action): + def name(self) -> Text: + return "action_ask_restaurant_form_cuisine" + + def run( + self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict + ): + restaurants = get_restaurants(tracker.sender_id) + cuisine_list = set([ + r.cuisine + for r in restaurants + if r.city.lower() == tracker.get_slot("city").lower() + ]) + + dispatcher.utter_button_message( + text="What cuisine are you looking for?", + buttons=[ + {"title": c, "payload": f'/inform{{"cuisine":"{c}"}}'} + for c in cuisine_list + ] + ) + + +class AskForRestaurantFormRestaurantName(Action): + def name(self) -> Text: + return "action_ask_restaurant_form_restaurant_name" + + def run( + self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict + ): + restaurants = get_restaurants(tracker.sender_id) + + restaurant_names = set([ + r.name for r in restaurants + if r.city.lower() == tracker.get_slot("city").lower() and + r.cuisine.lower() == tracker.get_slot("cuisine").lower() + ]) + + if len(restaurant_names) > 0: + dispatcher.utter_button_message( + text="Do you know which restaurant you would like me to reverse a table at?", + buttons=[ + {"title": r, "payload": f'/inform{{"restaurant_name":"{r}"}}'} + for r in restaurant_names + ] + ) + else: + dispatcher.utter_message("I'm sorry I could not find any suitable restaurant " + "for you.") diff --git a/actions/db.py b/actions/db.py index 646fbc2..535a82d 100644 --- a/actions/db.py +++ b/actions/db.py @@ -11,6 +11,7 @@ CONTACTS = "contacts.json" TRANSACTIONS = "transactions.json" MY_ACCOUNT = "my_account.json" +RESTAURANTS = "restaurants.json" class MyAccount(BaseModel): @@ -35,9 +36,17 @@ class Contact(BaseModel): handle: str +class Restaurant(BaseModel): + name: str + address: str + city: str + cuisine: str + capacity: int + + def get_session_db_path(session_id: str) -> str: tempdir = tempfile.gettempdir() - project_name = "financial_demo_flows_llms" + project_name = "rasa-calm-demo" return os.path.join(tempdir, project_name, session_id) @@ -91,3 +100,7 @@ def add_transaction(session_id: str, transaction: Transaction) -> None: def write_contacts(session_id: str, contacts: List[Contact]) -> None: write_db(session_id, CONTACTS, [c.dict() for c in contacts]) + + +def get_restaurants(session_id: str) -> List[Restaurant]: + return [Restaurant(**item) for item in read_db(session_id, RESTAURANTS)] diff --git a/actions/list_contacts.py b/actions/list_contacts.py index 78d2359..3eb8276 100644 --- a/actions/list_contacts.py +++ b/actions/list_contacts.py @@ -2,7 +2,7 @@ from rasa_sdk import Action, Tracker from rasa_sdk.events import SlotSet from rasa_sdk.executor import CollectingDispatcher -from actions.db import get_contacts, add_contact, Contact +from actions.db import get_contacts class ListContacts(Action): diff --git a/actions/list_restaurants.py b/actions/list_restaurants.py new file mode 100644 index 0000000..7ca2576 --- /dev/null +++ b/actions/list_restaurants.py @@ -0,0 +1,34 @@ +import random +from typing import Any, Dict +from rasa_sdk import Action, Tracker +from rasa_sdk.executor import CollectingDispatcher +from actions.db import get_restaurants + + +class ListRestaurants(Action): + + def name(self) -> str: + return "action_list_restaurants" + + def run( + self, + dispatcher: CollectingDispatcher, + tracker: Tracker, + domain: Dict[str, Any] + ): + restaurants = get_restaurants(tracker.sender_id) + + if len(restaurants) > 0: + restaurants = random.sample(restaurants, 5) + sorted_data = sorted(restaurants, key=lambda r: (r.cuisine, r.city)) + restaurants_list = "\n".join([ + f"- {r.name}, {r.address} ({r.cuisine})"for r in sorted_data + ]) + + dispatcher.utter_message( + f"Here are some restaurants in Berlin:\n{restaurants_list}" + ) + else: + dispatcher.utter_message( + "I'm sorry. I'm unable to find any restaurants at the moment." + ) \ No newline at end of file diff --git a/actions/validate_restaurant_form.py b/actions/validate_restaurant_form.py new file mode 100644 index 0000000..c33b573 --- /dev/null +++ b/actions/validate_restaurant_form.py @@ -0,0 +1,50 @@ +from typing import Text, List, Any, Dict + +from rasa_sdk import Tracker, FormValidationAction +from rasa_sdk.executor import CollectingDispatcher +from rasa_sdk.types import DomainDict + +from actions.db import get_restaurants + + +class ValidateRestaurantForm(FormValidationAction): + def name(self) -> Text: + return "validate_restaurant_form" + + def validate_cuisine( + self, + slot_value: Any, + dispatcher: CollectingDispatcher, + tracker: Tracker, + domain: DomainDict, + ) -> Dict[Text, Any]: + """Validate cuisine value.""" + restaurants = get_restaurants(tracker.sender_id) + cuisine_list = set([ + r.cuisine.lower() + for r in restaurants + ]) + + if slot_value.lower() in cuisine_list: + return {"cuisine": slot_value} + else: + return {"cuisine": None} + + def validate_restaurant_name( + self, + slot_value: Any, + dispatcher: CollectingDispatcher, + tracker: Tracker, + domain: DomainDict, + ) -> Dict[Text, Any]: + """Validate cuisine value.""" + restaurants = get_restaurants(tracker.sender_id) + restaurant_names = set([ + r.name.lower() + for r in restaurants + ]) + + if slot_value.lower() in restaurant_names: + return {"restaurant_name": slot_value} + else: + return {"restaurant_name": None} \ No newline at end of file diff --git a/config.yml b/config.yml index a24b745..cac7925 100644 --- a/config.yml +++ b/config.yml @@ -1,17 +1,38 @@ recipe: default.v1 language: en pipeline: -- name: KeywordIntentClassifier -- name: NLUCommandAdapter -- name: LLMCommandGenerator - llm: - model_name: gpt-4 - request_timeout: 7 - temperature: 0.0 - top_p: 0.0 +#- name: LLMBasedRouter +# calm_entry: +# sticky: "handles everything else" +# nlu_entry: +# sticky: "handles everything around booking a hotel or a restaurant" +# non_sticky: "handles chitchat" +- name: WhitespaceTokenizer +- name: CountVectorsFeaturizer +- name: CountVectorsFeaturizer + analyzer: char_wb + min_ngram: 1 + max_ngram: 4 +- name: LogisticRegressionClassifier +- name: CRFEntityExtractor +- name: DucklingEntityExtractor + url: "http://localhost:8000" + dimensions: [ "time", "number" ] + timezone: "Europe/Berlin" + timeout: 3 +#- name: NLUCommandAdapter +#- name: LLMCommandGenerator +# llm: +# model_name: gpt-4 +# request_timeout: 7 +# temperature: 0.0 +# top_p: 0.0 policies: -- name: FlowPolicy -- name: EnterpriseSearchPolicy -- name: IntentlessPolicy +- name: RulePolicy +- name: TEDPolicy +#- name: FlowPolicy +#- name: EnterpriseSearchPolicy +#- name: IntentlessPolicy + assistant_id: 20240418-073244-narrow-archive diff --git a/data/flows/book_restaurant.yml b/data/flows/book_restaurant.yml deleted file mode 100644 index 98ce7f9..0000000 --- a/data/flows/book_restaurant.yml +++ /dev/null @@ -1,37 +0,0 @@ -flows: - book_restaurant: - name: book a restaurant - description: This flow books a restaurant - steps: - - collect: book_restaurant_name_of_restaurant - - collect: book_restaurant_number_of_people - - collect: book_restaurant_date - - collect: book_restaurant_time - - collect: book_restaurant_is_date_flexible - description: (True/False) whether offering alternative dates make sense - - action: check_restaurant_availability - next: - - if: not slots.is_restaurant_available - then: - - action: utter_restaurant_not_available - - id: ask_alternative - collect: book_restaurant_alternative_dummy - description: - do not fill this slot, instead fill the given parts of the - alternative into their respective slots - next: ask_alternative - - else: available - - id: available - action: utter_restaurant_available - - collect: book_restaurant_reservation_name - ask_before_filling: true - - collect: book_restaurant_confirmation - ask_before_filling: true - next: - - if: slots.book_restaurant_confirmation - then: - - action: utter_confirm_restaurant_booking - next: END - - else: - - action: utter_cancel_book_restaurant - next: END diff --git a/data/flows/check_balance.yml b/data/flows/check_balance.yml index 4f86890..85a91c0 100644 --- a/data/flows/check_balance.yml +++ b/data/flows/check_balance.yml @@ -1,7 +1,7 @@ flows: check_balance: name: check your balance - description: check the user's account balance. + description: check the user's account balance steps: - action: check_balance - action: utter_current_balance diff --git a/data/flows/hotel_search.yml b/data/flows/hotel_search.yml deleted file mode 100644 index 3bdd7ad..0000000 --- a/data/flows/hotel_search.yml +++ /dev/null @@ -1,7 +0,0 @@ -flows: - hotel_search: - name: search for hotels - description: search for hotels - steps: - - action: action_search_hotel - - action: utter_hotel_inform_rating diff --git a/data/nlu.yml b/data/flows/nlu.yml similarity index 100% rename from data/nlu.yml rename to data/flows/nlu.yml diff --git a/data/flows/replace_card.yml b/data/flows/replace_card.yml index e3aac33..280fef2 100644 --- a/data/flows/replace_card.yml +++ b/data/flows/replace_card.yml @@ -1,6 +1,6 @@ flows: replace_card: - description: The user needs to replace their card. + description: the user needs to replace their card name: replace_card steps: - collect: confirm_correct_card diff --git a/data/flows/replace_eligible_card.yml b/data/flows/replace_eligible_card.yml index 88fc5cc..4bfa224 100644 --- a/data/flows/replace_eligible_card.yml +++ b/data/flows/replace_eligible_card.yml @@ -1,6 +1,7 @@ flows: replace_eligible_card: - description: Never predict StartFlow for this flow, users are not able to trigger it themselves. + description: the user needs to replace their eligible card + if: False name: replace eligible card steps: - collect: replacement_reason diff --git a/data/flows/setup_recurrent_payment.yml b/data/flows/setup_recurrent_payment.yml index d50350b..e7554e0 100644 --- a/data/flows/setup_recurrent_payment.yml +++ b/data/flows/setup_recurrent_payment.yml @@ -1,7 +1,7 @@ flows: setup_recurrent_payment: name: setup recurrent payment - description: This flow let users to set up a recurring payment, which can either be a direct debit or a standing order. + description: set up a recurring payment, which can either be a direct debit or a standing order steps: - collect: recurrent_payment_type description: the type of payment diff --git a/data/flows/transfer_money.yml b/data/flows/transfer_money.yml index 7bdd6b1..ddf41d4 100644 --- a/data/flows/transfer_money.yml +++ b/data/flows/transfer_money.yml @@ -1,6 +1,6 @@ flows: transfer_money: - description: This flow let's users send money to friends and family. + description: send money to friends and family name: transfer money steps: - collect: transfer_money_recipient diff --git a/data/nlu-based/nlu.yml b/data/nlu-based/nlu.yml new file mode 100644 index 0000000..504705c --- /dev/null +++ b/data/nlu-based/nlu.yml @@ -0,0 +1,174 @@ +version: "3.1" + +nlu: +- intent: greet + examples: | + - hey + - hello + - hi + - hello there + - good morning + - good evening + - moin + - hey there + - let's go + - hey dude + - goodmorning + - goodevening + - good afternoon + +- intent: goodbye + examples: | + - cu + - good by + - cee you later + - good night + - bye + - goodbye + - have a nice day + - see you around + - bye bye + - see you later + - thanks, bye + - great, goodbye + +- intent: ask_help + examples: | + - help + - i need help + - i need assistance + - I don't understand + - I still don't understand + - I want to talk to a human + - get me a human + - help me + - assist + - I don't get it + - heeeeeeelp + - get me a human on the line + +- intent: stop + examples: | + - stop that + - I don't want to continue + - cancel + - stop + - I don't want to book a restaurant, stop it + - stop it + - cancel this + +- intent: list_restaurants + examples: | + - Do you know any good restaurant? + - Any restaurant recommendations? + - I want to look at different restaurants + - Can you show me some restaurant options? + - list restaurants + - restaurants + - Suggest some eateries nearby + - What are the best dining places around? + - I need a place to eat, can you help? + - Recommend some restaurants for dinner + - Where can I go for a good meal? + - Show me the top restaurants in this area + - Find me some good places to eat + - I'm looking for restaurant suggestions + - Are there any popular restaurants nearby? + - Could you provide a list of restaurants? + - Give me a few restaurant choices + - What are some nice places to dine? + - Help me find a restaurant + - What are some top-rated restaurants? + +- intent: request_restaurant + examples: | + - book a restaurant + - I want a place to eat + - I'm hungry. Can you book me a restaurant please? + - Find me a table for dinner + - Can you make a reservation at a restaurant for me? + - I need to book a place for lunch + - Reserve a table for [two](number) + - Help me book a restaurant + - I need a restaurant reservation + - Can you get me a spot at a nice restaurant? + - Find a good place to eat and make a reservation + - I'd like to book a table for tonight + - Can you book a restaurant for [four](number) people? + - I need a dinner reservation + - Can you arrange a lunch spot for me? + - I want to reserve a table for dinner + - Make a restaurant booking for me + - Can you book a table at an [Italian](cuisine) restaurant? + - I need a reservation at a [French](cuisine) restaurant + - I want to eat out, can you book a place? + - Book a dinner spot for me + - Reserve a lunch table + - Can you find and book a restaurant? + - Arrange a restaurant reservation for me + - Can you get a dinner reservation for me? + - I would like to book a place to eat + - Can you reserve a table at a nearby restaurant? + - Book a restaurant for tonight + - Secure a table for dinner + - I need to book a restaurant for a special occasion + +- intent: inform + examples: | + - [Italian](cuisine) + - [Asian](cuisine) cuisine + - how about [Italian](cuisine) cuisine + - [European](cuisine) + - I really like [Greek](cuisine) + - I'm interested in [Italian](cuisine) cuisine. + - We're looking for [Japanese](cuisine) food. + - I'd like to try some [Mexican](cuisine) dishes. + - We're aiming for [Indian](cuisine) cuisine. + - I'm in the mood for [Thai](cuisine) food. + - We're seeking out [French](cuisine) cuisine. + - I'd love to have some [Chinese](cuisine) food. + - We're thinking about [Mediterranean](cuisine) cuisine. + - We're craving some [Korean](cuisine) dishes. + - I'd like to experience [Lebanese](cuisine) food. + - We are [4](number) people + - [5](number) + - [3](number) people + - Just [2](number) + - We are a party of [three](number). + - There are [six](number) of us. + - Our group consists of [eight](number) people. + - We will be a total of [four](number). + - There are [five](number) people in our group. + - We are a duo, just [two](number) people. + - The reservation is for [seven](number) people. + - We’ve got a group of [nine](number). + - There will be [ten](number) of us. + - It's a small group; we're just [three](number). + - [Cafe de Klos](restaurant_name) + - Yes, please book a table at The [Grand Bistro](restaurant_name). + - I have a place in mind: [Olive Garden](restaurant_name). + - I'd like to make a reservation at [Sushi Haven](restaurant_name). + - Please reserve a table at [La Bella Italian Restaurant](restaurant_name). + - I'm thinking about dining at [The Seafood Shack](restaurant_name). + - Could you book a table at [Gourmet Garden](restaurant_name)? + - Yes, we prefer [Urban Thai Cuisine](restaurant_name). + - I have a favorite: [Mama Mia’s Pizzeria](restaurant_name). + - I’d like to try out The [French Café](restaurant_name). + - Make the reservation for December 25th at 7:00 PM. + - I’d like the reservation on April 15th at 12:30 PM. + - Please book it for tomorrow at 8:45 AM. + - Reserve it for October 10th at 5:00 PM. + - Schedule the reservation on March 21st at 6:00 PM. + - I'm looking at next week Wednesday at 1:15 PM for the reservation. + - Make the booking for August 9th at 9:00 PM. + - I prefer December 1st at 11:00 AM for the reservation. + - Set the reservation for May 5th at 2:30 PM. + - Book it for today at 4:00 PM. + - I'm currently in Paris. + - Right now, I'm in the vibrant city of New York. + - My location is Sydney. + - I find myself in Berlin at the moment. + - Currently, I'm situated in Barcelona. + - The city I'm residing in is Dubai. + - Rio de Janeiro + - Toronto diff --git a/data/nlu-based/rules.yml b/data/nlu-based/rules.yml new file mode 100644 index 0000000..fea8d19 --- /dev/null +++ b/data/nlu-based/rules.yml @@ -0,0 +1,36 @@ +version: "3.1" + +rules: + +- rule: greeting + steps: + - intent: greet + - action: utter_greet + +- rule: goodbye + steps: + - intent: goodbye + - action: utter_goodbye + +- rule: list restaurants + steps: + - intent: list_restaurants + - action: action_list_restaurants + +- rule: activate restaurant form + steps: + - intent: request_restaurant + - action: restaurant_form + - active_loop: restaurant_form + +- rule: submit restaurant form + condition: + - active_loop: restaurant_form + steps: + - action: restaurant_form + - active_loop: null + - slot_was_set: + - requested_slot: null + - action: utter_restaurant_form_submit + - action: utter_restaurant_available + - action: action_reset_routing diff --git a/data/nlu-based/stories.yml b/data/nlu-based/stories.yml new file mode 100644 index 0000000..36d99b2 --- /dev/null +++ b/data/nlu-based/stories.yml @@ -0,0 +1,23 @@ +version: "3.1" + +stories: + +- story: help + steps: + - intent: ask_help + - action: utter_help + - intent: ask_help + - action: utter_handover + - action: action_reset_routing + +- story: User interrupts the form and doesn't want to continue + steps: + - intent: request_restaurant + - action: restaurant_form + - active_loop: restaurant_form + - intent: stop + - action: utter_ask_continue + - intent: stop + - action: action_deactivate_loop + - action: action_reset_routing + - active_loop: null \ No newline at end of file diff --git a/db/restaurants.json b/db/restaurants.json new file mode 100644 index 0000000..199eb46 --- /dev/null +++ b/db/restaurants.json @@ -0,0 +1,198 @@ +[ + { + "name": "La Bella Italia", + "address": "123 Hauptstraße, Berlin 10115", + "city": "Berlin", + "cuisine": "Italian", + "capacity": 80 + }, + { + "name": "Sakura Sushi House", + "address": "456 Lindenstraße, Berlin 10243", + "city": "Berlin", + "cuisine": "Japanese", + "capacity": 60 + }, + { + "name": "Curry Palace", + "address": "789 Eichenallee, Berlin 10365", + "city": "Berlin", + "cuisine": "Indian", + "capacity": 100 + }, + { + "name": "El Rancho Grande", + "address": "101 Kiefernstraße, Berlin 10437", + "city": "Berlin", + "cuisine": "Mexican", + "capacity": 120 + }, + { + "name": "Le Petit Bistro", + "address": "202 Ahornweg, Berlin 10587", + "city": "Berlin", + "cuisine": "French", + "capacity": 50 + }, + { + "name": "Golden Dragon", + "address": "303 Zedernallee, Berlin 10623", + "city": "Berlin", + "cuisine": "Chinese", + "capacity": 90 + }, + { + "name": "Oasis Mediterranean Grill", + "address": "404 Birkenstraße, Berlin 10785", + "city": "Berlin", + "cuisine": "Mediterranean", + "capacity": 70 + }, + { + "name": "Spicy Thai Kitchen", + "address": "606 Palmendamm, Berlin 10961", + "city": "Berlin", + "cuisine": "Thai", + "capacity": 65 + }, + { + "name": "Trattoria Roma", + "address": "808 Seeblickstraße, Berlin 11129", + "city": "Berlin", + "cuisine": "Italian", + "capacity": 95 + }, + { + "name": "Chez Louis", + "address": "909 Gartenweg, Berlin 11237", + "city": "Berlin", + "cuisine": "French", + "capacity": 75 + }, + { + "name": "Bangkok Delight", + "address": "1010 Flussallee, Berlin 11347", + "city": "Berlin", + "cuisine": "Thai", + "capacity": 85 + }, + { + "name": "El Jardin", + "address": "1111 Blumenstraße, Berlin 11457", + "city": "Berlin", + "cuisine": "Mexican", + "capacity": 90 + }, + { + "name": "Bistro Belle Epoque", + "address": "1212 Weintraubenstraße, Berlin 11567", + "city": "Berlin", + "cuisine": "French", + "capacity": 60 + }, + { + "name": "Cantina del Sol", + "address": "1313 Sonnenuntergangsstraße, Berlin 11677", + "city": "Berlin", + "cuisine": "Mexican", + "capacity": 130 + }, + { + "name": "Tuscany Tavern", + "address": "1414 Uferstraße, Berlin 11787", + "city": "Berlin", + "cuisine": "Italian", + "capacity": 65 + }, + { + "name": "Le Gourmet", + "address": "1515 Plaza Boulevard, Berlin 11897", + "city": "Berlin", + "cuisine": "French", + "capacity": 55 + }, + { + "name": "Pasta Fresca", + "address": "1616 Marktstraße, Berlin 11907", + "city": "Berlin", + "cuisine": "Italian", + "capacity": 72 + }, + { + "name": "Thai Spice", + "address": "1717 Ozeanstraße, Berlin 12017", + "city": "Berlin", + "cuisine": "Thai", + "capacity": 80 + }, + { + "name": "Ristorante Incanto", + "address": "Amstel 2, 1017 AA Amsterdam", + "city": "Amsterdam", + "cuisine": "Italian", + "capacity": 60 + }, + { + "name": "Yamazato Restaurant", + "address": "Ferdinand Bolstraat 333, 1072 LH Amsterdam", + "city": "Amsterdam", + "cuisine": "Japanese", + "capacity": 55 + }, + { "name": "Pind Punjabi", + "address": "Eerste Sweelinckstraat 25, 1073 CL Amsterdam", + "city": "Amsterdam", + "cuisine": "Indian", + "capacity": 70 + }, + { + "name": "Los Pilones", + "address": "Kerkstraat 63, 1017 GC Amsterdam", + "city": "Amsterdam", + "cuisine": "Mexican", + "capacity": 50 + }, + { + "name": "Ciel Bleu", + "address": "Ferdinand Bolstraat 333, 1072 LH Amsterdam", + "city": "Amsterdam", + "cuisine": "French", + "capacity": 80 + }, + { + "name": "Sea Palace", + "address": "Oosterdokskade 8, 1011 AE Amsterdam", + "city": "Amsterdam", + "cuisine": "Chinese", + "capacity": 120 + }, + { + "name": "Cafe de Klos", + "address": "Kerkstraat 41, 1017 GB Amsterdam", + "city": "Amsterdam", + "cuisine": "Mediterranean", + "capacity": 55 + }, + { + "name": "Bird Thai Restaurant", + "address": "Zeedijk 72-74, 1012 BA Amsterdam", + "city": "Amsterdam", + "cuisine": "Thai", + "capacity": 90 + }, + { + "name": "Trattoria Graziella", + "address": "Via Amsterdam, 1097 BA Amsterdam", + "city": "Amsterdam", + "cuisine": "Italian", + "capacity": 65 + }, + { + "name": "Sushisamba", + "address": "Max Euweplein 64, 1017 MB Amsterdam", + "city": "Amsterdam", + "cuisine": "Japanese", + "capacity": 110 + } + +] \ No newline at end of file diff --git a/domain/_knowledge.yml b/domain/CALM/_knowledge.yml similarity index 100% rename from domain/_knowledge.yml rename to domain/CALM/_knowledge.yml diff --git a/domain/add_card.yml b/domain/CALM/add_card.yml similarity index 100% rename from domain/add_card.yml rename to domain/CALM/add_card.yml diff --git a/domain/add_contact.yml b/domain/CALM/add_contact.yml similarity index 100% rename from domain/add_contact.yml rename to domain/CALM/add_contact.yml diff --git a/domain/check_balance.yml b/domain/CALM/check_balance.yml similarity index 100% rename from domain/check_balance.yml rename to domain/CALM/check_balance.yml diff --git a/domain/health_advice.yml b/domain/CALM/health_advice.yml similarity index 100% rename from domain/health_advice.yml rename to domain/CALM/health_advice.yml diff --git a/domain/hotel_search.yml b/domain/CALM/hotel_search.yml similarity index 100% rename from domain/hotel_search.yml rename to domain/CALM/hotel_search.yml diff --git a/domain/list_contacts.yml b/domain/CALM/list_contacts.yml similarity index 100% rename from domain/list_contacts.yml rename to domain/CALM/list_contacts.yml diff --git a/domain/patterns.yml b/domain/CALM/patterns.yml similarity index 100% rename from domain/patterns.yml rename to domain/CALM/patterns.yml diff --git a/domain/register_to_vote_in_california.yml b/domain/CALM/register_to_vote_in_california.yml similarity index 100% rename from domain/register_to_vote_in_california.yml rename to domain/CALM/register_to_vote_in_california.yml diff --git a/domain/remove_contact.yml b/domain/CALM/remove_contact.yml similarity index 100% rename from domain/remove_contact.yml rename to domain/CALM/remove_contact.yml diff --git a/domain/replace_card.yml b/domain/CALM/replace_card.yml similarity index 100% rename from domain/replace_card.yml rename to domain/CALM/replace_card.yml diff --git a/domain/setup_recurrent_payment.yml b/domain/CALM/setup_recurrent_payment.yml similarity index 100% rename from domain/setup_recurrent_payment.yml rename to domain/CALM/setup_recurrent_payment.yml diff --git a/domain/transaction_search.yml b/domain/CALM/transaction_search.yml similarity index 100% rename from domain/transaction_search.yml rename to domain/CALM/transaction_search.yml diff --git a/domain/transfer_money.yml b/domain/CALM/transfer_money.yml similarity index 100% rename from domain/transfer_money.yml rename to domain/CALM/transfer_money.yml diff --git a/domain/verify_account.yml b/domain/CALM/verify_account.yml similarity index 100% rename from domain/verify_account.yml rename to domain/CALM/verify_account.yml diff --git a/domain/_shared.yml b/domain/_shared.yml index 19a3587..b5a4e2f 100644 --- a/domain/_shared.yml +++ b/domain/_shared.yml @@ -3,6 +3,8 @@ version: "3.1" slots: return_value: type: any +# route_session_to_calm: +# type: bool responses: utter_goodbye: diff --git a/domain/book_restaurant.yml b/domain/book_restaurant.yml deleted file mode 100644 index 1b10080..0000000 --- a/domain/book_restaurant.yml +++ /dev/null @@ -1,90 +0,0 @@ -version: "3.1" - -actions: - - check_restaurant_availability - -slots: - book_restaurant_offered_alternative_dates: - type: list - initial_value: [ ] - mappings: - - type: custom - book_restaurant_is_date_flexible: - type: bool - initial_value: true - mappings: - - type: custom - book_restaurant_has_alternative_restaurant: - type: bool - mappings: - - type: custom - book_restaurant_alternative_dummy: - type: text - mappings: - - type: custom - book_restaurant_given_alternative: - type: text - mappings: - - type: custom - book_restaurant_confirmation: - type: bool - mappings: - - type: custom - book_restaurant_reservation_name: - type: text - mappings: - - type: custom - is_restaurant_available: - type: bool - mappings: - - type: custom - book_restaurant_name_of_restaurant: - type: text - mappings: - - type: custom - book_restaurant_number_of_people: - type: text - mappings: - - type: custom - book_restaurant_date: - type: text - mappings: - - type: custom - book_restaurant_time: - type: text - mappings: - - type: custom - -responses: - utter_ask_book_restaurant_alternative_dummy: - - condition: - - type: slot - name: book_restaurant_has_alternative_restaurant - value: true - text: "{book_restaurant_name_of_restaurant} looks pretty packed these days, how about going to {book_restaurant_given_alternative} instead? They have a lot of space." - - text: "How about {book_restaurant_given_alternative}, instead?" - utter_restaurant_not_available: - - text: Unfortunately, that time isn't available. - utter_cancel_book_restaurant: - - text: booking cancelled - utter_confirm_restaurant_booking: - - text: booking successful - utter_ask_book_restaurant_confirmation: - - text: A table for {book_restaurant_number_of_people} at {book_restaurant_name_of_restaurant} for {book_restaurant_date}, {book_restaurant_time}. Do you confirm the booking? - buttons: - - payload: yes - title: "Yes" - - payload: no - title: "No, Cancel" - utter_restaurant_available: - - text: They have a table available for you at that time. - utter_ask_book_restaurant_reservation_name: - - text: what name should I make the reservation for? - utter_ask_book_restaurant_time: - - text: And what time? - utter_ask_book_restaurant_date: - - text: For which day do you want to book? - utter_ask_book_restaurant_number_of_people: - - text: How many people are we talking? - utter_ask_book_restaurant_name_of_restaurant: - - text: What's the name of the restaurant you are interested in? diff --git a/domain/nlu-based/restaurant.yml b/domain/nlu-based/restaurant.yml new file mode 100644 index 0000000..2ea55fe --- /dev/null +++ b/domain/nlu-based/restaurant.yml @@ -0,0 +1,91 @@ +version: "3.1" + +intents: + - stop + - request_restaurant + - inform + - list_restaurants + +entities: +- cuisine +- number +- time +- location +- restaurant_name + +slots: + city: + type: text + mappings: + - type: from_entity + entity: location + cuisine: + type: categorical + values: + - Italian + - Japanese + - Indian + - Mexican + - French + - Chinese + - Mediterranean + - Thai + mappings: + - type: from_entity + entity: cuisine + num_people: + type: any + mappings: + - type: from_entity + entity: number + restaurant_name: + type: text + mappings: + - type: from_entity + entity: restaurant_name + restaurant_time: + type: text + mappings: + - type: from_entity + entity: time + +actions: + - action_list_restaurants + - validate_restaurant_form + - action_ask_restaurant_form_cuisine + - action_ask_restaurant_form_restaurant_name + +forms: + restaurant_form: + ignored_intents: + - greet + - goodbye + required_slots: + - city + - cuisine + - restaurant_name + - num_people + - restaurant_time + +responses: + utter_restaurant_form_submit: + - text: Let me check if the restaurant {restaurant_name} is available on {restaurant_time} for {num_people}. + utter_restaurant_available: + - text: You are lucky, they have a table available for you. The reservation is confirmed. + utter_ask_restaurant_form_num_people: + - text: How many people are you? + utter_ask_restaurant_form_restaurant_time: + - text: What date and time do you want me to make the reservation? + utter_ask_restaurant_form_city: + - text: What city are you in? + buttons: + - title: "Berlin" + payload: '/inform{{"location":"berlin"}}' + - title: "Amsterdam" + payload: '/inform{{"location":"amsterdam"}}' + utter_ask_continue: + - text: Are you sure? + utter_handover: + - text: I'm handing over to a human now. I'm sorry, I could not help. + utter_cannot_handle_other_city: + - text: I'm sorry, but I can only book a restaurant in Berlin or Amsterdam. \ No newline at end of file From e61b98350ed4a50281a9eb76f64b59b591103e39 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 14:03:26 +0200 Subject: [PATCH 03/15] use coexistence solution --- config.yml | 32 ++++++++++++++++---------------- data/nlu-based/rules.yml | 1 + domain/_shared.yml | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/config.yml b/config.yml index cac7925..599cbe8 100644 --- a/config.yml +++ b/config.yml @@ -1,12 +1,12 @@ recipe: default.v1 language: en pipeline: -#- name: LLMBasedRouter -# calm_entry: -# sticky: "handles everything else" -# nlu_entry: -# sticky: "handles everything around booking a hotel or a restaurant" -# non_sticky: "handles chitchat" +- name: LLMBasedRouter + calm_entry: + sticky: "handles everything else" + nlu_entry: + sticky: "handles everything around booking a hotel or a restaurant" + non_sticky: "handles chitchat" - name: WhitespaceTokenizer - name: CountVectorsFeaturizer - name: CountVectorsFeaturizer @@ -20,19 +20,19 @@ pipeline: dimensions: [ "time", "number" ] timezone: "Europe/Berlin" timeout: 3 -#- name: NLUCommandAdapter -#- name: LLMCommandGenerator -# llm: -# model_name: gpt-4 -# request_timeout: 7 -# temperature: 0.0 -# top_p: 0.0 +- name: NLUCommandAdapter +- name: LLMCommandGenerator + llm: + model_name: gpt-4 + request_timeout: 7 + temperature: 0.0 + top_p: 0.0 policies: - name: RulePolicy - name: TEDPolicy -#- name: FlowPolicy -#- name: EnterpriseSearchPolicy -#- name: IntentlessPolicy +- name: FlowPolicy +- name: EnterpriseSearchPolicy +- name: IntentlessPolicy assistant_id: 20240418-073244-narrow-archive diff --git a/data/nlu-based/rules.yml b/data/nlu-based/rules.yml index fea8d19..a78cd9d 100644 --- a/data/nlu-based/rules.yml +++ b/data/nlu-based/rules.yml @@ -16,6 +16,7 @@ rules: steps: - intent: list_restaurants - action: action_list_restaurants + - action: action_reset_routing - rule: activate restaurant form steps: diff --git a/domain/_shared.yml b/domain/_shared.yml index b5a4e2f..2b443d9 100644 --- a/domain/_shared.yml +++ b/domain/_shared.yml @@ -3,8 +3,8 @@ version: "3.1" slots: return_value: type: any -# route_session_to_calm: -# type: bool + route_session_to_calm: + type: bool responses: utter_goodbye: From 4b67300feda36be954e5c52f756fdbbb3d86c316 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 16:11:30 +0200 Subject: [PATCH 04/15] add intents to CALM and use nlu triggers --- data/flows/add_card.yml | 4 + data/flows/add_contact.yml | 4 + data/flows/health_advice.yml | 13 -- data/flows/nlu.yml | 134 ++++++++++++++++--- data/flows/remove_contact.yml | 4 + data/flows/replace_card.yml | 4 + data/flows/verify_account.yml | 4 + data/nlu-based/nlu.yml | 17 +++ data/nlu-based/rules.yml | 5 + domain/CALM/add_card.yml | 3 + domain/CALM/add_contact.yml | 3 + domain/CALM/remove_contact.yml | 3 + domain/CALM/replace_card.yml | 3 + domain/CALM/verify_account.yml | 3 + domain/{CALM => nlu-based}/health_advice.yml | 0 15 files changed, 174 insertions(+), 30 deletions(-) delete mode 100644 data/flows/health_advice.yml rename domain/{CALM => nlu-based}/health_advice.yml (100%) diff --git a/data/flows/add_card.yml b/data/flows/add_card.yml index 7aa36e4..7732ac0 100644 --- a/data/flows/add_card.yml +++ b/data/flows/add_card.yml @@ -2,5 +2,9 @@ flows: add_card: description: add a card to your account name: add a card + nlu_trigger: + - intent: + name: add_card + confidence_threshold: 0.9 steps: - action: utter_card_added diff --git a/data/flows/add_contact.yml b/data/flows/add_contact.yml index 1843d7a..af26350 100644 --- a/data/flows/add_contact.yml +++ b/data/flows/add_contact.yml @@ -2,6 +2,10 @@ flows: add_contact: description: add a contact to your contact list name: add a contact + nlu_trigger: + - intent: + name: add_contact + confidence_threshold: 0.9 steps: - collect: add_contact_handle description: a user handle starting with @ diff --git a/data/flows/health_advice.yml b/data/flows/health_advice.yml deleted file mode 100644 index e78541a..0000000 --- a/data/flows/health_advice.yml +++ /dev/null @@ -1,13 +0,0 @@ -flows: - # the following flows are detectors for out of scope topics - health_advice: - name: health advice - description: user asks for health advice - nlu_trigger: - - intent: - name: health_advice - confidence_threshold: 0.8 - steps: - - action: utter_cant_advice_on_health - - diff --git a/data/flows/nlu.yml b/data/flows/nlu.yml index e75b334..4e670be 100644 --- a/data/flows/nlu.yml +++ b/data/flows/nlu.yml @@ -1,20 +1,120 @@ -version: "3.1" +version: 3.1 nlu: - - intent: health_advice + - intent: replace_card examples: | - - I need some medical advice. - - Can you help me with some health issues? - - I need medical support. - - I'm experiencing some symptoms and I need guidance on what to do. - - Can you provide me with health recommendations? - - I'm struggling with some health concerns. Can you offer advice? - - Can you suggest ways to improve my overall well-being? - - I'm looking for tips on managing stress and anxiety. Any advice? - - I have a specific health question. Can you offer me some insights? - - I need suggestions on maintaining a healthy diet and exercise routine. - - Is there anyone knowledgeable about natural remedies who can give me advice? - - Can you provide me with information on preventing common illnesses? - - I'm interested in learning about alternative therapies. Can you share your expertise? - - Can you recommend a good doctor? I'm not feeling well. - \ No newline at end of file + - I need to replace my card. + - Can you help me with a card replacement? + - I lost my card, can I get a replacement? + - My card is damaged, I need a new one. + - Help me order a replacement card. + - Replace my current card, please. + - I need a new card issued. + - My card was stolen, I need a new one. + - Can you issue me a replacement card? + - I need to replace my lost card. + - I want to report my card lost and get a replacement. + - I need to get a replacement for my worn-out card. + - I need a new card, mine is missing. + - I need to replace my expired card. + - I need assistance with replacing my card. + - Can you help me get a new card issued? + + - intent: add_card + examples: | + - I want to add a card to my account. + - I need to add a card to my profile. + - Please help me add a card. + - Add a new card to my account. + - I want to register a new card on my account. + - I need to link a card to my account. + - Please add a card to my account. + - Help me add a credit card to my profile. + - I want to add a debit card to my account. + - Can you attach this card to my account? + - I need to connect a card to my account. + - Add this card to my account, please. + - Can I add another card to my profile? + - How do I save a new card to my account? + - I need to input a new card to my account. + - Can you help me store a new card on my account? + - Please add this card to my account details. + - I want to link a new payment card to my account. + - How do I add a credit card to my profile? + + - intent: verify_account + examples: | + - I need to verify my account for higher transfer limits. + - I want to verify my account for larger transfers. + - Verify my account to raise my transfer limits. + - Help me verify my account to increase my transfer capacity. + - Help me verify my account. + - I need to upgrade my transfer limits by verifying my account. + - Please verify my account for increased transfer limits. + - I want to verify my details for higher transfer limits. + - Assist me in verifying my account. + - What are the steps to verify my account for larger transfers? + - Verify my account so I can transfer more funds. + - Can I get my account verified for higher transaction limits? + - I need to authenticate my account for higher transfer limits. + - Help me with the process to verify my account for higher transfers. + - Help me with the process to verify my account. + - I want to verify my account for extended transfer limits. + - Can you verify my account? + - What do I need to verify for higher transfer allowances? + - Guide me through account verification. + - I need a higher transfer limit; can you verify my account? + + - intent: add_contact + examples: | + - I need to add a new contact. + - Can you help me add a contact? + - How do I add John to my contacts? + - Please add a contact for me. + - Add a new contact to my list. + - I want to save a new contact. + - Can you save this contact for me? + - Help me add a contact. + - Add Max to my contacts. + - I need to enter a new contact. + - How can I add a contact? + - Save a new contact to my directory. + - Include a new contact in my list, please. + - I want to include a new contact. + - Help me save a new contact. + - Add a contact to my address book. + - I need to input a new contact. + - Please help me add Jane to my contacts. + - Add a friend to my contacts. + - Can you create a new contact for me? + - I want to add Paula to my contacts. + - Add a new entry to my contact list. + - Help me store a new contact. + + - intent: remove_contact + examples: | + - I need to remove a contact. + - Can you help me delete a contact? + - How do I remove Max from my contacts? + - Please delete a contact for me. + - Remove a contact from my list. + - I want to delete a contact. + - Can you take John off my contact list? + - Help me remove a contact. + - Delete Tom from my contacts. + - I need to erase a contact. + - How can I delete a contact? + - Remove a contact from my directory. + - Exclude a contact from my list, please. + - Can you delete a contact from my phonebook? + - I want to erase a contact. + - Help me delete a contact. + - Remove a contact from my address book. + - I need to get rid of a contact. + - Please help me remove Paula from my contacts. + - Erase this number from my contacts. + - Delete a friend from my contacts. + - Can you remove a contact for me? + - I want to delete Alex from my contacts. + - Remove an entry from my contact list. + - Help me delete a contact permanently. \ No newline at end of file diff --git a/data/flows/remove_contact.yml b/data/flows/remove_contact.yml index 06b37ae..2938547 100644 --- a/data/flows/remove_contact.yml +++ b/data/flows/remove_contact.yml @@ -2,6 +2,10 @@ flows: remove_contact: name: remove a contact description: remove a contact from your contact list + nlu_trigger: + - intent: + name: remove_contact + confidence_threshold: 0.9 steps: - collect: remove_contact_handle description: a contact handle starting with @ diff --git a/data/flows/replace_card.yml b/data/flows/replace_card.yml index 280fef2..b90d1f5 100644 --- a/data/flows/replace_card.yml +++ b/data/flows/replace_card.yml @@ -2,6 +2,10 @@ flows: replace_card: description: the user needs to replace their card name: replace_card + nlu_trigger: + - intent: + name: replace_card + confidence_threshold: 0.9 steps: - collect: confirm_correct_card ask_before_filling: true diff --git a/data/flows/verify_account.yml b/data/flows/verify_account.yml index 0be8d8d..51cb95b 100644 --- a/data/flows/verify_account.yml +++ b/data/flows/verify_account.yml @@ -2,6 +2,10 @@ flows: verify_account: name: verify account description: Verify an account for higher transfer limits + nlu_trigger: + - intent: + name: verify_account + confidence_threshold: 0.9 steps: - collect: verify_account_email ask_before_filling: true diff --git a/data/nlu-based/nlu.yml b/data/nlu-based/nlu.yml index 504705c..e12f668 100644 --- a/data/nlu-based/nlu.yml +++ b/data/nlu-based/nlu.yml @@ -57,6 +57,23 @@ nlu: - stop it - cancel this +- intent: health_advice + examples: | + - I need some medical advice. + - Can you help me with some health issues? + - I need medical support. + - I'm experiencing some symptoms and I need guidance on what to do. + - Can you provide me with health recommendations? + - I'm struggling with some health concerns. Can you offer advice? + - Can you suggest ways to improve my overall well-being? + - I'm looking for tips on managing stress and anxiety. Any advice? + - I have a specific health question. Can you offer me some insights? + - I need suggestions on maintaining a healthy diet and exercise routine. + - Is there anyone knowledgeable about natural remedies who can give me advice? + - Can you provide me with information on preventing common illnesses? + - I'm interested in learning about alternative therapies. Can you share your expertise? + - Can you recommend a good doctor? I'm not feeling well. + - intent: list_restaurants examples: | - Do you know any good restaurant? diff --git a/data/nlu-based/rules.yml b/data/nlu-based/rules.yml index a78cd9d..1adfd09 100644 --- a/data/nlu-based/rules.yml +++ b/data/nlu-based/rules.yml @@ -18,6 +18,11 @@ rules: - action: action_list_restaurants - action: action_reset_routing +- rule: health advice + steps: + - intent: health_advice + - action: utter_cant_advice_on_health + - rule: activate restaurant form steps: - intent: request_restaurant diff --git a/domain/CALM/add_card.yml b/domain/CALM/add_card.yml index 7abaece..82b9004 100644 --- a/domain/CALM/add_card.yml +++ b/domain/CALM/add_card.yml @@ -1,5 +1,8 @@ version: "3.1" +intents: + - add_card + responses: utter_card_added: - text: Okay, added another card. diff --git a/domain/CALM/add_contact.yml b/domain/CALM/add_contact.yml index 1d6fec2..c53d293 100644 --- a/domain/CALM/add_contact.yml +++ b/domain/CALM/add_contact.yml @@ -1,5 +1,8 @@ version: "3.1" +intents: + - add_contact + actions: - add_contact diff --git a/domain/CALM/remove_contact.yml b/domain/CALM/remove_contact.yml index b0ca475..fb7b106 100644 --- a/domain/CALM/remove_contact.yml +++ b/domain/CALM/remove_contact.yml @@ -1,5 +1,8 @@ version: "3.1" +intents: + - remove_contact + actions: - remove_contact diff --git a/domain/CALM/replace_card.yml b/domain/CALM/replace_card.yml index 0e36ba7..85121ff 100644 --- a/domain/CALM/replace_card.yml +++ b/domain/CALM/replace_card.yml @@ -1,5 +1,8 @@ version: "3.1" +intents: + - replace_card + slots: confirm_correct_card: type: bool diff --git a/domain/CALM/verify_account.yml b/domain/CALM/verify_account.yml index ca54136..eff1daa 100644 --- a/domain/CALM/verify_account.yml +++ b/domain/CALM/verify_account.yml @@ -1,5 +1,8 @@ version: "3.1" +intents: + - verify_account + slots: verify_account_email: type: text diff --git a/domain/CALM/health_advice.yml b/domain/nlu-based/health_advice.yml similarity index 100% rename from domain/CALM/health_advice.yml rename to domain/nlu-based/health_advice.yml From e395757f1f8f6f1bbcded03f4b4651c6c498b6d9 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 16:26:22 +0200 Subject: [PATCH 05/15] use action_ask_remove_contact_handle --- actions/action_ask_remove_contact_handle.py | 25 +++++++++++++++++++++ actions/ask_for_slot_action.py | 3 +-- data/flows/nlu.yml | 2 +- domain/CALM/remove_contact.yml | 3 +-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 actions/action_ask_remove_contact_handle.py diff --git a/actions/action_ask_remove_contact_handle.py b/actions/action_ask_remove_contact_handle.py new file mode 100644 index 0000000..d4a7212 --- /dev/null +++ b/actions/action_ask_remove_contact_handle.py @@ -0,0 +1,25 @@ +from typing import Dict, Text + +from rasa_sdk import Tracker +from rasa_sdk.executor import CollectingDispatcher +from rasa_sdk import Action + +from actions.db import get_contacts + + +class AskForRemoveContactHandle(Action): + def name(self) -> Text: + return "action_ask_remove_contact_handle" + + def run( + self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict + ): + contacts = get_contacts(tracker.sender_id) + + dispatcher.utter_button_message( + text="What's the handle of the user you want to remove?", + buttons=[ + {"title": f"{c.handle} ({c.name})", "payload": c.handle} + for c in contacts + ] + ) diff --git a/actions/ask_for_slot_action.py b/actions/ask_for_slot_action.py index c550f2d..9cec527 100644 --- a/actions/ask_for_slot_action.py +++ b/actions/ask_for_slot_action.py @@ -1,7 +1,6 @@ -from typing import Dict, Text, List +from typing import Dict, Text from rasa_sdk import Tracker -from rasa_sdk.events import EventType, ActionExecutionRejected from rasa_sdk.executor import CollectingDispatcher from rasa_sdk import Action diff --git a/data/flows/nlu.yml b/data/flows/nlu.yml index 4e670be..8027af2 100644 --- a/data/flows/nlu.yml +++ b/data/flows/nlu.yml @@ -1,4 +1,4 @@ -version: 3.1 +version: "3.1" nlu: - intent: replace_card diff --git a/domain/CALM/remove_contact.yml b/domain/CALM/remove_contact.yml index fb7b106..c381fbb 100644 --- a/domain/CALM/remove_contact.yml +++ b/domain/CALM/remove_contact.yml @@ -5,6 +5,7 @@ intents: actions: - remove_contact + - action_ask_remove_contact_handle slots: remove_contact_name: @@ -21,8 +22,6 @@ slots: - type: custom responses: - utter_ask_remove_contact_handle: - - text: What's the handle of the user you want to remove? utter_contact_not_in_list: - text: That contact is not in your list. utter_remove_contact_error: From 8f086cc84e30f87aa5aa139f63c7601c9af7343c Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 16:51:56 +0200 Subject: [PATCH 06/15] add action_reset_routing to pattern completed --- README.md | 53 ++++++++++++------- config.yml | 2 +- data/flows/patterns.yml | 7 +++ data/nlu-based/nlu.yml | 26 +++++++++ data/nlu-based/rules.yml | 8 +++ domain/{CALM => flows}/_knowledge.yml | 0 domain/{CALM => flows}/add_card.yml | 0 domain/{CALM => flows}/add_contact.yml | 0 domain/{CALM => flows}/check_balance.yml | 0 domain/{CALM => flows}/list_contacts.yml | 0 domain/{CALM => flows}/patterns.yml | 0 .../register_to_vote_in_california.yml | 0 domain/{CALM => flows}/remove_contact.yml | 0 domain/{CALM => flows}/replace_card.yml | 0 .../setup_recurrent_payment.yml | 0 domain/{CALM => flows}/transaction_search.yml | 0 domain/{CALM => flows}/transfer_money.yml | 0 domain/{CALM => flows}/verify_account.yml | 0 domain/{CALM => nlu-based}/hotel_search.yml | 3 +- 19 files changed, 77 insertions(+), 22 deletions(-) rename domain/{CALM => flows}/_knowledge.yml (100%) rename domain/{CALM => flows}/add_card.yml (100%) rename domain/{CALM => flows}/add_contact.yml (100%) rename domain/{CALM => flows}/check_balance.yml (100%) rename domain/{CALM => flows}/list_contacts.yml (100%) rename domain/{CALM => flows}/patterns.yml (100%) rename domain/{CALM => flows}/register_to_vote_in_california.yml (100%) rename domain/{CALM => flows}/remove_contact.yml (100%) rename domain/{CALM => flows}/replace_card.yml (100%) rename domain/{CALM => flows}/setup_recurrent_payment.yml (100%) rename domain/{CALM => flows}/transaction_search.yml (100%) rename domain/{CALM => flows}/transfer_money.yml (100%) rename domain/{CALM => flows}/verify_account.yml (100%) rename domain/{CALM => nlu-based}/hotel_search.yml (95%) diff --git a/README.md b/README.md index fe0c599..1d3debc 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,21 @@ This project is released under the Rasa's [Early Release Software Access Terms]( ## Demo Bot -The demo bot's business logic is implemented as a set of [flows](https://rasa.com/docs/rasa-pro/concepts/flows), +The demo bot's business logic is implemented as a set of [flows](https://rasa.com/docs/rasa-pro/concepts/flows), [rules](https://rasa.com/docs/rasa/rules), and [stories](https://rasa.com/docs/rasa/stories), which are organized into three main skill groups: Contacts, Transactions, and Others/Misc. +The skill groups `Contacts` and `Transactions` are implemented using CALM, e.g. are defined in flows. +The skill group `Others/Misc` is implemented via the [nlu-based approach](https://rasa.com/docs/rasa/training-data-format). +[Coexistence](https://rasa.com/docs/rasa-pro/building-assistants/coexistence) allows you to run a single assistant that uses both the Conversational AI with Language Models (CALM) +approach and an NLU-based system in parallel. + Each flow consists of a `yaml` file and a [domain definition](https://rasa.com/docs/rasa-pro/concepts/domain), which includes [actions](https://rasa.com/docs/rasa-pro/concepts/domain#actions), [slots](https://rasa.com/docs/rasa-pro/concepts/domain#slots), and [bot ressponses](https://rasa.com/docs/rasa-pro/concepts/domain#responses). -The table below shows all the skills implemented in the bot, along with the flow and -domain definitions for each: + +The table below shows all the skills implemented in the bot: @@ -41,21 +46,21 @@ domain definitions for each: - + - + - + @@ -66,35 +71,35 @@ domain definitions for each: - + - + - + - + - + @@ -108,9 +113,19 @@ domain definitions for each: - + + +
Add new contact Adds a new contact to the user's list. LinkLinkLink
Remove contact Removes selected contact from the user's list. LinkLinkLink
List contacts List all of user's saved contacts. LinkLinkLink
Check account balance Allows users to check their current account balance. LinkLinkLink
Transfer money Facilitates the transfer of funds to user's contacts. LinkLinkLink
Setup recurrent payment Sets up recurring payments which can either be a direct debit or a standing order. LinkLinkLink
List transactions List the last user's transactions. LinkLinkLink
Replace card Replace the user's card. LinkLinkLink
Verify account Verify an account for higher transfer limits. LinkLinkLink
+ + + + + + + + @@ -118,27 +133,27 @@ domain definitions for each: - - + + - - + + - - + +
Skill GroupDescriptionLink to story, rules, nlu dataLink to domain
Others / Misc Book Restaurant Make a reservation at a restaurant.LinkLinkLinkLink
Health Advice Detects an out-of-scope topic: health advice.LinkLinkLinkLink
Hotel search Search for a hotel and show hotel rating.LinkLinkLinkLink
-Rasa ships with a default behavior for every [conversation repair case](https://rasa.com/docs/rasa-pro/concepts/conversation-repair/#conversation-repair-cases) +Rasa ships with a default behavior in CALM for every [conversation repair case](https://rasa.com/docs/rasa-pro/concepts/conversation-repair/#conversation-repair-cases) which is handled through a [default pattern flow](https://rasa.com/docs/rasa-pro/concepts/conversation-repair/#conversation-repair-cases). In addition to its core functionality, the demo bot also includes an examples of pattern overriding in [`data/flows/patterns.yml`](data/flows/patterns.yml). diff --git a/config.yml b/config.yml index 599cbe8..4106cb0 100644 --- a/config.yml +++ b/config.yml @@ -5,7 +5,7 @@ pipeline: calm_entry: sticky: "handles everything else" nlu_entry: - sticky: "handles everything around booking a hotel or a restaurant" + sticky: "handles everything around booking a hotel or a restaurant and health advice" non_sticky: "handles chitchat" - name: WhitespaceTokenizer - name: CountVectorsFeaturizer diff --git a/data/flows/patterns.yml b/data/flows/patterns.yml index d89a4be..1020300 100644 --- a/data/flows/patterns.yml +++ b/data/flows/patterns.yml @@ -46,3 +46,10 @@ flows: next: cancel_flow - id: cancel_flow action: action_cancel_flow + + pattern_completed: + description: all flows have been completed and there is nothing else to be done + name: pattern completed + steps: + - action: utter_can_do_something_else + - action: action_reset_routing \ No newline at end of file diff --git a/data/nlu-based/nlu.yml b/data/nlu-based/nlu.yml index e12f668..c98eb0b 100644 --- a/data/nlu-based/nlu.yml +++ b/data/nlu-based/nlu.yml @@ -74,6 +74,32 @@ nlu: - I'm interested in learning about alternative therapies. Can you share your expertise? - Can you recommend a good doctor? I'm not feeling well. +- intent: hotel_search + examples: | + - I need to find a hotel. + - Can you help me search for hotels? + - Please search for hotels in my area. + - Find hotels near me. + - I want to look for hotels. + - Can you locate hotels for me? + - Help me find a hotel. + - Search for hotel options nearby. + - I need a hotel for my trip. + - How can I search for hotels? + - Look up hotels in this city. + - Show me hotels in the area. + - Can you recommend any hotels? + - I want to see available hotels. + - Help me locate a hotel. + - Find some hotels for me. + - I need hotel suggestions. + - Please find a hotel where I can stay. + - Search for hotels around this place. + - Can you find nearby hotels? + - I’m looking for hotels in the vicinity. + - Help me search for a place to stay. + - Show available hotels for my stay. + - intent: list_restaurants examples: | - Do you know any good restaurant? diff --git a/data/nlu-based/rules.yml b/data/nlu-based/rules.yml index 1adfd09..8a9604a 100644 --- a/data/nlu-based/rules.yml +++ b/data/nlu-based/rules.yml @@ -22,6 +22,14 @@ rules: steps: - intent: health_advice - action: utter_cant_advice_on_health + - action: action_reset_routing + +- rule: hotel search + steps: + - intent: hotel_search + - action: action_search_hotel + - action: utter_hotel_inform_rating + - action: action_reset_routing - rule: activate restaurant form steps: diff --git a/domain/CALM/_knowledge.yml b/domain/flows/_knowledge.yml similarity index 100% rename from domain/CALM/_knowledge.yml rename to domain/flows/_knowledge.yml diff --git a/domain/CALM/add_card.yml b/domain/flows/add_card.yml similarity index 100% rename from domain/CALM/add_card.yml rename to domain/flows/add_card.yml diff --git a/domain/CALM/add_contact.yml b/domain/flows/add_contact.yml similarity index 100% rename from domain/CALM/add_contact.yml rename to domain/flows/add_contact.yml diff --git a/domain/CALM/check_balance.yml b/domain/flows/check_balance.yml similarity index 100% rename from domain/CALM/check_balance.yml rename to domain/flows/check_balance.yml diff --git a/domain/CALM/list_contacts.yml b/domain/flows/list_contacts.yml similarity index 100% rename from domain/CALM/list_contacts.yml rename to domain/flows/list_contacts.yml diff --git a/domain/CALM/patterns.yml b/domain/flows/patterns.yml similarity index 100% rename from domain/CALM/patterns.yml rename to domain/flows/patterns.yml diff --git a/domain/CALM/register_to_vote_in_california.yml b/domain/flows/register_to_vote_in_california.yml similarity index 100% rename from domain/CALM/register_to_vote_in_california.yml rename to domain/flows/register_to_vote_in_california.yml diff --git a/domain/CALM/remove_contact.yml b/domain/flows/remove_contact.yml similarity index 100% rename from domain/CALM/remove_contact.yml rename to domain/flows/remove_contact.yml diff --git a/domain/CALM/replace_card.yml b/domain/flows/replace_card.yml similarity index 100% rename from domain/CALM/replace_card.yml rename to domain/flows/replace_card.yml diff --git a/domain/CALM/setup_recurrent_payment.yml b/domain/flows/setup_recurrent_payment.yml similarity index 100% rename from domain/CALM/setup_recurrent_payment.yml rename to domain/flows/setup_recurrent_payment.yml diff --git a/domain/CALM/transaction_search.yml b/domain/flows/transaction_search.yml similarity index 100% rename from domain/CALM/transaction_search.yml rename to domain/flows/transaction_search.yml diff --git a/domain/CALM/transfer_money.yml b/domain/flows/transfer_money.yml similarity index 100% rename from domain/CALM/transfer_money.yml rename to domain/flows/transfer_money.yml diff --git a/domain/CALM/verify_account.yml b/domain/flows/verify_account.yml similarity index 100% rename from domain/CALM/verify_account.yml rename to domain/flows/verify_account.yml diff --git a/domain/CALM/hotel_search.yml b/domain/nlu-based/hotel_search.yml similarity index 95% rename from domain/CALM/hotel_search.yml rename to domain/nlu-based/hotel_search.yml index 2ac9890..46c4384 100644 --- a/domain/CALM/hotel_search.yml +++ b/domain/nlu-based/hotel_search.yml @@ -15,5 +15,4 @@ slots: responses: utter_hotel_inform_rating: - - text: The {hotel_name} has an average rating of {hotel_average_rating} - + - text: The {hotel_name} has an average rating of {hotel_average_rating} \ No newline at end of file From d0081c59a555959e9f8b916e3ec61ec2bc0b12a4 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 10 Jun 2024 16:52:39 +0200 Subject: [PATCH 07/15] enable enterprise search agani --- data/flows/patterns.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data/flows/patterns.yml b/data/flows/patterns.yml index 1020300..9fe7784 100644 --- a/data/flows/patterns.yml +++ b/data/flows/patterns.yml @@ -25,12 +25,10 @@ flows: steps: - action: action_trigger_chitchat - # using chitchat here so that intentless is used for better testability pattern_search: description: handle knowledge-based requests using enterprise search steps: - - action: action_trigger_chitchat - #- action: action_trigger_search + - action: action_trigger_search pattern_cancel_flow: description: A meta flow that's started when a flow is cancelled. From 8e11ac1aeaa9b566665c057f4910edfa7356836b Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Tue, 11 Jun 2024 10:00:19 +0200 Subject: [PATCH 08/15] add new flows --- actions/action_check_portfolio.py | 25 ++++++++++++++++++ actions/action_show_portfolio.py | 26 +++++++++++++++++++ actions/authenticate_user.py | 25 ++++++++++++++++++ actions/db.py | 10 ++++++++ data/flows/authenticate_user.yml | 24 +++++++++++++++++ data/flows/check_portfolio.yml | 24 +++++++++++++++++ db/portfolio_options.json | 14 ++++++++++ domain/flows/authenticate_user.yml | 26 +++++++++++++++++++ domain/flows/check_portfolio.yml | 41 ++++++++++++++++++++++++++++++ 9 files changed, 215 insertions(+) create mode 100644 actions/action_check_portfolio.py create mode 100644 actions/action_show_portfolio.py create mode 100644 actions/authenticate_user.py create mode 100644 data/flows/authenticate_user.yml create mode 100644 data/flows/check_portfolio.yml create mode 100644 db/portfolio_options.json create mode 100644 domain/flows/authenticate_user.yml create mode 100644 domain/flows/check_portfolio.yml diff --git a/actions/action_check_portfolio.py b/actions/action_check_portfolio.py new file mode 100644 index 0000000..47392a6 --- /dev/null +++ b/actions/action_check_portfolio.py @@ -0,0 +1,25 @@ +from rasa_sdk import Action, Tracker +from rasa_sdk.events import SlotSet +from rasa_sdk.executor import CollectingDispatcher + +from actions.db import get_portfolio_options + + +class ActionCheckPortfolio(Action): + + def name(self) -> str: + return "action_check_portfolio" + + def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, + domain: dict) -> list: + # Retrieve the portfolio type from slots + portfolio_type = tracker.get_slot("portfolio_type") + + portfolio_db = get_portfolio_options(tracker.sender_id) + + portfolio_exists = [p for p in portfolio_db if p.type == portfolio_type] + + if portfolio_exists: + return [SlotSet("portfolio_exists", True)] + else: + return [SlotSet("portfolio_exists", False)] \ No newline at end of file diff --git a/actions/action_show_portfolio.py b/actions/action_show_portfolio.py new file mode 100644 index 0000000..0ee80c4 --- /dev/null +++ b/actions/action_show_portfolio.py @@ -0,0 +1,26 @@ +from rasa_sdk import Action, Tracker +from rasa_sdk.events import SlotSet +from rasa_sdk.executor import CollectingDispatcher + +from actions.db import get_portfolio_options + + +class ActionShowPortfolio(Action): + + def name(self) -> str: + return "action_show_portfolio" + + def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, + domain: dict) -> list: + # Retrieve the portfolio type from slots + portfolio_type = tracker.get_slot("portfolio_type") + + # Placeholder for portfolio data + portfolio_db = get_portfolio_options(tracker.sender_id) + + portfolio = [p.options for p in portfolio_db if p.type == portfolio_type] + + if portfolio: + return [SlotSet("portfolio_options", portfolio[0])] + else: + return [SlotSet("portfolio_options", [])] \ No newline at end of file diff --git a/actions/authenticate_user.py b/actions/authenticate_user.py new file mode 100644 index 0000000..6dbbeee --- /dev/null +++ b/actions/authenticate_user.py @@ -0,0 +1,25 @@ +from rasa_sdk import Action, Tracker +from rasa_sdk.events import SlotSet +from rasa_sdk.executor import CollectingDispatcher + + +class ActionAuthenticateUser(Action): + + def name(self) -> str: + return "action_authenticate_user" + + def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, + domain: dict) -> list: + # Retrieve the user credentials from slots + user_name = tracker.get_slot("user_name") + user_password = tracker.get_slot("user_password") + + # Dummy authentication. + # Placeholder for user authentication, in real scenarios the username and + # password should be checked against a database. + authenticated = True + + if authenticated: + return [SlotSet("is_user_logged_in", True)] + else: + return [SlotSet("is_user_logged_in", False)] \ No newline at end of file diff --git a/actions/db.py b/actions/db.py index 535a82d..51b1033 100644 --- a/actions/db.py +++ b/actions/db.py @@ -12,6 +12,7 @@ TRANSACTIONS = "transactions.json" MY_ACCOUNT = "my_account.json" RESTAURANTS = "restaurants.json" +PORTFOLIO_OPTIONS = "portfolio_options.json" class MyAccount(BaseModel): @@ -44,6 +45,11 @@ class Restaurant(BaseModel): capacity: int +class Portfolio(BaseModel): + type: str + options: List[str] + + def get_session_db_path(session_id: str) -> str: tempdir = tempfile.gettempdir() project_name = "rasa-calm-demo" @@ -104,3 +110,7 @@ def write_contacts(session_id: str, contacts: List[Contact]) -> None: def get_restaurants(session_id: str) -> List[Restaurant]: return [Restaurant(**item) for item in read_db(session_id, RESTAURANTS)] + + +def get_portfolio_options(session_id: str) -> List[Portfolio]: + return [Portfolio(**item) for item in read_db(session_id, PORTFOLIO_OPTIONS)] \ No newline at end of file diff --git a/data/flows/authenticate_user.yml b/data/flows/authenticate_user.yml new file mode 100644 index 0000000..40fd5ed --- /dev/null +++ b/data/flows/authenticate_user.yml @@ -0,0 +1,24 @@ +flows: + authenticate_user: + description: "Authenticate the user if they are not already logged in." + if: False + steps: + - noop: true + next: + - if: not slots.is_user_logged_in + then: ask_user_credentials + - else: END + - id: ask_user_credentials + collect: user_name + description: "The user name of the user." + - collect: user_password + description: "The password of the user." + - action: action_authenticate_user + next: + - if: not slots.is_user_logged_in + then: + - action: utter_authentication_failed + next: ask_user_credentials + - else: + - action: utter_authentication_successful + next: END \ No newline at end of file diff --git a/data/flows/check_portfolio.yml b/data/flows/check_portfolio.yml new file mode 100644 index 0000000..be87749 --- /dev/null +++ b/data/flows/check_portfolio.yml @@ -0,0 +1,24 @@ +flows: + check_portfolio: + description: "Check the user's investment portfolio, including stocks, bonds, and mutual funds." + steps: + - call: authenticate_user + - collect: portfolio_type + description: "The type of portfolio (e.g., stocks, bonds, mutual funds)." + - action: action_check_portfolio + next: + - if: slots.portfolio_exists + then: show_portfolio + - else: + - action: utter_portfolio_not_found + next: END + - id: show_portfolio + action: action_show_portfolio + next: + - if: slots.portfolio_options + then: + - action: utter_portfolio_options_found + next: END + - else: + - action: utter_portfolio_options_not_found + next: END \ No newline at end of file diff --git a/db/portfolio_options.json b/db/portfolio_options.json new file mode 100644 index 0000000..c0d988d --- /dev/null +++ b/db/portfolio_options.json @@ -0,0 +1,14 @@ +[ + { + "type": "stocks", + "options": ["AAPL", "GOOGL", "MSFT"] + }, + { + "type": "bonds", + "options": ["US Treasury", "Corporate Bonds"] + }, + { + "type": "mutual_funds", + "options": ["Vanguard 500 Index", "Fidelity Contrafund"] + } +] \ No newline at end of file diff --git a/domain/flows/authenticate_user.yml b/domain/flows/authenticate_user.yml new file mode 100644 index 0000000..5219570 --- /dev/null +++ b/domain/flows/authenticate_user.yml @@ -0,0 +1,26 @@ +version: "3.1" + +slots: + is_user_logged_in: + type: bool + user_name: + type: text + mappings: + - type: custom + user_password: + type: text + mappings: + - type: custom + +responses: + utter_authentication_failed: + - text: "Authentication failed. Please try again." + utter_authentication_successful: + - text: "You have successfully logged in." + utter_ask_user_name: + - text: "Please enter your user name." + utter_ask_user_password: + - text: "Please enter your password." + +actions: + - action_authenticate_user diff --git a/domain/flows/check_portfolio.yml b/domain/flows/check_portfolio.yml new file mode 100644 index 0000000..36fb8c1 --- /dev/null +++ b/domain/flows/check_portfolio.yml @@ -0,0 +1,41 @@ +version: "3.1" + +slots: + portfolio_type: + type: categorical + values: + - stocks + - bonds + - mutual_funds + mappings: + - type: custom + portfolio_exists: + type: bool + mappings: + - type: custom + portfolio_options: + type: list + initial_value: [] + mappings: + - type: custom + +responses: + utter_portfolio_not_found: + - text: I couldn't find your portfolio. Please ensure you have a valid account. + utter_ask_portfolio_type: + - text: Please select your portfolio type. + buttons: + - payload: stocks + title: stocks + - payload: bonds + title: bonds + - payload: mutual_funds + title: mutual funds + utter_portfolio_options_found: + - text: "Your {portfolio_type} portfolio: {portfolio_options}" + utter_portfolio_options_not_found: + - text: You don't have any {portfolio_type} investments. + +actions: + - action_check_portfolio + - action_show_portfolio \ No newline at end of file From 2a9ea04179fcfd8d9122bd16106cf4aaf22a43f5 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Tue, 11 Jun 2024 15:06:06 +0200 Subject: [PATCH 09/15] add more tests --- ...ks_restaurant_with_fixed_date_indirect.yml | 26 -------- ...fault_pattern_override_no_confirmation.yml | 8 +-- .../user_corrects_a_number_slot.yml | 31 +++++---- .../digressions/intermittent_flow_switch.yml | 32 ++++------ .../happy_path/user_books_a_restaurant.yml | 29 ++++----- ..._a_restaurant_with_an_alternative_time.yml | 35 ++++------- ..._restaurant_with_their_own_alternative.yml | 28 --------- ...ks_restaurant_with_fixed_date_indirect.yml | 12 ++++ .../happy_path/user_checks_portfolio.yml | 16 +++++ ...ecks_portfolio_mentioning_type_upfront.yml | 15 +++++ .../user_replace_card_incorrect_card.yml | 9 +++ .../user_replace_card_with_linked_flow.yml | 55 +++++++++++++++- .../happy_path/user_verifies_account.yml | 63 +++++++++++++++++++ .../user_wants_to_register_to_vote.yml | 20 ++++++ .../check_portfolio_not_found.yml | 23 +++++++ 15 files changed, 271 insertions(+), 131 deletions(-) delete mode 100644 e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml delete mode 100644 e2e_tests/passing/happy_path/user_books_a_restaurant_with_their_own_alternative.yml create mode 100644 e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml create mode 100644 e2e_tests/passing/happy_path/user_checks_portfolio.yml create mode 100644 e2e_tests/passing/happy_path/user_checks_portfolio_mentioning_type_upfront.yml create mode 100644 e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml create mode 100644 e2e_tests/passing/happy_path/user_verifies_account.yml create mode 100644 e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml create mode 100644 e2e_tests/passing/invalid_path/check_portfolio_not_found.yml diff --git a/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml b/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml deleted file mode 100644 index 4b5baf8..0000000 --- a/e2e_tests/failing/disambiguation/user_books_restaurant_with_fixed_date_indirect.yml +++ /dev/null @@ -1,26 +0,0 @@ -test_cases: - - test_case: user books restaurant with fixed date - steps: - - user: I want to book a table for two at Xaigon 7pm tonight - - utter: utter_restaurant_not_available - - utter: utter_ask_book_restaurant_alternative_dummy - - user: we won't have a babysitter then - - utter: utter_ask_confirm_slot_correction - - user: "yes" - - slot_was_set: - - book_restaurant_is_date_flexible: false - - utter: utter_corrected_previous_input - - utter: utter_restaurant_not_available - - utter: utter_ask_book_restaurant_alternative_dummy - - user: that works too! - - utter: utter_ask_confirm_slot_correction - - user: "yes" - - slot_was_set: - - book_restaurant_name_of_restaurant: Prometheus Pizza - - utter: utter_corrected_previous_input - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: Eliza - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking diff --git a/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml b/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml index 7e21798..e42f739 100644 --- a/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml +++ b/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml @@ -1,9 +1,9 @@ test_cases: - test_case: default cancellation pattern overridden no confirmation steps: - - user: I would like to book a table for dinner - - utter: utter_ask_book_restaurant_name_of_restaurant - - user: Noma - - utter: utter_ask_book_restaurant_number_of_people + - user: I would like to add a new contact + - utter: utter_ask_add_contact_handle + - user: "@max" + - utter: utter_ask_add_contact_name - user: Actually I cancel that please. - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml b/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml index 2268ec7..fa1416f 100644 --- a/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml @@ -1,19 +1,18 @@ test_cases: - test_case: user corrects value of a number slot steps: - - user: I want to book a table at Prometheus pizza, I love their doughy crust - - utter: utter_ask_book_restaurant_number_of_people - - user: for 4 peeps - - utter: utter_ask_book_restaurant_date - - user: Ah wait, make that 5 people, Barbara is also coming - - utter: utter_ask_confirm_slot_correction - - user: "yes" - - utter: utter_corrected_previous_input - - utter: utter_ask_book_restaurant_date - - user: Is 8 pm tomorrow night still possible? - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: for Jamie - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking + - user: I want to book a table + - utter: utter_ask_restaurant_form_city + - user: Amsterdam + - utter: What cuisine are you looking for? + - user: Japanese + - utter: Do you know which restaurant you would like me to reverse a table at? + - user: Yamazato Restaurant + - utter: utter_ask_restaurant_form_num_people + - user: "4" + - utter: utter_ask_restaurant_form_restaurant_time + - user: sorry, we are 6 people + - utter: utter_ask_restaurant_form_restaurant_time + - user: tomorrow at 7pm + - utter: utter_restaurant_form_submit + - utter: utter_restaurant_available \ No newline at end of file diff --git a/e2e_tests/passing/digressions/intermittent_flow_switch.yml b/e2e_tests/passing/digressions/intermittent_flow_switch.yml index 4a97847..1a3d82e 100644 --- a/e2e_tests/passing/digressions/intermittent_flow_switch.yml +++ b/e2e_tests/passing/digressions/intermittent_flow_switch.yml @@ -1,22 +1,16 @@ test_cases: - test_case: user makes an intermittent flow switch steps: - - user: book table - - utter: utter_ask_book_restaurant_name_of_restaurant - - user: show my balance, did my paycheck already arrive? - - utter: utter_current_balance - - utter: utter_flow_continue_interrupted - - utter: utter_ask_book_restaurant_name_of_restaurant - - user: Ah great, I already got my paycheck, we'll be going to Brewdog then - - utter: utter_ask_book_restaurant_number_of_people - - user: For 6 - - utter: utter_ask_book_restaurant_date - - user: this Friday - - utter: utter_ask_book_restaurant_time - - user: 8pm please - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: for Thomas - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking + - user: I need to transfer some money to John + - slot_was_set: + - route_session_to_calm: True + - utter: utter_ask_transfer_money_amount_of_money + - user: How much do I have on my account? + - utter: utter_current_balance + - utter: utter_flow_continue_interrupted + - utter: utter_ask_transfer_money_amount_of_money + - user: ah, great, I owe him $500 + - utter: utter_ask_transfer_money_final_confirmation + - user: "yes" + - utter: utter_transfer_complete + - utter: utter_can_do_something_else \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_books_a_restaurant.yml b/e2e_tests/passing/happy_path/user_books_a_restaurant.yml index 2f67936..20c1549 100644 --- a/e2e_tests/passing/happy_path/user_books_a_restaurant.yml +++ b/e2e_tests/passing/happy_path/user_books_a_restaurant.yml @@ -1,17 +1,18 @@ test_cases: - test_case: user books a restaurant steps: - - user: I want to book a table for 4 at Xaigon for 8pm tonight - - slot_was_set: - - book_restaurant_name_of_restaurant: Xaigon - - book_restaurant_number_of_people: "4" - - book_restaurant_date - - book_restaurant_time - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: Emil - - slot_was_set: - - book_restaurant_reservation_name: Emil - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking + - user: book a restaurant + - slot_was_set: + - route_session_to_calm: False + - utter: utter_ask_restaurant_form_city + - user: Berlin + - utter: What cuisine are you looking for? + - user: Thai + - utter: Do you know which restaurant you would like me to reverse a table at? + - user: Thai Spice + - utter: utter_ask_restaurant_form_num_people + - user: "3" + - utter: utter_ask_restaurant_form_restaurant_time + - user: Next Wednesday at 6pm + - utter: utter_restaurant_form_submit + - utter: utter_restaurant_available \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml b/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml index f3b029c..9f723b1 100644 --- a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml +++ b/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml @@ -1,25 +1,16 @@ test_cases: - test_case: user books a restaurant with an alternative time steps: - - user: I want to book a table for 4 at Xaigon for 7pm tonight - - slot_was_set: - - book_restaurant_name_of_restaurant: Xaigon - - book_restaurant_number_of_people: "4" - - book_restaurant_date - - book_restaurant_time - - utter: utter_restaurant_not_available - - utter: utter_ask_book_restaurant_alternative_dummy - - user: sounds good! - - utter: utter_ask_confirm_slot_correction - - user: "yes" - - slot_was_set: - - book_restaurant_time - - utter: utter_corrected_previous_input - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: Emil - - slot_was_set: - - book_restaurant_reservation_name: Emil - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking + - user: I want to book a table for 3 people for tomorrow + - utter: utter_ask_restaurant_form_city + - user: Berlin + - utter: What cuisine are you looking for? + - user: Japanese + - utter: Do you know which restaurant you would like me to reverse a table at? + - user: Ah, wait. John just texted me, we need to move the date to Wednesday, 6pm. + - slot_was_set: + - restaurant_time + - utter: Do you know which restaurant you would like me to reverse a table at? + - user: Sakura Sushi House + - utter: utter_restaurant_form_submit + - utter: utter_restaurant_available diff --git a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_their_own_alternative.yml b/e2e_tests/passing/happy_path/user_books_a_restaurant_with_their_own_alternative.yml deleted file mode 100644 index a62757f..0000000 --- a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_their_own_alternative.yml +++ /dev/null @@ -1,28 +0,0 @@ -test_cases: - - test_case: user books a restaurant with their own alternative - steps: - - user: I want to book a table for 3 people at Shiso Burger - - slot_was_set: - - book_restaurant_name_of_restaurant: Shiso Burger - - book_restaurant_number_of_people: "3" - - utter: utter_ask_book_restaurant_date - - user: I was thinking tomorrow 7pm - - slot_was_set: - - book_restaurant_date - - book_restaurant_time - - utter: utter_restaurant_not_available - - utter: utter_ask_book_restaurant_alternative_dummy - - user: 8pm is not good, how about a bit later then, like 9pm? - - utter: utter_ask_confirm_slot_correction - - user: "yes" - - slot_was_set: - - book_restaurant_time - - utter: utter_corrected_previous_input - - utter: utter_restaurant_available - - utter: utter_ask_book_restaurant_reservation_name - - user: Jakub - - slot_was_set: - - book_restaurant_reservation_name: Jakub - - utter: utter_ask_book_restaurant_confirmation - - user: "yes" - - utter: utter_confirm_restaurant_booking diff --git a/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml b/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml new file mode 100644 index 0000000..ce500c3 --- /dev/null +++ b/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml @@ -0,0 +1,12 @@ +test_cases: + - test_case: user books restaurant with fixed date + steps: + - user: I want to book a table for two 7pm tonight + - utter: utter_ask_restaurant_form_city + - user: Berlin + - utter: What cuisine are you looking for? + - user: French + - utter: Do you know which restaurant you would like me to reverse a table at? + - user: Le Gourmet + - utter: utter_restaurant_form_submit + - utter: utter_restaurant_available \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_checks_portfolio.yml b/e2e_tests/passing/happy_path/user_checks_portfolio.yml new file mode 100644 index 0000000..07ffb78 --- /dev/null +++ b/e2e_tests/passing/happy_path/user_checks_portfolio.yml @@ -0,0 +1,16 @@ +test_cases: + - test_case: Authenticate and check mutual funds portfolio with options found + steps: + - user: I want to check my portfolio + - utter: utter_ask_user_name + - user: Max + - utter: utter_ask_user_password + - user: "1234" + - utter: utter_authentication_successful + - utter: utter_ask_portfolio_type + - user: mutual funds + - slot_was_set: + - portfolio_type: mutual_funds + - portfolio_exists: True + - portfolio_options + - utter: utter_portfolio_options_found \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_checks_portfolio_mentioning_type_upfront.yml b/e2e_tests/passing/happy_path/user_checks_portfolio_mentioning_type_upfront.yml new file mode 100644 index 0000000..06c3924 --- /dev/null +++ b/e2e_tests/passing/happy_path/user_checks_portfolio_mentioning_type_upfront.yml @@ -0,0 +1,15 @@ +test_cases: + - test_case: Authenticate and check bonds portfolio not found + steps: + - user: I want to check my bonds portfolio + - slot_was_set: + - portfolio_type: bonds + - utter: utter_ask_user_name + - user: Max + - utter: utter_ask_user_password + - user: "1234" + - utter: utter_authentication_successful + - slot_was_set: + - portfolio_exists: True + - portfolio_options + - utter: utter_portfolio_options_found diff --git a/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml b/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml new file mode 100644 index 0000000..c40692a --- /dev/null +++ b/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml @@ -0,0 +1,9 @@ +test_cases: + - test_case: Replace card when user does not confirm the correct card + steps: + - user: I need to replace my card + - utter: utter_ask_confirm_correct_card + - user: "no" + - slot_was_set: + - confirm_correct_card: false + - action: utter_relevant_card_not_linked \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_replace_card_with_linked_flow.yml b/e2e_tests/passing/happy_path/user_replace_card_with_linked_flow.yml index d6ea26b..686f19d 100644 --- a/e2e_tests/passing/happy_path/user_replace_card_with_linked_flow.yml +++ b/e2e_tests/passing/happy_path/user_replace_card_with_linked_flow.yml @@ -1,12 +1,63 @@ test_cases: - - test_case: user needs card replacement + - test_case: Replace lost card which was used fraudulently steps: - user: I need to replace my card - utter: utter_ask_confirm_correct_card - user: "yes" + - slot_was_set: + - confirm_correct_card: true - utter: utter_ask_replacement_reason - - user: lost + - user: I lost my card + - slot_was_set: + - replacement_reason: "lost" + - utter: utter_ask_was_card_used_fraudulently + - user: "yes" + - slot_was_set: + - was_card_used_fraudulently: true + - utter: utter_report_fraud + + - test_case: Replace lost card which was not used fraudulently + steps: + - user: I need to replace my card + - utter: utter_ask_confirm_correct_card + - user: "yes" + - slot_was_set: + - confirm_correct_card: true + - utter: utter_ask_replacement_reason + - user: I lost my card + - slot_was_set: + - replacement_reason: lost - utter: utter_ask_was_card_used_fraudulently - user: "no" + - slot_was_set: + - was_card_used_fraudulently: false - utter: utter_will_cancel_and_send_new - utter: utter_new_card_has_been_ordered + + - test_case: Replace damaged card + steps: + - user: I need to replace my card + - utter: utter_ask_confirm_correct_card + - user: "yes" + - slot_was_set: + - confirm_correct_card: true + - utter: utter_ask_replacement_reason + - user: My card is damaged + - slot_was_set: + - replacement_reason: damaged + - utter: utter_will_cancel_and_send_new + - utter: utter_new_card_has_been_ordered + + - test_case: Replace card with unknown replacement reason + steps: + - user: I need to replace my card + - utter: utter_ask_confirm_correct_card + - user: "yes" + - slot_was_set: + - confirm_correct_card: true + - utter: utter_ask_replacement_reason + - user: some other reason + - utter: utter_categorical_slot_rejection + - utter: utter_ask_replacement_reason + - user: ok, stop then + - utter: utter_can_do_something_else \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_verifies_account.yml b/e2e_tests/passing/happy_path/user_verifies_account.yml new file mode 100644 index 0000000..95cee51 --- /dev/null +++ b/e2e_tests/passing/happy_path/user_verifies_account.yml @@ -0,0 +1,63 @@ +test_cases: + - test_case: Verify account for non-California resident + steps: + - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: true + - utter: utter_ask_verify_account_email + - user: example@mail.com + - slot_was_set: + - verify_account_email + - utter: utter_ask_based_in_california + - user: "no" + - slot_was_set: + - based_in_california: false + - utter: utter_ask_verify_account_confirmation + - user: "yes" + - slot_was_set: + - verify_account_confirmation: true + - utter: utter_verify_account_success + + - test_case: Verify account for California resident with insufficient income + steps: + - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: true + - utter: utter_ask_verify_account_email + - user: example@mail.com + - slot_was_set: + - verify_account_email + - utter: utter_ask_based_in_california + - user: "yes" + - slot_was_set: + - based_in_california: true + - utter: utter_ask_verify_account_sufficient_california_income + - user: "no" + - slot_was_set: + - verify_account_sufficient_california_income: false + - utter: utter_ca_income_insufficient + - utter: utter_can_do_something_else + + - test_case: Verify account for California resident with sufficient income + steps: + - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: true + - utter: utter_ask_verify_account_email + - user: example@mail.com + - slot_was_set: + - verify_account_email + - utter: utter_ask_based_in_california + - user: "yes" + - slot_was_set: + - based_in_california: true + - utter: utter_ask_verify_account_sufficient_california_income + - user: "yes" + - slot_was_set: + - verify_account_sufficient_california_income: true + - utter: utter_ask_verify_account_confirmation + - user: "yes" + - slot_was_set: + - verify_account_confirmation: true + - utter: utter_verify_account_success + - utter: utter_can_do_something_else \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml b/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml new file mode 100644 index 0000000..0d8a730 --- /dev/null +++ b/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml @@ -0,0 +1,20 @@ +fixtures: + - california_resident: + - based_in_california: True + - non_california_resident: + - based_in_california: False + +test_cases: + - test_case: Register to vote for California resident + fixtures: + - california_resident + steps: + - user: I want to register to vote + - utter: utter_register_to_vote_in_california + + - test_case: Register to vote for non-California resident (should not trigger) + fixtures: + - non_california_resident + steps: + - user: I want to register to vote + - utter: utter_cannot_answer \ No newline at end of file diff --git a/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml b/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml new file mode 100644 index 0000000..19a8a32 --- /dev/null +++ b/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml @@ -0,0 +1,23 @@ +test_cases: + - test_case: Authenticate and check portfolio with invalid value twice + steps: + - user: I want to check my portfolio + - utter: utter_ask_user_name + - user: Max + - utter: utter_ask_user_password + - user: "1234" + - utter: utter_authentication_successful + - utter: utter_ask_portfolio_type + - user: other + - utter: utter_categorical_slot_rejection + - utter: utter_ask_portfolio_type + - user: other + - utter: utter_categorical_slot_rejection + - utter: utter_ask_portfolio_type + - user: bonds + - slot_was_set: + - portfolio_type: bonds + - portfolio_exists: True + - portfolio_options + - utter: utter_portfolio_options_found + - utter: utter_can_do_something_else From 5d068a36681ed221cfb62a527ad4a8189901e387 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Wed, 12 Jun 2024 11:22:11 +0200 Subject: [PATCH 10/15] update passing e2e tests --- domain/flows/verify_account.yml | 1 + .../cancellation_respects_scope.yml | 2 ++ ...ate_cancellation_and_start_of_new_flow.yml | 2 ++ ...fault_pattern_override_no_confirmation.yml | 4 +++- .../user_cancels_during_a_correction.yml | 2 ++ .../user_changes_mind_based_on_new_info.yml | 2 ++ .../user_changes_mind_on_a_whim.yml | 2 ++ .../passing/chitchat/user_says_goodbye.yml | 2 ++ .../corrections/user_cancels_correction.yml | 1 + .../user_corrects_a_boolean_slot.yml | 2 ++ .../user_corrects_a_branching_slot.yml | 9 ++++++-- .../user_corrects_a_number_slot.yml | 12 +++++----- ...ts_amount_of_money_in_the_next_message.yml | 2 ++ ...er_corrects_mentioning_old_value_first.yml | 2 ++ ...ser_corrects_mentioning_old_value_last.yml | 2 ++ ...corrects_recipient_in_the_next_message.yml | 2 ++ .../user_corrects_recipient_late.yml | 2 ++ .../corrections/user_corrects_string_slot.yml | 7 +++++- .../user_corrects_twice_in_row.yml | 2 ++ .../user_resets_a_slot_by_slot_name.yml | 2 ++ .../user_resets_a_slot_by_value.yml | 2 ++ .../digressions/intermittent_flow_switch.yml | 2 +- .../user_answers_and_also_asks_a_question.yml | 5 ++++- .../digressions/user_asks_what_info_is.yml | 10 ++++++++- .../user_asks_why_information_is_needed.yml | 2 ++ .../user_refuses_to_provide_information.yml | 2 ++ .../user_starts_multiple_flows.yml | 2 ++ .../user_starts_with_a_very_long_message.yml | 1 + .../validation_too_little_money.yml | 2 ++ .../user_sends_short_noun_only_message.yml | 18 ++++++++++----- .../user_sends_short_verb_only_message.yml | 22 +++++++++++++------ .../happy_path/user_books_a_restaurant.yml | 10 ++++----- ..._a_restaurant_with_an_alternative_time.yml | 12 +++++----- ...ks_restaurant_with_fixed_date_indirect.yml | 11 +++++----- .../happy_path/user_remove_contact.yml | 2 +- .../user_remove_contact_from_list.yml | 3 +++ .../user_replace_card_incorrect_card.yml | 2 +- .../user_sends_long_message.yml | 6 +++++ .../knowledge_question_during_flow.yml | 3 ++- .../user_follows_up_on_knowledge_question.yml | 6 +++-- .../user_starts_with_a_knowledge_question.yml | 3 ++- ..._says_they_dont_want_the_former_option.yml | 22 +++++++++++++------ .../passing/nlu_trigger/health_advice.yml | 5 ----- ...r_asks_for_repition_of_previous_action.yml | 2 +- pyproject.toml | 2 +- 45 files changed, 158 insertions(+), 61 deletions(-) delete mode 100644 e2e_tests/passing/nlu_trigger/health_advice.yml diff --git a/domain/flows/verify_account.yml b/domain/flows/verify_account.yml index eff1daa..e7eae0e 100644 --- a/domain/flows/verify_account.yml +++ b/domain/flows/verify_account.yml @@ -12,6 +12,7 @@ slots: type: bool mappings: - type: custom + shared_for_coexistence: True verify_account_sufficient_california_income: type: bool mappings: diff --git a/e2e_tests/passing/cancellations/cancellation_respects_scope.yml b/e2e_tests/passing/cancellations/cancellation_respects_scope.yml index 9c20788..dd5c138 100644 --- a/e2e_tests/passing/cancellations/cancellation_respects_scope.yml +++ b/e2e_tests/passing/cancellations/cancellation_respects_scope.yml @@ -2,6 +2,8 @@ test_cases: - test_case: cancellation respects scope steps: - user: send money to John + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: cancel - utter: utter_flow_cancelled_rasa diff --git a/e2e_tests/passing/cancellations/immediate_cancellation_and_start_of_new_flow.yml b/e2e_tests/passing/cancellations/immediate_cancellation_and_start_of_new_flow.yml index 17489d8..6a9f274 100644 --- a/e2e_tests/passing/cancellations/immediate_cancellation_and_start_of_new_flow.yml +++ b/e2e_tests/passing/cancellations/immediate_cancellation_and_start_of_new_flow.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user immediately cancels and starts new flow steps: - user: I want to send money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: ah, one moment stop that. I want to see my transfers first - utter: utter_flow_cancelled_rasa diff --git a/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml b/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml index e42f739..bcfc720 100644 --- a/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml +++ b/e2e_tests/passing/cancellations/user_cancels_default_pattern_override_no_confirmation.yml @@ -2,8 +2,10 @@ test_cases: - test_case: default cancellation pattern overridden no confirmation steps: - user: I would like to add a new contact + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_add_contact_handle - user: "@max" - utter: utter_ask_add_contact_name - - user: Actually I cancel that please. + - user: Actually, cancel that please. - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml b/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml index 74125c9..35ef220 100644 --- a/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml +++ b/e2e_tests/passing/cancellations/user_cancels_during_a_correction.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user cancels during a correction steps: - user: I want to send money to Joe + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: oh sorry I meant John - utter: utter_ask_confirm_slot_correction diff --git a/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml b/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml index 39720ff..5805f74 100644 --- a/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml +++ b/e2e_tests/passing/cancellations/user_changes_mind_based_on_new_info.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user changes mind based on new info steps: - user: Send some money to Joe + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: Ah one moment, show transactions. - utter: utter_transactions diff --git a/e2e_tests/passing/cancellations/user_changes_mind_on_a_whim.yml b/e2e_tests/passing/cancellations/user_changes_mind_on_a_whim.yml index 202e264..9961266 100644 --- a/e2e_tests/passing/cancellations/user_changes_mind_on_a_whim.yml +++ b/e2e_tests/passing/cancellations/user_changes_mind_on_a_whim.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user changes mind based on new info steps: - user: I want to send money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: stop - utter: utter_flow_cancelled_rasa \ No newline at end of file diff --git a/e2e_tests/passing/chitchat/user_says_goodbye.yml b/e2e_tests/passing/chitchat/user_says_goodbye.yml index 0df8ed6..c89a2d1 100644 --- a/e2e_tests/passing/chitchat/user_says_goodbye.yml +++ b/e2e_tests/passing/chitchat/user_says_goodbye.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user says goodbye steps: - user: I want to send 10 bucks to Spencer + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_final_confirmation - user: "Yes" - utter: utter_transfer_complete diff --git a/e2e_tests/passing/corrections/user_cancels_correction.yml b/e2e_tests/passing/corrections/user_cancels_correction.yml index 64519d1..b3f0efb 100644 --- a/e2e_tests/passing/corrections/user_cancels_correction.yml +++ b/e2e_tests/passing/corrections/user_cancels_correction.yml @@ -3,6 +3,7 @@ test_cases: steps: - user: send John 50 - slot_was_set: + - route_session_to_calm: True - transfer_money_amount_of_money: "50" - transfer_money_recipient: John - utter: utter_ask_transfer_money_final_confirmation diff --git a/e2e_tests/passing/corrections/user_corrects_a_boolean_slot.yml b/e2e_tests/passing/corrections/user_corrects_a_boolean_slot.yml index 0c551a6..4942825 100644 --- a/e2e_tests/passing/corrections/user_corrects_a_boolean_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_a_boolean_slot.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user corrects boolean slot steps: - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_verify_account_email - user: It's mag@pie.com - utter: utter_ask_based_in_california diff --git a/e2e_tests/passing/corrections/user_corrects_a_branching_slot.yml b/e2e_tests/passing/corrections/user_corrects_a_branching_slot.yml index dcc0ff7..ae3cb11 100644 --- a/e2e_tests/passing/corrections/user_corrects_a_branching_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_a_branching_slot.yml @@ -2,17 +2,22 @@ test_cases: - test_case: user corrects a branching slot steps: - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_verify_account_email - user: It's birdie@example.com - utter: utter_ask_based_in_california - user: "yes" - utter: utter_ask_verify_account_sufficient_california_income - - user: Oh, actually I am not based in California + - user: sorry, I need to correct the previous input - utter: utter_ask_confirm_slot_correction - user: "yes" + - utter: utter_corrected_previous_input - slot_was_set: - based_in_california - - utter: utter_corrected_previous_input + - utter: utter_ask_based_in_california + - user: "no" - utter: utter_ask_verify_account_confirmation - user: "yes" - utter: utter_verify_account_success + - utter: utter_can_do_something_else diff --git a/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml b/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml index fa1416f..35aeccc 100644 --- a/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_a_number_slot.yml @@ -2,12 +2,14 @@ test_cases: - test_case: user corrects value of a number slot steps: - user: I want to book a table + - slot_was_set: + - route_session_to_calm: False - utter: utter_ask_restaurant_form_city - - user: Amsterdam - - utter: What cuisine are you looking for? - - user: Japanese - - utter: Do you know which restaurant you would like me to reverse a table at? - - user: Yamazato Restaurant + - user: /inform{"location":"amsterdam"} + # we use action_ask_restaurant_form_cuisine for the collect step + - user: /inform{"cuisine":"Japanese"} + # we use action_ask_restaurant_form_restaurant_name for the collect step + - user: /inform{"restaurant_name":"Yamazato Restaurant"} - utter: utter_ask_restaurant_form_num_people - user: "4" - utter: utter_ask_restaurant_form_restaurant_time diff --git a/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml b/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml index 7b28cdf..00bbb5f 100644 --- a/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml +++ b/e2e_tests/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user corrects amount of money in the next message steps: - user: I want to transfer money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml index d420803..b81c028 100644 --- a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml +++ b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_first.yml @@ -2,6 +2,8 @@ test_cases: - test_case: correction mentioning old value first steps: - user: I want to transfer money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml index a810803..fff76c9 100644 --- a/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml +++ b/e2e_tests/passing/corrections/user_corrects_mentioning_old_value_last.yml @@ -2,6 +2,8 @@ test_cases: - test_case: correction mentioning old value last steps: - user: I want to transfer money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml b/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml index 682e418..3e04871 100644 --- a/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml +++ b/e2e_tests/passing/corrections/user_corrects_recipient_in_the_next_message.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user corrects recipient in the next message steps: - user: I want to transfer money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_recipient_late.yml b/e2e_tests/passing/corrections/user_corrects_recipient_late.yml index c28b9da..2f2a18a 100644 --- a/e2e_tests/passing/corrections/user_corrects_recipient_late.yml +++ b/e2e_tests/passing/corrections/user_corrects_recipient_late.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user corrects recipient late steps: - user: I want to transfer money + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_recipient - user: John - slot_was_set: diff --git a/e2e_tests/passing/corrections/user_corrects_string_slot.yml b/e2e_tests/passing/corrections/user_corrects_string_slot.yml index f404173..9aa1f9c 100644 --- a/e2e_tests/passing/corrections/user_corrects_string_slot.yml +++ b/e2e_tests/passing/corrections/user_corrects_string_slot.yml @@ -1,13 +1,18 @@ test_cases: - test_case: user corrects string slot steps: + # NLUCommandAdapter should start the flow, so "Peter" is not detected as an entity - user: I want to add Peter to my contacts - slot_was_set: - - add_contact_name: Peter + - route_session_to_calm: True - utter: utter_ask_add_contact_handle - user: It's @PeterPark - slot_was_set: - add_contact_handle: "@PeterPark" + - utter: utter_ask_add_contact_name + - user: Peter + - slot_was_set: + - add_contact_name: "Peter" - utter: utter_ask_add_contact_confirmation - user: Ah, please use Spidey as the name - utter: utter_ask_confirm_slot_correction diff --git a/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml b/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml index 7fa5c7a..a866eb5 100644 --- a/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml +++ b/e2e_tests/passing/corrections/user_corrects_twice_in_row.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user corrects a value twice in a row while being asked for confirmation steps: - user: I want to send money to Joe + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: oh sorry I meant John - utter: utter_ask_confirm_slot_correction diff --git a/e2e_tests/passing/corrections/user_resets_a_slot_by_slot_name.yml b/e2e_tests/passing/corrections/user_resets_a_slot_by_slot_name.yml index c02d845..982d60b 100644 --- a/e2e_tests/passing/corrections/user_resets_a_slot_by_slot_name.yml +++ b/e2e_tests/passing/corrections/user_resets_a_slot_by_slot_name.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user resets a slot by value steps: - user: I want to send some money to John + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: "50" - utter: utter_ask_transfer_money_final_confirmation diff --git a/e2e_tests/passing/corrections/user_resets_a_slot_by_value.yml b/e2e_tests/passing/corrections/user_resets_a_slot_by_value.yml index 76d70a3..34d9409 100644 --- a/e2e_tests/passing/corrections/user_resets_a_slot_by_value.yml +++ b/e2e_tests/passing/corrections/user_resets_a_slot_by_value.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user resets a slot by value steps: - user: I want to send some money to John + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: Sorry, I didn't mean John - utter: utter_ask_confirm_slot_correction diff --git a/e2e_tests/passing/digressions/intermittent_flow_switch.yml b/e2e_tests/passing/digressions/intermittent_flow_switch.yml index 1a3d82e..02c7f9c 100644 --- a/e2e_tests/passing/digressions/intermittent_flow_switch.yml +++ b/e2e_tests/passing/digressions/intermittent_flow_switch.yml @@ -3,7 +3,7 @@ test_cases: steps: - user: I need to transfer some money to John - slot_was_set: - - route_session_to_calm: True + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money - user: How much do I have on my account? - utter: utter_current_balance diff --git a/e2e_tests/passing/digressions/user_answers_and_also_asks_a_question.yml b/e2e_tests/passing/digressions/user_answers_and_also_asks_a_question.yml index 6a3340d..8e63c38 100644 --- a/e2e_tests/passing/digressions/user_answers_and_also_asks_a_question.yml +++ b/e2e_tests/passing/digressions/user_answers_and_also_asks_a_question.yml @@ -2,7 +2,10 @@ test_cases: - test_case: user answers and also asks a question steps: - user: I want to send 50$ to Justin + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_transfer_money_final_confirmation - user: yes, and btw are there any fees associated with the sending? - - utter: utter_free_transfers + # not able to test the response of enterprise search + # - utter: utter_free_transfers - utter: utter_transfer_complete diff --git a/e2e_tests/passing/digressions/user_asks_what_info_is.yml b/e2e_tests/passing/digressions/user_asks_what_info_is.yml index 0f2b970..eea0bc4 100644 --- a/e2e_tests/passing/digressions/user_asks_what_info_is.yml +++ b/e2e_tests/passing/digressions/user_asks_what_info_is.yml @@ -1,12 +1,20 @@ test_cases: - test_case: user asks what requested information is steps: + # NLUCommandAdapter should start the flow, so "Peter" is not detected as an entity - user: I want to add Kate to my contacts + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_add_contact_handle - user: What's a contact handle? - - utter: utter_contact_handle_info + # not able to test the response of enterprise search + # - utter: utter_contact_handle_info - utter: utter_ask_add_contact_handle - user: Ah okay she sent it to me, it's @KatePurry + - utter: utter_ask_add_contact_name + - user: Kate + - slot_was_set: + - add_contact_name: "Kate" - utter: utter_ask_add_contact_confirmation - user: "yes" - utter: utter_contact_added diff --git a/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml b/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml index 57b321e..87ce30c 100644 --- a/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml +++ b/e2e_tests/passing/digressions/user_asks_why_information_is_needed.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user asks why information is needed steps: - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_verify_account_email - user: It's a.tweep@twitter.com - utter: utter_ask_based_in_california diff --git a/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml b/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml index ff769c4..2978990 100644 --- a/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml +++ b/e2e_tests/passing/digressions/user_refuses_to_provide_information.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user refuses to provide information steps: - user: I want to verify my account + - slot_was_set: + - route_session_to_calm: True - utter: utter_ask_verify_account_email - user: It's thomas@x.com - utter: utter_ask_based_in_california diff --git a/e2e_tests/passing/digressions/user_starts_multiple_flows.yml b/e2e_tests/passing/digressions/user_starts_multiple_flows.yml index 445510b..2c69104 100644 --- a/e2e_tests/passing/digressions/user_starts_multiple_flows.yml +++ b/e2e_tests/passing/digressions/user_starts_multiple_flows.yml @@ -2,5 +2,7 @@ test_cases: - test_case: user starts multiple flows steps: - user: Show my transactions and send money + - slot_was_set: + - route_session_to_calm: True - utter: utter_transactions - utter: utter_ask_transfer_money_recipient diff --git a/e2e_tests/passing/digressions/user_starts_with_a_very_long_message.yml b/e2e_tests/passing/digressions/user_starts_with_a_very_long_message.yml index e0c0ea6..f3a6482 100644 --- a/e2e_tests/passing/digressions/user_starts_with_a_very_long_message.yml +++ b/e2e_tests/passing/digressions/user_starts_with_a_very_long_message.yml @@ -4,4 +4,5 @@ test_cases: - user: What's up dawg, my homie Steven got my back yesterday when we were out for drinks and my phone was out of batt, let me settle up with him. - slot_was_set: - transfer_money_recipient: Steven + - route_session_to_calm: True - utter: utter_ask_transfer_money_amount_of_money diff --git a/e2e_tests/passing/digressions/validation_too_little_money.yml b/e2e_tests/passing/digressions/validation_too_little_money.yml index 3f4e006..53eb8db 100644 --- a/e2e_tests/passing/digressions/validation_too_little_money.yml +++ b/e2e_tests/passing/digressions/validation_too_little_money.yml @@ -2,6 +2,8 @@ test_cases: - test_case: validation too little money steps: - user: I want to send 5000$ to Martin + - slot_was_set: + - route_session_to_calm: True - utter: utter_transfer_money_insufficient_funds - utter: utter_ask_transfer_money_amount_of_money - user: Oh, I thought I had more, then do 3000$ for now diff --git a/e2e_tests/passing/disambiguation/user_sends_short_noun_only_message.yml b/e2e_tests/passing/disambiguation/user_sends_short_noun_only_message.yml index bcf1a55..392b4fb 100644 --- a/e2e_tests/passing/disambiguation/user_sends_short_noun_only_message.yml +++ b/e2e_tests/passing/disambiguation/user_sends_short_noun_only_message.yml @@ -1,5 +1,13 @@ -test_cases: - - test_case: user sends short noun only message (2) - steps: - - user: cash - - utter: utter_clarification_options_rasa +# BUG: WAITING FOR https://rasahq.atlassian.net/browse/ENG-1091 + +#fixtures: +# - route_to_calm: +# - route_session_to_calm: True +# +#test_cases: +# - test_case: user sends short noun only message +# fixtures: +# - route_to_calm +# steps: +# - user: cash +# - utter: utter_clarification_options_rasa diff --git a/e2e_tests/passing/disambiguation/user_sends_short_verb_only_message.yml b/e2e_tests/passing/disambiguation/user_sends_short_verb_only_message.yml index b477e91..081f5c3 100644 --- a/e2e_tests/passing/disambiguation/user_sends_short_verb_only_message.yml +++ b/e2e_tests/passing/disambiguation/user_sends_short_verb_only_message.yml @@ -1,7 +1,15 @@ -test_cases: - - test_case: user sends short verb only message - steps: - - user: add - - utter: utter_clarification_options_rasa - - user: contact - - utter: utter_ask_add_contact_handle +# BUG: WAITING FOR https://rasahq.atlassian.net/browse/ENG-1091 + +#fixtures: +# - route_to_calm: +# - route_session_to_calm: True +# +#test_cases: +# - test_case: user sends short verb only message +# fixtures: +# - route_to_calm +# steps: +# - user: add +# - utter: utter_clarification_options_rasa +# - user: contact +# - utter: utter_ask_add_contact_handle diff --git a/e2e_tests/passing/happy_path/user_books_a_restaurant.yml b/e2e_tests/passing/happy_path/user_books_a_restaurant.yml index 20c1549..48254a0 100644 --- a/e2e_tests/passing/happy_path/user_books_a_restaurant.yml +++ b/e2e_tests/passing/happy_path/user_books_a_restaurant.yml @@ -5,11 +5,11 @@ test_cases: - slot_was_set: - route_session_to_calm: False - utter: utter_ask_restaurant_form_city - - user: Berlin - - utter: What cuisine are you looking for? - - user: Thai - - utter: Do you know which restaurant you would like me to reverse a table at? - - user: Thai Spice + - user: /inform{"location":"amsterdam"} + # we use action_ask_restaurant_form_cuisine for the collect step + - user: /inform{"cuisine":"Thai"} + # we use action_ask_restaurant_form_restaurant_name for the collect step + - user: /inform{"restaurant_name":"Thai Spice"} - utter: utter_ask_restaurant_form_num_people - user: "3" - utter: utter_ask_restaurant_form_restaurant_time diff --git a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml b/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml index 9f723b1..db03d63 100644 --- a/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml +++ b/e2e_tests/passing/happy_path/user_books_a_restaurant_with_an_alternative_time.yml @@ -3,14 +3,14 @@ test_cases: steps: - user: I want to book a table for 3 people for tomorrow - utter: utter_ask_restaurant_form_city - - user: Berlin - - utter: What cuisine are you looking for? - - user: Japanese - - utter: Do you know which restaurant you would like me to reverse a table at? + - user: /inform{"location":"berlin"} + # we use action_ask_restaurant_form_cuisine for the collect step + - user: /inform{"cuisine":"Japanese"} + # we use action_ask_restaurant_form_restaurant_name for the collect step - user: Ah, wait. John just texted me, we need to move the date to Wednesday, 6pm. - slot_was_set: - restaurant_time - - utter: Do you know which restaurant you would like me to reverse a table at? - - user: Sakura Sushi House + # we use action_ask_restaurant_form_restaurant_name for the collect step + - user: /inform{"restaurant_name":"Sakura Sushi House"} - utter: utter_restaurant_form_submit - utter: utter_restaurant_available diff --git a/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml b/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml index ce500c3..7b1db13 100644 --- a/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml +++ b/e2e_tests/passing/happy_path/user_books_restaurant_with_fixed_date_indirect.yml @@ -2,11 +2,10 @@ test_cases: - test_case: user books restaurant with fixed date steps: - user: I want to book a table for two 7pm tonight - - utter: utter_ask_restaurant_form_city - - user: Berlin - - utter: What cuisine are you looking for? - - user: French - - utter: Do you know which restaurant you would like me to reverse a table at? - - user: Le Gourmet + - user: /inform{"location":"berlin"} + # we use action_ask_restaurant_form_cuisine for the collect step + - user: /inform{"cuisine":"French"} + # we use action_ask_restaurant_form_restaurant_name for the collect step + - user: /inform{"restaurant_name":"Le Gourmet"} - utter: utter_restaurant_form_submit - utter: utter_restaurant_available \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_remove_contact.yml b/e2e_tests/passing/happy_path/user_remove_contact.yml index 3df89e0..b03d07d 100644 --- a/e2e_tests/passing/happy_path/user_remove_contact.yml +++ b/e2e_tests/passing/happy_path/user_remove_contact.yml @@ -2,7 +2,7 @@ test_cases: - test_case: user removes a contact steps: - user: Remove contact - - utter: utter_ask_remove_contact_handle + # we use action_ask_remove_contact_handle for the collect step - user: "@MaryLu" - slot_was_set: - remove_contact_handle: "@MaryLu" diff --git a/e2e_tests/passing/happy_path/user_remove_contact_from_list.yml b/e2e_tests/passing/happy_path/user_remove_contact_from_list.yml index ec14df7..a218bc5 100644 --- a/e2e_tests/passing/happy_path/user_remove_contact_from_list.yml +++ b/e2e_tests/passing/happy_path/user_remove_contact_from_list.yml @@ -4,7 +4,10 @@ test_cases: - user: Please show my contacts - utter: utter_list_contacts - utter: utter_can_do_something_else + # The NLUCommandAdapter predicts the StartFlow(remove_contact) so the contact handle is not yet detected - user: Remove contact @MaryLu + # we use action_ask_remove_contact_handle for the collect step + - user: "@MaryLu" - slot_was_set: - remove_contact_handle: "@MaryLu" - utter: utter_ask_remove_contact_confirmation diff --git a/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml b/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml index c40692a..7ebaa53 100644 --- a/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml +++ b/e2e_tests/passing/happy_path/user_replace_card_incorrect_card.yml @@ -6,4 +6,4 @@ test_cases: - user: "no" - slot_was_set: - confirm_correct_card: false - - action: utter_relevant_card_not_linked \ No newline at end of file + - utter: utter_relevant_card_not_linked \ No newline at end of file diff --git a/e2e_tests/passing/invalid_user_inputs/user_sends_long_message.yml b/e2e_tests/passing/invalid_user_inputs/user_sends_long_message.yml index c83d16d..ac88657 100644 --- a/e2e_tests/passing/invalid_user_inputs/user_sends_long_message.yml +++ b/e2e_tests/passing/invalid_user_inputs/user_sends_long_message.yml @@ -1,5 +1,11 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + test_cases: - test_case: user sends the long message that exceeds 420 characters + fixtures: + - route_to_calm steps: - user: >- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed diam eget sem ultrices dignissim. diff --git a/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml b/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml index 2d454ed..1c23c75 100644 --- a/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml +++ b/e2e_tests/passing/knowledge/knowledge_question_during_flow.yml @@ -4,7 +4,8 @@ test_cases: - user: I want to send some money to Tre - utter: utter_ask_transfer_money_amount_of_money - user: btw, are these transfers free of charge? - - utter: utter_free_transfers + # not able to test the response of enterprise search + # - utter: utter_free_transfers - utter: utter_ask_transfer_money_amount_of_money - user: great, 50$ then - utter: utter_ask_transfer_money_final_confirmation diff --git a/e2e_tests/passing/knowledge/user_follows_up_on_knowledge_question.yml b/e2e_tests/passing/knowledge/user_follows_up_on_knowledge_question.yml index e5f2547..8abff7d 100644 --- a/e2e_tests/passing/knowledge/user_follows_up_on_knowledge_question.yml +++ b/e2e_tests/passing/knowledge/user_follows_up_on_knowledge_question.yml @@ -2,6 +2,8 @@ test_cases: - test_case: user follows up on a knowledge question steps: - user: Are transfers on free with this service? - - utter: utter_free_transfers + # not able to test the response of enterprise search + # - utter: utter_free_transfers - user: How about international ones? - - utter: utter_domestic_transfers_only + # not able to test the response of enterprise search + # - utter: utter_domestic_transfers_only diff --git a/e2e_tests/passing/knowledge/user_starts_with_a_knowledge_question.yml b/e2e_tests/passing/knowledge/user_starts_with_a_knowledge_question.yml index c59f400..63438e3 100644 --- a/e2e_tests/passing/knowledge/user_starts_with_a_knowledge_question.yml +++ b/e2e_tests/passing/knowledge/user_starts_with_a_knowledge_question.yml @@ -2,4 +2,5 @@ test_cases: - test_case: user starts with a knowledge question steps: - user: Are transfers on free with this service? - - utter: utter_free_transfers + # not able to test the response of enterprise search + # - utter: utter_free_transfers diff --git a/e2e_tests/passing/negations/users_says_they_dont_want_the_former_option.yml b/e2e_tests/passing/negations/users_says_they_dont_want_the_former_option.yml index db31e80..a9845ab 100644 --- a/e2e_tests/passing/negations/users_says_they_dont_want_the_former_option.yml +++ b/e2e_tests/passing/negations/users_says_they_dont_want_the_former_option.yml @@ -1,7 +1,15 @@ -test_cases: - - test_case: user says they don't want the former option - steps: - - user: add - - utter: utter_clarification_options_rasa - - user: not the former - - utter: utter_ask_add_contact_handle +# BUG: WAITING FOR https://rasahq.atlassian.net/browse/ENG-1091 + +#fixtures: +# - route_to_calm: +# - route_session_to_calm: True +# +#test_cases: +# - test_case: user says they don't want the former option +# fixtures: +# - route_to_calm +# steps: +# - user: add +# - utter: utter_clarification_options_rasa +# - user: not the former +# - utter: utter_ask_add_contact_handle diff --git a/e2e_tests/passing/nlu_trigger/health_advice.yml b/e2e_tests/passing/nlu_trigger/health_advice.yml deleted file mode 100644 index 803f195..0000000 --- a/e2e_tests/passing/nlu_trigger/health_advice.yml +++ /dev/null @@ -1,5 +0,0 @@ -test_cases: - - test_case: can't advice on health - steps: - - user: I need medical support. - - utter: utter_cant_advice_on_health diff --git a/e2e_tests/passing/potential_bugs/user_asks_for_repition_of_previous_action.yml b/e2e_tests/passing/potential_bugs/user_asks_for_repition_of_previous_action.yml index 1f242e0..95a04ce 100644 --- a/e2e_tests/passing/potential_bugs/user_asks_for_repition_of_previous_action.yml +++ b/e2e_tests/passing/potential_bugs/user_asks_for_repition_of_previous_action.yml @@ -1,5 +1,5 @@ test_cases: - # this takes makes sure that final confirmation is asked always + # this test makes sure that final confirmation is asked always - test_case: user asks for repetition of previous action steps: - user: send 50 USD to John diff --git a/pyproject.toml b/pyproject.toml index 7d2349e..d027b51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ priority = "supplemental" [tool.poetry.dependencies] python = ">=3.8.1,<3.11" -rasa-pro = "3.8.5" +rasa-pro = "3.8.6" [tool.poetry.group.dev.dependencies] toml = "^0.10.2" From 046aad1e14e389bb8d10b70a3d865599a6c78f49 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Wed, 12 Jun 2024 13:25:19 +0200 Subject: [PATCH 11/15] update e2e tests --- .../user_tries_to_use_abstract_values.yml | 1 + ..._skip_a_question_and_then_cancels_the_flow_hard.yml | 1 + ...er_tries_to_skip_a_question_multiple_times_hard.yml | 1 + .../user_tries_to_skip_a_question_once_hard.yml | 1 + .../user_sends_short_noun_only_message.yml | 10 ++++++++-- .../happy_path/user_sets_up_recurrent_payment.yml | 2 ++ ...to_set_up_recurrent_payment_with_invalid_values.yml | 4 ++++ .../negations/users_says_they_dont_want_one_option.yml | 6 ++++++ ...sers_says_they_dont_want_one_option_among_three.yml | 8 ++++++-- .../users_says_they_dont_want_two_options.yml | 8 ++++++-- .../potential_bugs/user_asks_to_start_10_transfers.yml | 2 ++ ...er_tries_to_skip_a_question_multiple_times_easy.yml | 2 ++ .../digressions/user_asks_for_a_moment_to_think.yml | 0 13 files changed, 40 insertions(+), 6 deletions(-) rename e2e_tests/{flaky => passing}/digressions/user_asks_for_a_moment_to_think.yml (100%) diff --git a/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml b/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml index 4a6beab..7796049 100644 --- a/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml +++ b/e2e_tests/failing/potential_bugs/user_tries_to_use_abstract_values.yml @@ -3,6 +3,7 @@ test_cases: steps: - user: send money - utter: utter_ask_transfer_money_recipient + # the llm is extracting "good friend" as the recipient - user: to a good friend - utter: utter_ask_transfer_money_recipient - user: okay, to Mary diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml index 2b7d71d..44150bb 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_and_then_cancels_the_flow_hard.yml @@ -4,6 +4,7 @@ test_cases: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - user: i don't want to answer this + # cancel flow instead of skip question is predicted - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - user: i don't want to continue diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml index d89e379..ef644e5 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_multiple_times_hard.yml @@ -7,6 +7,7 @@ test_cases: - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - user: i don't want to answer this + # cancel flow instead of skip question is predicted - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - user: okay 50 diff --git a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml index 8ff1cc0..50ed224 100644 --- a/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml +++ b/e2e_tests/failing/skip_question/user_tries_to_skip_a_question_once_hard.yml @@ -4,6 +4,7 @@ test_cases: - user: send money to John - utter: utter_ask_transfer_money_amount_of_money - user: i don't want to answer this + # cancel flow instead of skip question is predicted - utter: utter_skip_question_answer - utter: utter_ask_transfer_money_amount_of_money - user: okay 50 diff --git a/e2e_tests/flaky/disambiguation/user_sends_short_noun_only_message.yml b/e2e_tests/flaky/disambiguation/user_sends_short_noun_only_message.yml index 3f872d9..ef62d72 100644 --- a/e2e_tests/flaky/disambiguation/user_sends_short_noun_only_message.yml +++ b/e2e_tests/flaky/disambiguation/user_sends_short_noun_only_message.yml @@ -1,7 +1,13 @@ +# instead of clarify a start flow command for "list_contact" is predicted + +fixtures: + - route_to_calm: + - route_session_to_calm: True + test_cases: - # test fails as flow retrieval just determines list_contacts as relevant - # so the LLM does not have any options to choose from - test_case: user sends short noun only message + fixtures: + - route_to_calm steps: - user: contact - utter: utter_clarification_options_rasa diff --git a/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml b/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml index 64b759d..81e6685 100644 --- a/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml +++ b/e2e_tests/flaky/happy_path/user_sets_up_recurrent_payment.yml @@ -1,3 +1,5 @@ +# recurrent_payment_type is not mapped to standing order + test_cases: - test_case: user wants to set up a new recurrent payment, but specifies the type incompletely, example 3 steps: diff --git a/e2e_tests/flaky/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml b/e2e_tests/flaky/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml index 253620a..d27404e 100644 --- a/e2e_tests/flaky/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml +++ b/e2e_tests/flaky/invalid_path/user_tries_to_set_up_recurrent_payment_with_invalid_values.yml @@ -4,6 +4,8 @@ test_cases: - user: I want to set up a new recurrent payment - utter: utter_ask_recurrent_payment_type - user: international transfer + # leads to Clarify('direct debit', 'standing order') which is dropped, so CannotHandle command is predicted and + # results in utter_ask_rephrase - utter: utter_categorical_slot_rejection - utter: utter_ask_recurrent_payment_type - user: none of these, actually just need a one off payment @@ -14,6 +16,8 @@ test_cases: - user: I want to set up a new recurrent payment - utter: utter_ask_recurrent_payment_type - user: international transfer + # leads to Clarify('direct debit', 'standing order') which is dropped, so CannotHandle command is predicted and + # results in utter_ask_rephrase - utter: utter_categorical_slot_rejection - utter: utter_ask_recurrent_payment_type - user: international transfer diff --git a/e2e_tests/flaky/negations/users_says_they_dont_want_one_option.yml b/e2e_tests/flaky/negations/users_says_they_dont_want_one_option.yml index 939fb31..d40c8c2 100644 --- a/e2e_tests/flaky/negations/users_says_they_dont_want_one_option.yml +++ b/e2e_tests/flaky/negations/users_says_they_dont_want_one_option.yml @@ -1,5 +1,11 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + test_cases: - test_case: user says they don't want one option + fixtures: + - route_to_calm steps: - user: cash - utter: utter_clarification_options_rasa diff --git a/e2e_tests/flaky/negations/users_says_they_dont_want_one_option_among_three.yml b/e2e_tests/flaky/negations/users_says_they_dont_want_one_option_among_three.yml index d0007ae..c592cce 100644 --- a/e2e_tests/flaky/negations/users_says_they_dont_want_one_option_among_three.yml +++ b/e2e_tests/flaky/negations/users_says_they_dont_want_one_option_among_three.yml @@ -1,7 +1,11 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + test_cases: - # test fails as flow retrieval just determines list_contacts as relevant - # so the LLM does not have any options to choose from - test_case: user says they don't want one option among three + fixtures: + - route_to_calm steps: - user: contact - utter: utter_clarification_options_rasa diff --git a/e2e_tests/flaky/negations/users_says_they_dont_want_two_options.yml b/e2e_tests/flaky/negations/users_says_they_dont_want_two_options.yml index 525624c..5ab39a6 100644 --- a/e2e_tests/flaky/negations/users_says_they_dont_want_two_options.yml +++ b/e2e_tests/flaky/negations/users_says_they_dont_want_two_options.yml @@ -1,7 +1,11 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + test_cases: - # test fails as flow retrieval just determines list_contacts as relevant - # so the LLM does not have any options to choose from - test_case: user says they don't want two options + fixtures: + - route_to_calm steps: - user: contact - utter: utter_clarification_options_rasa diff --git a/e2e_tests/flaky/potential_bugs/user_asks_to_start_10_transfers.yml b/e2e_tests/flaky/potential_bugs/user_asks_to_start_10_transfers.yml index dd82961..ace8e8f 100644 --- a/e2e_tests/flaky/potential_bugs/user_asks_to_start_10_transfers.yml +++ b/e2e_tests/flaky/potential_bugs/user_asks_to_start_10_transfers.yml @@ -1,3 +1,5 @@ +# The first utterance ("10 transfers") already sets the amount of money to 10 + test_cases: - test_case: user asks to start 10 transfers steps: diff --git a/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml b/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml index f7f37ed..e698cac 100644 --- a/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml +++ b/e2e_tests/flaky/skip_questions/user_tries_to_skip_a_question_multiple_times_easy.yml @@ -1,3 +1,5 @@ +# cancel flow is predicted instead of skip question + test_cases: - test_case: user tries to skip a question multiple times (easy) steps: diff --git a/e2e_tests/flaky/digressions/user_asks_for_a_moment_to_think.yml b/e2e_tests/passing/digressions/user_asks_for_a_moment_to_think.yml similarity index 100% rename from e2e_tests/flaky/digressions/user_asks_for_a_moment_to_think.yml rename to e2e_tests/passing/digressions/user_asks_for_a_moment_to_think.yml From 1bbba81e479e64916e15941c849262356db2a213 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Wed, 12 Jun 2024 13:28:34 +0200 Subject: [PATCH 12/15] update rasa version --- data/flows/transfer_money.yml | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/data/flows/transfer_money.yml b/data/flows/transfer_money.yml index ddf41d4..78986a4 100644 --- a/data/flows/transfer_money.yml +++ b/data/flows/transfer_money.yml @@ -2,6 +2,7 @@ flows: transfer_money: description: send money to friends and family name: transfer money + always_include_in_prompt: True steps: - collect: transfer_money_recipient description: the name of a person diff --git a/pyproject.toml b/pyproject.toml index d027b51..111fff5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ priority = "supplemental" [tool.poetry.dependencies] python = ">=3.8.1,<3.11" -rasa-pro = "3.8.6" +rasa-pro = "3.8.8" [tool.poetry.group.dev.dependencies] toml = "^0.10.2" From bf5da9638500e31119f46167a11ede6fc4af13e4 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Wed, 12 Jun 2024 13:36:41 +0200 Subject: [PATCH 13/15] update poetry.lock --- poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index a1e7a3d..73a914a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4749,13 +4749,13 @@ fire = "*" [[package]] name = "rasa-pro" -version = "3.8.5" +version = "3.8.8" description = "State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development." optional = false python-versions = ">=3.8.1,<3.11" files = [ - {file = "rasa_pro-3.8.5-py3-none-any.whl", hash = "sha256:007529440af6151db9c35542b58b2e59ed5704d47fa320d8ca26540a47e66ead"}, - {file = "rasa_pro-3.8.5.tar.gz", hash = "sha256:c04b71c539d4af3c5235fea145cca0b60a6ca21ad3e20d5bfa9a045c18d330d9"}, + {file = "rasa_pro-3.8.8-py3-none-any.whl", hash = "sha256:716286dcf7cda0dc7e8fd7200a9bdb452822a5b87e0c7849da65571b6c200455"}, + {file = "rasa_pro-3.8.8.tar.gz", hash = "sha256:f172c6b61edef7f1c65248d3aa7c5ae698e20ebee9f32f9e7bc55211fbe80af2"}, ] [package.dependencies] @@ -7216,4 +7216,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.11" -content-hash = "9dfaf55a59761e6f74b530486db0ac26e6ea35916bdebb0c989eb9258a3a0372" +content-hash = "d914c9d17851bd2d4323627f04216674eb86e62623c9c0d69442e516faa4e09f" From d1efb4df9846765df3b243b2c4fa4fd60a30a8f5 Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Wed, 12 Jun 2024 14:01:02 +0200 Subject: [PATCH 14/15] fix e2e tests --- .../happy_path/user_wants_to_register_to_vote.yml | 13 +++++++++++++ .../happy_path/user_wants_to_register_to_vote.yml | 10 +--------- .../invalid_path/check_portfolio_not_found.yml | 4 ++-- 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 e2e_tests/flaky/happy_path/user_wants_to_register_to_vote.yml diff --git a/e2e_tests/flaky/happy_path/user_wants_to_register_to_vote.yml b/e2e_tests/flaky/happy_path/user_wants_to_register_to_vote.yml new file mode 100644 index 0000000..b339186 --- /dev/null +++ b/e2e_tests/flaky/happy_path/user_wants_to_register_to_vote.yml @@ -0,0 +1,13 @@ +fixtures: + - non_california_resident: + - based_in_california: False + - route_session_to_calm: True + +test_cases: + - test_case: Register to vote for non-California resident (should not trigger) + fixtures: + - non_california_resident + steps: + - user: I want to register to vote + # ChitChat is predicted instead of no command being predicted + - utter: utter_cannot_answer \ No newline at end of file diff --git a/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml b/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml index 0d8a730..6e850ca 100644 --- a/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml +++ b/e2e_tests/passing/happy_path/user_wants_to_register_to_vote.yml @@ -1,8 +1,7 @@ fixtures: - california_resident: - based_in_california: True - - non_california_resident: - - based_in_california: False + - route_session_to_calm: True test_cases: - test_case: Register to vote for California resident @@ -11,10 +10,3 @@ test_cases: steps: - user: I want to register to vote - utter: utter_register_to_vote_in_california - - - test_case: Register to vote for non-California resident (should not trigger) - fixtures: - - non_california_resident - steps: - - user: I want to register to vote - - utter: utter_cannot_answer \ No newline at end of file diff --git a/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml b/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml index 19a8a32..9bf4473 100644 --- a/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml +++ b/e2e_tests/passing/invalid_path/check_portfolio_not_found.yml @@ -8,10 +8,10 @@ test_cases: - user: "1234" - utter: utter_authentication_successful - utter: utter_ask_portfolio_type - - user: other + - user: loan - utter: utter_categorical_slot_rejection - utter: utter_ask_portfolio_type - - user: other + - user: loan - utter: utter_categorical_slot_rejection - utter: utter_ask_portfolio_type - user: bonds From 96080654ba0003001ab14f0a8ddd943f50685dbd Mon Sep 17 00:00:00 2001 From: Tanja Bunk Date: Mon, 17 Jun 2024 09:18:14 +0200 Subject: [PATCH 15/15] review comments --- ...heck_portfolio.py => action_check_portfolio_exists.py} | 4 ++-- data/flows/check_portfolio.yml | 2 +- domain/flows/authenticate_user.yml | 8 ++++---- domain/flows/check_portfolio.yml | 2 +- domain/flows/remove_contact.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename actions/{action_check_portfolio.py => action_check_portfolio_exists.py} (88%) diff --git a/actions/action_check_portfolio.py b/actions/action_check_portfolio_exists.py similarity index 88% rename from actions/action_check_portfolio.py rename to actions/action_check_portfolio_exists.py index 47392a6..b992350 100644 --- a/actions/action_check_portfolio.py +++ b/actions/action_check_portfolio_exists.py @@ -5,10 +5,10 @@ from actions.db import get_portfolio_options -class ActionCheckPortfolio(Action): +class ActionCheckPortfolioExists(Action): def name(self) -> str: - return "action_check_portfolio" + return "action_check_portfolio_exists" def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: dict) -> list: diff --git a/data/flows/check_portfolio.yml b/data/flows/check_portfolio.yml index be87749..1575c81 100644 --- a/data/flows/check_portfolio.yml +++ b/data/flows/check_portfolio.yml @@ -5,7 +5,7 @@ flows: - call: authenticate_user - collect: portfolio_type description: "The type of portfolio (e.g., stocks, bonds, mutual funds)." - - action: action_check_portfolio + - action: action_check_portfolio_exists next: - if: slots.portfolio_exists then: show_portfolio diff --git a/domain/flows/authenticate_user.yml b/domain/flows/authenticate_user.yml index 5219570..6f1adcb 100644 --- a/domain/flows/authenticate_user.yml +++ b/domain/flows/authenticate_user.yml @@ -14,13 +14,13 @@ slots: responses: utter_authentication_failed: - - text: "Authentication failed. Please try again." + - text: Authentication failed. Please try again. utter_authentication_successful: - - text: "You have successfully logged in." + - text: You have successfully logged in. utter_ask_user_name: - - text: "Please enter your user name." + - text: Please enter your user name. utter_ask_user_password: - - text: "Please enter your password." + - text: Please enter your password. actions: - action_authenticate_user diff --git a/domain/flows/check_portfolio.yml b/domain/flows/check_portfolio.yml index 36fb8c1..9d48789 100644 --- a/domain/flows/check_portfolio.yml +++ b/domain/flows/check_portfolio.yml @@ -37,5 +37,5 @@ responses: - text: You don't have any {portfolio_type} investments. actions: - - action_check_portfolio + - action_check_portfolio_exists - action_show_portfolio \ No newline at end of file diff --git a/domain/flows/remove_contact.yml b/domain/flows/remove_contact.yml index c381fbb..b371d7e 100644 --- a/domain/flows/remove_contact.yml +++ b/domain/flows/remove_contact.yml @@ -27,14 +27,14 @@ responses: utter_remove_contact_error: - text: Something went wrong, please try again. utter_remove_contact_success: - - text: "Removed {remove_contact_handle}({remove_contact_name}) from your contacts." + - text: Removed {remove_contact_handle}({remove_contact_name}) from your contacts. utter_ask_remove_contact_confirmation: - buttons: - payload: "yes" title: "Yes" - payload: "false" title: "No, cancel the removal" - text: "Should I remove {remove_contact_handle} from your contact list?" + text: Should I remove {remove_contact_handle} from your contact list? utter_remove_contact_cancelled: - text: Okay, I am cancelling this removal of a contact.