rasa-pro 3.13.1a5__py3-none-any.whl → 3.13.1a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/cli/project_templates/finance/actions/action_add_payee.py +47 -0
- rasa/cli/project_templates/finance/actions/action_ask_account.py +50 -0
- rasa/cli/project_templates/finance/actions/action_ask_account_from.py +50 -0
- rasa/cli/project_templates/finance/actions/action_ask_card.py +47 -0
- rasa/cli/project_templates/finance/actions/action_check_balance.py +40 -0
- rasa/cli/project_templates/finance/actions/action_check_card_existence.py +35 -0
- rasa/cli/project_templates/finance/actions/action_check_payee_existence.py +40 -0
- rasa/cli/project_templates/finance/actions/action_check_sufficient_funds.py +41 -0
- rasa/cli/project_templates/finance/actions/action_list_payees.py +45 -0
- rasa/cli/project_templates/finance/actions/action_process_immediate_payment.py +18 -0
- rasa/cli/project_templates/finance/actions/action_remove_payee.py +49 -0
- rasa/cli/project_templates/finance/actions/action_schedule_payment.py +19 -0
- rasa/cli/project_templates/finance/actions/action_session_start.py +69 -0
- rasa/cli/project_templates/finance/actions/action_update_card_status.py +45 -0
- rasa/cli/project_templates/finance/actions/action_validate_payment_date.py +36 -0
- rasa/cli/project_templates/finance/actions/database.py +276 -0
- rasa/cli/project_templates/finance/config.yml +16 -1
- rasa/cli/project_templates/finance/csvs/accounts.csv +8 -0
- rasa/cli/project_templates/finance/csvs/advisors.csv +7 -0
- rasa/cli/project_templates/finance/csvs/appointments.csv +211 -0
- rasa/cli/project_templates/finance/csvs/branches.csv +10 -0
- rasa/cli/project_templates/finance/csvs/cards.csv +11 -0
- rasa/cli/project_templates/finance/csvs/payees.csv +10 -0
- rasa/cli/project_templates/finance/csvs/transactions.csv +71 -0
- rasa/cli/project_templates/finance/csvs/users.csv +4 -0
- rasa/cli/project_templates/finance/data/flows/add_payee.yml +29 -0
- rasa/cli/project_templates/finance/data/flows/block_card.yml +66 -0
- rasa/cli/project_templates/finance/data/flows/check_balance.yml +9 -0
- rasa/cli/project_templates/finance/data/flows/list_payees.yml +5 -0
- rasa/cli/project_templates/finance/data/flows/remove_payee.yml +21 -0
- rasa/cli/project_templates/finance/data/flows/select_card.yml +12 -0
- rasa/cli/project_templates/finance/data/flows/transfer_money.yml +64 -2
- rasa/cli/project_templates/finance/data/flows/welcome.yml +14 -0
- rasa/cli/project_templates/finance/data/nlu.yml +29 -0
- rasa/cli/project_templates/finance/data/patterns/pattern_chitchat.yml +7 -0
- rasa/cli/project_templates/finance/data/patterns/pattern_completed.yml +6 -0
- rasa/cli/project_templates/finance/data/patterns/pattern_search.yml +5 -0
- rasa/cli/project_templates/finance/data/patterns/pattern_session_start.yml +5 -3
- rasa/cli/project_templates/finance/data/source/accounts.json +51 -0
- rasa/cli/project_templates/finance/data/source/advisors.json +44 -0
- rasa/cli/project_templates/finance/data/source/appointments.json +1474 -0
- rasa/cli/project_templates/finance/data/source/branches.json +47 -0
- rasa/cli/project_templates/finance/data/source/cards.json +72 -0
- rasa/cli/project_templates/finance/data/source/payees.json +74 -0
- rasa/cli/project_templates/finance/data/source/transactions.json +492 -0
- rasa/cli/project_templates/finance/data/source/users.json +29 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +7 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +8 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +48 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +47 -0
- rasa/cli/project_templates/finance/domain/add_payee.yml +47 -0
- rasa/cli/project_templates/finance/domain/block_card.yml +101 -0
- rasa/cli/project_templates/finance/domain/check_balance.yml +9 -0
- rasa/cli/project_templates/finance/domain/default_actions.yml +16 -0
- rasa/cli/project_templates/finance/domain/default_flows.yml +33 -0
- rasa/cli/project_templates/finance/domain/list_payees.yml +4 -0
- rasa/cli/project_templates/finance/domain/remove_payee.yml +16 -0
- rasa/cli/project_templates/finance/domain/select_card.yml +12 -0
- rasa/cli/project_templates/finance/domain/transfer_money.yml +79 -0
- rasa/cli/project_templates/finance/endpoints.yml +6 -2
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +19 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/cancellations.yml +12 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/cannot_handle.yml +7 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/chitchat.yml +7 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/clarification.yml +9 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/completion.yml +18 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/corrections.yml +17 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/digressions.yml +32 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/human_handoff.yml +21 -0
- rasa/cli/project_templates/finance/tests/conversation_repair/skipping_collect_steps.yml +16 -0
- rasa/cli/project_templates/finance/tests/demo_scripts/main.yml +16 -0
- rasa/cli/project_templates/finance/tests/happy_paths/balance_verification.yml +15 -0
- rasa/cli/project_templates/finance/tests/happy_paths/banking_questions.yml +12 -0
- rasa/cli/project_templates/finance/tests/happy_paths/card_blocking.yml +52 -0
- rasa/cli/project_templates/finance/tests/happy_paths/money_transfer.yml +136 -0
- rasa/cli/project_templates/finance/tests/happy_paths/payee_management.yml +27 -0
- rasa/cli/project_templates/finance/tests/happy_paths/user_greeted.yml +5 -0
- rasa/cli/project_templates/plain/domain.yml +1 -1
- rasa/cli/project_templates/telco/actions/actions_billing.py +196 -0
- rasa/cli/project_templates/telco/actions/actions_get_data_from_db.py +42 -0
- rasa/cli/project_templates/telco/prompts/command-generator.jinja2 +57 -0
- rasa/cli/scaffold.py +1 -1
- rasa/core/policies/enterprise_search_policy.py +1 -1
- rasa/dialogue_understanding/generator/flow_retrieval.py +10 -9
- rasa/version.py +1 -1
- {rasa_pro-3.13.1a5.dist-info → rasa_pro-3.13.1a7.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.1a5.dist-info → rasa_pro-3.13.1a7.dist-info}/RECORD +201 -51
- rasa/cli/project_templates/finance/domain.yml +0 -7
- rasa/cli/project_templates/teleco/actions/actions_billing.py +0 -151
- rasa/cli/project_templates/teleco/actions/actions_get_data_from_db.py +0 -27
- /rasa/cli/project_templates/{teleco → finance}/prompts/command-generator.jinja2 +0 -0
- /rasa/cli/project_templates/{teleco → telco}/actions/actions_run_diagnostics.py +0 -0
- /rasa/cli/project_templates/{teleco → telco}/actions/actions_session_start.py +0 -0
- /rasa/cli/project_templates/{teleco → telco}/config.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/credentials.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/csvs/billing.csv +0 -0
- /rasa/cli/project_templates/{teleco → telco}/csvs/customers.csv +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/flows/flow_global.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/flows/flow_reboot_router.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/flows/flow_reset_router.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/flows/flow_solve_internet_issue.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/flows/flow_undertand_bill.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/patterns/pattern_completed.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/patterns/pattern_human_handoff.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/patterns/pattern_search.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/data/patterns/pattern_session_start.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/docs/reset_vs_rboot_router.txt +0 -0
- /rasa/cli/project_templates/{teleco → telco}/docs/restart_router.txt +0 -0
- /rasa/cli/project_templates/{teleco → telco}/docs/run_speed_test.txt +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_global.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_patterns.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_reboot_router.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_reset_router.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_run_speed_test.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_solve_internet_issue.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/domain/domain_undertand_bill.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/endpoints.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_results_failed.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_results_passed.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_test_cases/billing_test_cases.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_test_cases/global_test_cases.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_test_cases/internet_slow_test_case.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_test_cases/out_of_scope_test_case.yml +0 -0
- /rasa/cli/project_templates/{teleco → telco}/tests/e2e_test_cases/patterns_test_cases.yml +0 -0
- {rasa_pro-3.13.1a5.dist-info → rasa_pro-3.13.1a7.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.1a5.dist-info → rasa_pro-3.13.1a7.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.1a5.dist-info → rasa_pro-3.13.1a7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: conversation_repair_human_handoff
|
|
3
|
+
steps:
|
|
4
|
+
- user: "hello"
|
|
5
|
+
- utter: utter_chitchat
|
|
6
|
+
- user: "i want to transfer 999 from savings"
|
|
7
|
+
- utter: utter_transfer_money_understand
|
|
8
|
+
- utter: utter_ask_payee_name
|
|
9
|
+
- user: "who are my payees"
|
|
10
|
+
- bot: "You are authorised to transfer money to: Amy, Fitness Gym and William"
|
|
11
|
+
- utter: utter_flow_continue_interrupted
|
|
12
|
+
- utter: utter_ask_payee_name
|
|
13
|
+
- user: "Amy"
|
|
14
|
+
- utter: utter_ask_timing
|
|
15
|
+
- user: "/SetSlots(timing=now)"
|
|
16
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
17
|
+
- user: "I want to talk to a human"
|
|
18
|
+
- utter: utter_human_handoff_not_available
|
|
19
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
20
|
+
- user: "no"
|
|
21
|
+
- utter: utter_cancel_transfer
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: conversation_repair_skipping_collect_step
|
|
3
|
+
steps:
|
|
4
|
+
- user: "I want to transfer 55 to Amy from savings right now"
|
|
5
|
+
- utter: utter_transfer_money_understand
|
|
6
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
7
|
+
- user: "sorry, I meant 65"
|
|
8
|
+
- utter: utter_corrected_previous_input
|
|
9
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
10
|
+
- user: "sorry, I meant in the future"
|
|
11
|
+
- utter: utter_corrected_previous_input
|
|
12
|
+
- utter: utter_ask_payment_date
|
|
13
|
+
- user: "12/12/2025"
|
|
14
|
+
- utter: utter_ask_confirm_future_payment
|
|
15
|
+
- user: "yes"
|
|
16
|
+
- utter: utter_payment_scheduled
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: A simple test scripts used in standard demos for Starterpack - Financial Services (en)
|
|
3
|
+
steps:
|
|
4
|
+
- user: "I want to transfer money"
|
|
5
|
+
- utter: utter_transfer_money_understand
|
|
6
|
+
- bot: "Which account would you like to transfer money from?"
|
|
7
|
+
- user: "56789012"
|
|
8
|
+
- utter: utter_ask_payee_name
|
|
9
|
+
- user: "Susan"
|
|
10
|
+
- utter: utter_ask_amount
|
|
11
|
+
- user: "55.10"
|
|
12
|
+
- utter: utter_ask_timing
|
|
13
|
+
- user: "/SetSlots(timing=now)"
|
|
14
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
15
|
+
- user: "Yes"
|
|
16
|
+
- utter: utter_transfer_successful
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: various_tests_for_account_balance
|
|
3
|
+
steps:
|
|
4
|
+
- user: "I want to view my account balance"
|
|
5
|
+
- bot: "Which account would you like the balance for?"
|
|
6
|
+
- user: "12345678"
|
|
7
|
+
- bot: "The balance is: $10123.45"
|
|
8
|
+
- user: "I want to query the balance of my acccounts"
|
|
9
|
+
- bot: "Which account would you like the balance for?"
|
|
10
|
+
- user: "12345678"
|
|
11
|
+
- bot: "The balance is: $10123.45"
|
|
12
|
+
- user: "I want to know the balance of one of my accounts"
|
|
13
|
+
- bot: "Which account would you like the balance for?"
|
|
14
|
+
- user: "23456789"
|
|
15
|
+
- bot: "The balance is: $4923.67"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: banking_questions - Happy paths no 1
|
|
3
|
+
steps:
|
|
4
|
+
- user: "Are there any fees to transfer money to my friends?"
|
|
5
|
+
- bot: "Yes, there may be fees associated with transferring money, especially for international transfers. To avoid fees, consider using bank-to-bank transfers within the UK whenever possible. You will be notified of any applicable fees before confirming the transfer."
|
|
6
|
+
|
|
7
|
+
- test_case: banking_questions - Happy paths no 2
|
|
8
|
+
steps:
|
|
9
|
+
- user: "I have a question on prepaid card"
|
|
10
|
+
- utter: utter_help
|
|
11
|
+
- user: "are there fees to transfer from or to prepaid cards"
|
|
12
|
+
- bot: "Yes, there may be fees associated with transferring funds to or from prepaid cards. It is advisable to check your account details for specific charges related to these transactions."
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: card_blocking - Happy paths no1
|
|
3
|
+
steps:
|
|
4
|
+
- user: "I want to block my card"
|
|
5
|
+
- utter: utter_block_card_understand
|
|
6
|
+
- bot: "Select the card you require assistance with:"
|
|
7
|
+
- user: "Wait, Wait, what will happen to my pre-authorized payments"
|
|
8
|
+
- bot: "When you block your card, any recurring payments linked to it will be interrupted until you update them with a new card number. You can request the merchants to cancel the hold on your pre-authorized payments if it is no longer necessary."
|
|
9
|
+
- bot: "Select the card you require assistance with:"
|
|
10
|
+
- user: "SetSlots(card_selection=3456789034567890)"
|
|
11
|
+
- utter: utter_ask_reason_for_blocking
|
|
12
|
+
- user: "/SetSlots(reason_for_blocking=lost)"
|
|
13
|
+
- utter: utter_acknowledge_reason_fraud_stolen_lost
|
|
14
|
+
- utter: utter_card_blocked
|
|
15
|
+
- utter: utter_ask_confirm_issue_new_card
|
|
16
|
+
- user: "/SetSlots(confirm_issue_new_card=true)"
|
|
17
|
+
- utter: utter_ask_address_confirmed
|
|
18
|
+
- user: "/SetSlots(address_confirmed=True)"
|
|
19
|
+
- utter: utter_confirm_physical_address
|
|
20
|
+
|
|
21
|
+
- test_case: card_blocking - Happy paths no2
|
|
22
|
+
steps:
|
|
23
|
+
- user: "I think I that I have lost my card"
|
|
24
|
+
- utter: utter_block_card_understand
|
|
25
|
+
- bot: "Select the card you require assistance with:"
|
|
26
|
+
- user: "SetSlots(card_selection=5555666677778888)"
|
|
27
|
+
- utter: utter_acknowledge_reason_fraud_stolen_lost
|
|
28
|
+
- utter: utter_card_blocked
|
|
29
|
+
- utter: utter_ask_confirm_issue_new_card
|
|
30
|
+
- user: "/SetSlots(confirm_issue_new_card=false)"
|
|
31
|
+
|
|
32
|
+
- test_case: card_blocking - Happy paths no3
|
|
33
|
+
steps:
|
|
34
|
+
- user: "I think I have lost my card"
|
|
35
|
+
- utter: utter_block_card_understand
|
|
36
|
+
- bot: "Select the card you require assistance with:"
|
|
37
|
+
- user: "SetSlots(card_selection=1111222233334444)"
|
|
38
|
+
- utter: utter_acknowledge_reason_fraud_stolen_lost
|
|
39
|
+
- utter: utter_card_blocked
|
|
40
|
+
- utter: utter_ask_confirm_issue_new_card
|
|
41
|
+
- user: "sorry, i selected the wrong card"
|
|
42
|
+
- utter: utter_corrected_previous_input
|
|
43
|
+
- bot: "Select the card you require assistance with:"
|
|
44
|
+
- user: "the second debit card"
|
|
45
|
+
- utter: utter_corrected_previous_input
|
|
46
|
+
- utter: utter_acknowledge_reason_fraud_stolen_lost
|
|
47
|
+
- utter: utter_card_blocked
|
|
48
|
+
- utter: utter_ask_confirm_issue_new_card
|
|
49
|
+
- user: "/SetSlots(confirm_issue_new_card=true)"
|
|
50
|
+
- utter: utter_ask_address_confirmed
|
|
51
|
+
- user: "yes"
|
|
52
|
+
- utter: utter_confirm_physical_address
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: Money Transfer - Happy paths no1
|
|
3
|
+
steps:
|
|
4
|
+
- user: "I want to transfer money"
|
|
5
|
+
- utter: utter_transfer_money_understand
|
|
6
|
+
- bot: "Which account would you like to transfer money from?"
|
|
7
|
+
- user: "12345678"
|
|
8
|
+
- utter: utter_ask_payee_name
|
|
9
|
+
- user: "Robert"
|
|
10
|
+
- utter: utter_ask_amount
|
|
11
|
+
- user: "55"
|
|
12
|
+
- utter: utter_ask_timing
|
|
13
|
+
- user: "immediate"
|
|
14
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
15
|
+
- user: "Yes"
|
|
16
|
+
- utter: utter_transfer_successful
|
|
17
|
+
|
|
18
|
+
- test_case: Money Transfer - Happy paths no2
|
|
19
|
+
steps:
|
|
20
|
+
- user: "I want to transfer $55.55 to Amy from checking"
|
|
21
|
+
- utter: utter_transfer_money_understand
|
|
22
|
+
- utter: utter_ask_timing
|
|
23
|
+
- user: "/SetSlots(timing=now)"
|
|
24
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
25
|
+
- user: "yes"
|
|
26
|
+
- utter: utter_transfer_successful
|
|
27
|
+
|
|
28
|
+
- test_case: Money Transfer - Happy paths no3
|
|
29
|
+
steps:
|
|
30
|
+
- user: "I want to transfer $55.55 to Amy"
|
|
31
|
+
- utter: utter_transfer_money_understand
|
|
32
|
+
- bot: "Which account would you like to transfer money from?"
|
|
33
|
+
- user: "78901234"
|
|
34
|
+
- utter: utter_ask_timing
|
|
35
|
+
- user: "/SetSlots(timing=now)"
|
|
36
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
37
|
+
- user: "yes"
|
|
38
|
+
- utter: utter_transfer_successful
|
|
39
|
+
|
|
40
|
+
- test_case: Money Transfer - Happy paths no4
|
|
41
|
+
steps:
|
|
42
|
+
- user: "I would like to transfer $55.55 to Amy"
|
|
43
|
+
- utter: utter_transfer_money_understand
|
|
44
|
+
- bot: "Which account would you like to transfer money from?"
|
|
45
|
+
- user: "78901234"
|
|
46
|
+
- utter: utter_ask_timing
|
|
47
|
+
- user: "/SetSlots(timing=future)"
|
|
48
|
+
- utter: utter_ask_payment_date
|
|
49
|
+
- user: "12-12-2025"
|
|
50
|
+
- utter: utter_ask_confirm_future_payment
|
|
51
|
+
- user: "yes"
|
|
52
|
+
- utter: utter_payment_scheduled
|
|
53
|
+
|
|
54
|
+
- test_case: Money Transfer - Happy paths no5
|
|
55
|
+
steps:
|
|
56
|
+
- user: "I want to transfer $55.55 to Amy from checking"
|
|
57
|
+
- utter: utter_transfer_money_understand
|
|
58
|
+
- utter: utter_ask_timing
|
|
59
|
+
- user: "/SetSlots(timing=now)"
|
|
60
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
61
|
+
- user: "yes"
|
|
62
|
+
- utter: utter_transfer_successful
|
|
63
|
+
|
|
64
|
+
- test_case: Money Transfer - Happy paths no6
|
|
65
|
+
steps:
|
|
66
|
+
- user: "I want to transfer 55.55$ to Amy"
|
|
67
|
+
- utter: utter_transfer_money_understand
|
|
68
|
+
- bot: "Which account would you like to transfer money from?"
|
|
69
|
+
- user: "67890123"
|
|
70
|
+
- utter: utter_ask_timing
|
|
71
|
+
- user: "immediate"
|
|
72
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
73
|
+
- user: "yes"
|
|
74
|
+
- utter: utter_transfer_successful
|
|
75
|
+
|
|
76
|
+
- test_case: Money Transfer - Happy paths no7
|
|
77
|
+
steps:
|
|
78
|
+
- user: "I want to transfer $55.55 to Amy from checking right now"
|
|
79
|
+
- utter: utter_transfer_money_understand
|
|
80
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
81
|
+
- user: "yes"
|
|
82
|
+
- utter: utter_transfer_successful
|
|
83
|
+
|
|
84
|
+
- test_case: Money Transfer - Happy paths no8
|
|
85
|
+
steps:
|
|
86
|
+
- user: "I want to transfer 100.24$ from my savings to Amy right now"
|
|
87
|
+
- utter: utter_transfer_money_understand
|
|
88
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
89
|
+
- user: "yes"
|
|
90
|
+
- utter: utter_transfer_successful
|
|
91
|
+
|
|
92
|
+
- test_case: Money Transfer - Happy paths no9
|
|
93
|
+
steps:
|
|
94
|
+
- user: "I want to transfer money"
|
|
95
|
+
- utter: utter_transfer_money_understand
|
|
96
|
+
- bot: "Which account would you like to transfer money from?"
|
|
97
|
+
- user: "who are my payees"
|
|
98
|
+
- bot: "You are authorised to transfer money to: Robert, James and Food Market"
|
|
99
|
+
- utter: utter_flow_continue_interrupted
|
|
100
|
+
- bot: "Which account would you like to transfer money from?"
|
|
101
|
+
- user: "I would like to add Timmy as a payee"
|
|
102
|
+
- utter: utter_ask_account_number
|
|
103
|
+
- user: "56567"
|
|
104
|
+
- utter: utter_ask_payee_type
|
|
105
|
+
- user: "/SetSlots(payee_type=person)"
|
|
106
|
+
- utter: utter_ask_reference
|
|
107
|
+
- user: "Facebook Marketplace"
|
|
108
|
+
- utter: utter_ask_confirm_payee_details
|
|
109
|
+
- user: "/SetSlots(confirm_payee_details=True)"
|
|
110
|
+
- utter: utter_payee_added_success
|
|
111
|
+
- utter: utter_flow_continue_interrupted
|
|
112
|
+
- bot: "Which account would you like to transfer money from?"
|
|
113
|
+
- user: "12345678"
|
|
114
|
+
- utter: utter_ask_amount
|
|
115
|
+
- user: "$40.67"
|
|
116
|
+
- utter: utter_ask_timing
|
|
117
|
+
- user: "/SetSlots(timing=now)"
|
|
118
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
119
|
+
- user: "yup"
|
|
120
|
+
- utter: utter_transfer_successful
|
|
121
|
+
|
|
122
|
+
- test_case: Money Transfer - Happy paths no10
|
|
123
|
+
steps:
|
|
124
|
+
- user: "I want to transfer 55 to Amy from savings right now"
|
|
125
|
+
- utter: utter_transfer_money_understand
|
|
126
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
127
|
+
- user: "sorry I meant 65"
|
|
128
|
+
- utter: utter_corrected_previous_input
|
|
129
|
+
- utter: utter_ask_confirm_immediate_payment
|
|
130
|
+
- user: "sorry I meant in the future"
|
|
131
|
+
- utter: utter_corrected_previous_input
|
|
132
|
+
- utter: utter_ask_payment_date
|
|
133
|
+
- user: "12/12/2025"
|
|
134
|
+
- utter: utter_ask_confirm_future_payment
|
|
135
|
+
- user: "Yes"
|
|
136
|
+
- utter: utter_payment_scheduled
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
test_cases:
|
|
2
|
+
- test_case: payee_management - Happy paths no1
|
|
3
|
+
steps:
|
|
4
|
+
- user: "who are my payees"
|
|
5
|
+
- bot: "You are authorised to transfer money to: Robert, James and Food Market"
|
|
6
|
+
|
|
7
|
+
- test_case: payee_management - Happy paths no2
|
|
8
|
+
steps:
|
|
9
|
+
- user: "I want to add a payee"
|
|
10
|
+
- utter: utter_ask_payee_name
|
|
11
|
+
- user: "Sonia Smith"
|
|
12
|
+
- utter: utter_ask_account_number
|
|
13
|
+
- user: "123456"
|
|
14
|
+
- utter: utter_ask_payee_type
|
|
15
|
+
- user: "person"
|
|
16
|
+
- utter: utter_ask_reference
|
|
17
|
+
- user: "Facebook Marketplace"
|
|
18
|
+
- utter: utter_ask_confirm_payee_details
|
|
19
|
+
- user: "/SetSlots(confirm_payee_details=True)"
|
|
20
|
+
- utter: utter_payee_added_success
|
|
21
|
+
|
|
22
|
+
- test_case: payee_management - Happy paths no3
|
|
23
|
+
steps:
|
|
24
|
+
- user: "who are my payees"
|
|
25
|
+
- bot: "You are authorised to transfer money to: Robert, James and Food Market"
|
|
26
|
+
- user: "I want to remove a payee"
|
|
27
|
+
- utter: utter_ask_rephrase
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import csv
|
|
2
|
+
import logging
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from rasa_sdk import Action
|
|
6
|
+
from rasa_sdk.events import SlotSet
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ActionVerifyBillByDate(Action):
|
|
10
|
+
def name(self):
|
|
11
|
+
return "action_verify_bill_by_date"
|
|
12
|
+
|
|
13
|
+
def text_to_date(month_text):
|
|
14
|
+
try:
|
|
15
|
+
# Get the current year
|
|
16
|
+
current_year = datetime.now().year
|
|
17
|
+
|
|
18
|
+
# Combine user input with the current year
|
|
19
|
+
full_text = f"{month_text} {current_year}"
|
|
20
|
+
|
|
21
|
+
# Parse the text format (e.g., "March 2025")
|
|
22
|
+
date_obj = datetime.strptime(full_text, "%B %Y")
|
|
23
|
+
|
|
24
|
+
# Format as DD/MM/YYYY (defaults to the first day of the month)
|
|
25
|
+
formatted_date = date_obj.strftime("01/%m/%Y")
|
|
26
|
+
logging.info(f"This is an info message: formatted_date: {formatted_date}")
|
|
27
|
+
return formatted_date
|
|
28
|
+
except ValueError:
|
|
29
|
+
return "Invalid format. Please use a full month name (e.g., 'March')."
|
|
30
|
+
|
|
31
|
+
def run(self, dispatcher, tracker, domain):
|
|
32
|
+
# Get customer ID and date from slots
|
|
33
|
+
customer_id = tracker.get_slot("customer_id")
|
|
34
|
+
bill_month = tracker.get_slot("bill_month")
|
|
35
|
+
|
|
36
|
+
bill_date = ActionVerifyBillByDate.text_to_date(bill_month)
|
|
37
|
+
|
|
38
|
+
if not customer_id:
|
|
39
|
+
dispatcher.utter_message(
|
|
40
|
+
"I couldn't find your customer ID. Please provide it."
|
|
41
|
+
)
|
|
42
|
+
return []
|
|
43
|
+
|
|
44
|
+
if not bill_date:
|
|
45
|
+
dispatcher.utter_message(
|
|
46
|
+
"Please specify the date for the bill you want to check."
|
|
47
|
+
)
|
|
48
|
+
return []
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
# Load CSV file with billing data
|
|
52
|
+
with open("csvs/billing.csv", "r", newline="") as csvfile:
|
|
53
|
+
reader = csv.DictReader(csvfile)
|
|
54
|
+
|
|
55
|
+
# Convert bill_date to datetime for comparison
|
|
56
|
+
bill_date_obj = datetime.strptime(bill_date, "%d/%m/%Y")
|
|
57
|
+
|
|
58
|
+
# Filter data for the given customer and date
|
|
59
|
+
customer_bills = []
|
|
60
|
+
specific_bill = None
|
|
61
|
+
|
|
62
|
+
for row in reader:
|
|
63
|
+
if row["customer_id"] == str(customer_id):
|
|
64
|
+
# Parse the date from CSV
|
|
65
|
+
row_date = datetime.strptime(row["date"], "%Y-%m-%d")
|
|
66
|
+
row["amount"] = float(row["amount"])
|
|
67
|
+
customer_bills.append(row)
|
|
68
|
+
|
|
69
|
+
# Check if this is the specific bill we're looking for
|
|
70
|
+
if row_date.date() == bill_date_obj.date():
|
|
71
|
+
specific_bill = row
|
|
72
|
+
|
|
73
|
+
if specific_bill is None:
|
|
74
|
+
dispatcher.utter_message(
|
|
75
|
+
f"No bill found for {bill_date_obj.date()}."
|
|
76
|
+
)
|
|
77
|
+
return []
|
|
78
|
+
|
|
79
|
+
bill_amount = specific_bill["amount"]
|
|
80
|
+
|
|
81
|
+
# Calculate average
|
|
82
|
+
if customer_bills:
|
|
83
|
+
average_bill = sum(bill["amount"] for bill in customer_bills) / len(
|
|
84
|
+
customer_bills
|
|
85
|
+
)
|
|
86
|
+
else:
|
|
87
|
+
average_bill = 0
|
|
88
|
+
|
|
89
|
+
difference = bill_amount - average_bill
|
|
90
|
+
|
|
91
|
+
# Generate response
|
|
92
|
+
response = (
|
|
93
|
+
f"Your bill for {bill_month} {bill_date_obj.date().year} is "
|
|
94
|
+
f"${bill_amount:.2f}. \n"
|
|
95
|
+
f"The average of your past bills is ${average_bill:.2f}. \n"
|
|
96
|
+
f"This bill is {'higher' if difference > 0 else 'lower'} than "
|
|
97
|
+
f"your average by ${abs(difference):.2f}."
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
dispatcher.utter_message(response)
|
|
101
|
+
return [
|
|
102
|
+
SlotSet("bill_amount", int(bill_amount)),
|
|
103
|
+
SlotSet("average_bill", int(average_bill)),
|
|
104
|
+
SlotSet("difference", int(difference)),
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
except FileNotFoundError:
|
|
108
|
+
dispatcher.utter_message("Billing data file not found.")
|
|
109
|
+
return []
|
|
110
|
+
except Exception:
|
|
111
|
+
dispatcher.utter_message("Error retrieving billing information.")
|
|
112
|
+
return []
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class ActionRecapBill(Action):
|
|
116
|
+
def name(self):
|
|
117
|
+
return "action_recap_bill"
|
|
118
|
+
|
|
119
|
+
def run(self, dispatcher, tracker, domain):
|
|
120
|
+
# Get customer_id and bill_date from slots
|
|
121
|
+
customer_id = tracker.get_slot("customer_id")
|
|
122
|
+
bill_month = tracker.get_slot("bill_month")
|
|
123
|
+
|
|
124
|
+
bill_date = ActionVerifyBillByDate.text_to_date(bill_month)
|
|
125
|
+
|
|
126
|
+
if not customer_id:
|
|
127
|
+
dispatcher.utter_message(
|
|
128
|
+
"I need your customer ID to fetch your bill recap."
|
|
129
|
+
)
|
|
130
|
+
return []
|
|
131
|
+
|
|
132
|
+
if not bill_date:
|
|
133
|
+
dispatcher.utter_message(
|
|
134
|
+
"I need a date to fetch your bill recap. Can you provide one?"
|
|
135
|
+
)
|
|
136
|
+
return []
|
|
137
|
+
|
|
138
|
+
# Convert customer_id to int if needed
|
|
139
|
+
try:
|
|
140
|
+
customer_id = int(customer_id)
|
|
141
|
+
except ValueError:
|
|
142
|
+
dispatcher.utter_message("Invalid customer ID format.")
|
|
143
|
+
return []
|
|
144
|
+
|
|
145
|
+
try:
|
|
146
|
+
# Load CSV file
|
|
147
|
+
with open("csvs/billing.csv", "r", newline="") as csvfile:
|
|
148
|
+
reader = csv.DictReader(csvfile)
|
|
149
|
+
|
|
150
|
+
bill_date_obj = datetime.strptime(bill_date, "%d/%m/%Y")
|
|
151
|
+
|
|
152
|
+
# Filter records for the given customer_id
|
|
153
|
+
filtered_records = []
|
|
154
|
+
for row in reader:
|
|
155
|
+
if row["customer_id"] == str(customer_id):
|
|
156
|
+
# Parse date and add to filtered records
|
|
157
|
+
row_date = datetime.strptime(row["date"], "%Y-%m-%d")
|
|
158
|
+
filtered_records.append(
|
|
159
|
+
{
|
|
160
|
+
"date": row_date,
|
|
161
|
+
"amount": float(row["amount"]),
|
|
162
|
+
"source": row["source"],
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
if not filtered_records:
|
|
167
|
+
dispatcher.utter_message(
|
|
168
|
+
f"No transactions found for customer {customer_id} on "
|
|
169
|
+
f"{bill_date_obj.date().strftime('%B %Y')}."
|
|
170
|
+
)
|
|
171
|
+
return []
|
|
172
|
+
|
|
173
|
+
# Format the output
|
|
174
|
+
response1 = "Here is a summary of your costs :"
|
|
175
|
+
dispatcher.utter_message(response1)
|
|
176
|
+
response = "\n".join(
|
|
177
|
+
[
|
|
178
|
+
(
|
|
179
|
+
f"{record['date'].date()} | {record['amount']} $ "
|
|
180
|
+
f"| {record['source']}"
|
|
181
|
+
)
|
|
182
|
+
for record in filtered_records
|
|
183
|
+
]
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# Send response to user
|
|
187
|
+
dispatcher.utter_message(response)
|
|
188
|
+
print("response heeere", response)
|
|
189
|
+
return []
|
|
190
|
+
|
|
191
|
+
except FileNotFoundError:
|
|
192
|
+
dispatcher.utter_message("Billing data file not found.")
|
|
193
|
+
return []
|
|
194
|
+
except Exception:
|
|
195
|
+
dispatcher.utter_message("Error retrieving billing information.")
|
|
196
|
+
return []
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import csv
|
|
2
|
+
|
|
3
|
+
from rasa_sdk import Action
|
|
4
|
+
from rasa_sdk.events import SlotSet
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ActionGetCustomerInfo(Action):
|
|
8
|
+
def name(self):
|
|
9
|
+
return "action_get_customer_info"
|
|
10
|
+
|
|
11
|
+
def run(self, dispatcher, tracker, domain):
|
|
12
|
+
# Load CSV file
|
|
13
|
+
file_path = "csvs/customers.csv" # get information from your DBs
|
|
14
|
+
customer_id = tracker.get_slot("customer_id")
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
with open(file_path, "r", newline="") as csvfile:
|
|
18
|
+
reader = csv.DictReader(csvfile)
|
|
19
|
+
|
|
20
|
+
# Filter data for the given customer ID
|
|
21
|
+
customer_info = None
|
|
22
|
+
for row in reader:
|
|
23
|
+
if row["customer_id"] == str(customer_id):
|
|
24
|
+
customer_info = row
|
|
25
|
+
break
|
|
26
|
+
|
|
27
|
+
if customer_info is None:
|
|
28
|
+
dispatcher.utter_message("No customer found with this ID.")
|
|
29
|
+
return []
|
|
30
|
+
|
|
31
|
+
# Extract customer details
|
|
32
|
+
first_name = customer_info["first_name"]
|
|
33
|
+
|
|
34
|
+
# Set the retrieved name in a slot
|
|
35
|
+
return [SlotSet("customer_first_name", first_name)]
|
|
36
|
+
|
|
37
|
+
except FileNotFoundError:
|
|
38
|
+
dispatcher.utter_message("Customer database file not found.")
|
|
39
|
+
return []
|
|
40
|
+
except Exception:
|
|
41
|
+
dispatcher.utter_message("Error retrieving customer information.")
|
|
42
|
+
return []
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
## Task Description
|
|
2
|
+
Your task is to analyze the current conversation context and generate a list of actions to start new business processes that we call flows, to extract slots, or respond to small talk and knowledge requests.
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Available Flows and Slots
|
|
7
|
+
Use the following structured data:
|
|
8
|
+
```json
|
|
9
|
+
{"flows":[{% for flow in available_flows %}{"name":"{{ flow.name }}","description":"{{ flow.description }}"{% if flow.slots %},"slots":[{% for slot in flow.slots %}{"name":"{{ slot.name }}"{% if slot.description %},"description":"{{ slot.description }}"{% endif %}{% if slot.allowed_values %},"allowed_values":{{ slot.allowed_values }}{% endif %}}{% if not loop.last %},{% endif %}{% endfor %}]{% endif %}}{% if not loop.last %},{% endif %}{% endfor %}]}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Available Actions:
|
|
15
|
+
* `start flow flow_name`: Starting a flow. For example, `start flow transfer_money` or `start flow list_contacts`.
|
|
16
|
+
* `set slot slot_name slot_value`: Slot setting. For example, `set slot transfer_money_recipient Freddy`. Can be used to correct and change previously set values.
|
|
17
|
+
* `cancel flow`: Cancelling the current flow.
|
|
18
|
+
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: Disambiguate which flow should be started when user input is ambiguous by listing the potential flows as options. For example, `disambiguate flows list_contacts add_contact remove_contact ...` if the user just wrote "contacts".
|
|
19
|
+
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services.
|
|
20
|
+
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
21
|
+
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## General Tips
|
|
26
|
+
* Do not fill slots with abstract values or placeholders.
|
|
27
|
+
* For categorical slots try to match the user message with allowed slot values. Use "other" if you cannot match it.
|
|
28
|
+
* Set the boolean slots based on the user response. Map positive responses to `True`, and negative to `False`.
|
|
29
|
+
* Extract text slot values exactly as provided by the user. Avoid assumptions, format changes, or partial extractions.
|
|
30
|
+
* Only use information provided by the user.
|
|
31
|
+
* Use clarification in ambiguous cases.
|
|
32
|
+
* Multiple flows can be started. If a user wants to digress into a second flow, you do not need to cancel the current flow.
|
|
33
|
+
* Do not cancel the flow unless the user explicitly requests it.
|
|
34
|
+
* Strictly adhere to the provided action format.
|
|
35
|
+
* Focus on the last message and take it one step at a time.
|
|
36
|
+
* Use the previous conversation steps only to aid understanding.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Current State
|
|
41
|
+
{% if current_flow != None %}Use the following structured data:
|
|
42
|
+
```json
|
|
43
|
+
{"active_flow":"{{ current_flow }}","current_step":{"requested_slot":"{{ current_slot }}","requested_slot_description":"{{ current_slot_description }}"},"slots":[{% for slot in flow_slots %}{"name":"{{ slot.name }}","value":"{{ slot.value }}","type":"{{ slot.type }}"{% if slot.description %},"description":"{{ slot.description }}"{% endif %}{% if slot.allowed_values %},"allowed_values":"{{ slot.allowed_values }}"{% endif %}}{% if not loop.last %},{% endif %}{% endfor %}]}
|
|
44
|
+
```{% else %}
|
|
45
|
+
You are currently not inside any flow.{% endif %}
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Conversation History
|
|
50
|
+
{{ current_conversation }}
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Task
|
|
55
|
+
Create an action list with one action per line in response to the user's last message: """{{ user_message }}""".
|
|
56
|
+
|
|
57
|
+
Your action list:
|
rasa/cli/scaffold.py
CHANGED
|
@@ -794,7 +794,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
|
|
|
794
794
|
)
|
|
795
795
|
print_error_and_exit(error_message)
|
|
796
796
|
|
|
797
|
-
docs = glob.glob(os.path.join(docs_folder, "
|
|
797
|
+
docs = glob.glob(os.path.join(docs_folder, "**/*.txt"), recursive=True)
|
|
798
798
|
if not docs or len(docs) < 1:
|
|
799
799
|
error_message = (
|
|
800
800
|
f"Document source directory is empty: '{docs_folder}'. "
|
|
@@ -219,11 +219,6 @@ class FlowRetrieval(EmbeddingsHealthCheckMixin):
|
|
|
219
219
|
if self.vector_store is not None:
|
|
220
220
|
with self._model_storage.write_to(self._resource) as model_path:
|
|
221
221
|
self.vector_store.save_local(model_path)
|
|
222
|
-
else:
|
|
223
|
-
structlogger.warning(
|
|
224
|
-
"flow_retrieval.persist_vector_store.not_initialized",
|
|
225
|
-
event_info="Vector store is None, not persisted.",
|
|
226
|
-
)
|
|
227
222
|
|
|
228
223
|
def _persist_config(self) -> None:
|
|
229
224
|
with self._model_storage.write_to(self._resource) as path:
|
|
@@ -249,6 +244,16 @@ class FlowRetrieval(EmbeddingsHealthCheckMixin):
|
|
|
249
244
|
)
|
|
250
245
|
|
|
251
246
|
flows_to_embedd = flows.exclude_link_only_flows()
|
|
247
|
+
|
|
248
|
+
if not flows_to_embedd:
|
|
249
|
+
structlogger.debug(
|
|
250
|
+
"flow_retrieval.populate_vector_store.no_flows_to_embed",
|
|
251
|
+
event_info=(
|
|
252
|
+
"No flows to embed in the vector store, skipping population."
|
|
253
|
+
),
|
|
254
|
+
)
|
|
255
|
+
return
|
|
256
|
+
|
|
252
257
|
embeddings = self._create_embedder(self.config)
|
|
253
258
|
documents = self._generate_flow_documents(flows_to_embedd, domain)
|
|
254
259
|
try:
|
|
@@ -420,10 +425,6 @@ class FlowRetrieval(EmbeddingsHealthCheckMixin):
|
|
|
420
425
|
The top k documents with similarity scores.
|
|
421
426
|
"""
|
|
422
427
|
if self.vector_store is None:
|
|
423
|
-
structlogger.error(
|
|
424
|
-
"flow_retrieval.query_vector_store.vector_store_not_configured",
|
|
425
|
-
event_info="Vector store is not configured",
|
|
426
|
-
)
|
|
427
428
|
return []
|
|
428
429
|
try:
|
|
429
430
|
documents_with_scores = (
|