rasa-pro 3.14.0.dev20250825__py3-none-any.whl → 3.14.0.dev20250901__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/builder/README.md +120 -0
- rasa/builder/__init__.py +0 -0
- rasa/builder/auth.py +176 -0
- rasa/builder/config.py +91 -0
- rasa/builder/copilot/__init__.py +0 -0
- rasa/builder/copilot/constants.py +28 -0
- rasa/builder/copilot/copilot.py +376 -0
- rasa/builder/copilot/copilot_response_handler.py +522 -0
- rasa/builder/copilot/copilot_templated_message_provider.py +58 -0
- rasa/builder/copilot/exceptions.py +32 -0
- rasa/builder/copilot/models.py +464 -0
- rasa/builder/copilot/prompts/__init__.py +0 -0
- rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +771 -0
- rasa/builder/copilot/signing.py +305 -0
- rasa/builder/copilot/telemetry.py +200 -0
- rasa/builder/copilot/templated_messages/__init__.py +0 -0
- rasa/builder/copilot/templated_messages/copilot_internal_messages_templates.yml +16 -0
- rasa/builder/copilot/templated_messages/copilot_templated_responses.yml +38 -0
- rasa/builder/document_retrieval/__init__.py +0 -0
- rasa/builder/document_retrieval/constants.py +15 -0
- rasa/builder/document_retrieval/inkeep-rag-response-schema.json +64 -0
- rasa/builder/document_retrieval/inkeep_document_retrieval.py +238 -0
- rasa/builder/document_retrieval/models.py +62 -0
- rasa/builder/download.py +147 -0
- rasa/builder/exceptions.py +91 -0
- rasa/builder/guardrails/__init__.py +1 -0
- rasa/builder/guardrails/constants.py +9 -0
- rasa/builder/guardrails/exceptions.py +4 -0
- rasa/builder/guardrails/lakera.py +206 -0
- rasa/builder/guardrails/models.py +231 -0
- rasa/builder/guardrails/store.py +238 -0
- rasa/builder/guardrails/utils.py +328 -0
- rasa/builder/job_manager.py +87 -0
- rasa/builder/jobs.py +270 -0
- rasa/builder/llm_service.py +246 -0
- rasa/builder/logging_utils.py +265 -0
- rasa/builder/main.py +258 -0
- rasa/builder/models.py +216 -0
- rasa/builder/project_generator.py +462 -0
- rasa/builder/project_info.py +72 -0
- rasa/builder/scrape_rasa_docs.py +97 -0
- rasa/builder/service.py +1335 -0
- rasa/builder/shared/tracker_context.py +212 -0
- rasa/builder/skill_to_bot_prompt.jinja2 +164 -0
- rasa/builder/training_service.py +124 -0
- rasa/builder/validation_service.py +97 -0
- rasa/cli/project_templates/basic/actions/__init__ +0 -0
- rasa/cli/project_templates/basic/actions/action_human_handoff.py +40 -0
- rasa/cli/project_templates/basic/config.yml +27 -0
- rasa/cli/project_templates/basic/credentials.yml +33 -0
- rasa/cli/project_templates/basic/data/data.md +9 -0
- rasa/cli/project_templates/basic/data/general/feedback.yml +21 -0
- rasa/cli/project_templates/basic/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/basic/data/general/hello.yml +6 -0
- rasa/cli/project_templates/basic/data/general/help.yml +6 -0
- rasa/cli/project_templates/basic/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/basic/data/general/show_faqs.yml +6 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_cannot_handle.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_completed.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_correction.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_search.yml +8 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_session_start.yml +8 -0
- rasa/cli/project_templates/basic/docs/docs.md +5 -0
- rasa/cli/project_templates/basic/docs/template.txt +28 -0
- rasa/cli/project_templates/basic/domain/domain.md +9 -0
- rasa/cli/project_templates/basic/domain/general/feedback.yml +25 -0
- rasa/cli/project_templates/basic/domain/general/goodbye.yml +9 -0
- rasa/cli/project_templates/basic/domain/general/hello.yml +7 -0
- rasa/cli/project_templates/basic/domain/general/help.yml +21 -0
- rasa/cli/project_templates/basic/domain/general/human_handoff.yml +32 -0
- rasa/cli/project_templates/basic/domain/general/show_faqs.yml +14 -0
- rasa/cli/project_templates/basic/domain/system/patterns/pattern_cannot_handle.yml +5 -0
- rasa/cli/project_templates/basic/domain/system/patterns/pattern_session_start.yml +19 -0
- rasa/cli/project_templates/basic/endpoints.yml +63 -0
- rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
- rasa/cli/project_templates/finance/actions/__init__.py +46 -0
- rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +47 -0
- rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +40 -0
- rasa/cli/project_templates/finance/actions/action_session_start.py +74 -0
- rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +48 -0
- rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +36 -0
- rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +54 -0
- rasa/cli/project_templates/finance/actions/database.py +277 -0
- rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +52 -0
- rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +51 -0
- rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +40 -0
- rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +40 -0
- rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +46 -0
- rasa/cli/project_templates/finance/actions/transfers/action_process_immediate_payment.py +18 -0
- rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +49 -0
- rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +19 -0
- rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +36 -0
- rasa/cli/project_templates/finance/config.yml +21 -0
- rasa/cli/project_templates/finance/credentials.yml +32 -0
- 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 +11 -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/accounts/check_balance.yml +10 -0
- rasa/cli/project_templates/finance/data/cards/block_card.yml +66 -0
- rasa/cli/project_templates/finance/data/cards/select_card.yml +12 -0
- rasa/cli/project_templates/finance/data/general/bot_identity.yml +6 -0
- rasa/cli/project_templates/finance/data/general/feedback.yml +20 -0
- rasa/cli/project_templates/finance/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/finance/data/general/hello.yml +7 -0
- rasa/cli/project_templates/finance/data/general/help.yml +9 -0
- rasa/cli/project_templates/finance/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/finance/data/general/welcome.yml +9 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +5 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +7 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +7 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +8 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +8 -0
- rasa/cli/project_templates/finance/data/system/source/accounts.json +51 -0
- rasa/cli/project_templates/finance/data/system/source/advisors.json +44 -0
- rasa/cli/project_templates/finance/data/system/source/appointments.json +1474 -0
- rasa/cli/project_templates/finance/data/system/source/branches.json +47 -0
- rasa/cli/project_templates/finance/data/system/source/cards.json +72 -0
- rasa/cli/project_templates/finance/data/system/source/payees.json +74 -0
- rasa/cli/project_templates/finance/data/system/source/transactions.json +492 -0
- rasa/cli/project_templates/finance/data/system/source/users.json +29 -0
- rasa/cli/project_templates/finance/data/transfers/add_payee.yml +29 -0
- rasa/cli/project_templates/finance/data/transfers/list_payees.yml +5 -0
- rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +21 -0
- rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +67 -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/accounts/check_balance.yml +11 -0
- rasa/cli/project_templates/finance/domain/cards/block_card.yml +101 -0
- rasa/cli/project_templates/finance/domain/cards/select_card.yml +12 -0
- rasa/cli/project_templates/finance/domain/general/assistant_details.yml +12 -0
- rasa/cli/project_templates/finance/domain/general/bot_identity.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/defaults.yml +24 -0
- rasa/cli/project_templates/finance/domain/general/feedback.yml +28 -0
- rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/finance/domain/general/help.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +30 -0
- rasa/cli/project_templates/finance/domain/general/utils.yml +13 -0
- rasa/cli/project_templates/finance/domain/general/welcome.yml +8 -0
- rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +47 -0
- rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +4 -0
- rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +16 -0
- rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +79 -0
- rasa/cli/project_templates/finance/endpoints.yml +63 -0
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +19 -0
- rasa/cli/project_templates/telco/actions/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/billing/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/billing/actions_billing.py +204 -0
- rasa/cli/project_templates/telco/actions/general/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/general/action_human_handoff.py +49 -0
- rasa/cli/project_templates/telco/actions/network/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/network/actions_get_data_from_db.py +48 -0
- rasa/cli/project_templates/telco/actions/network/actions_run_diagnostics.py +28 -0
- rasa/cli/project_templates/telco/actions/network/actions_session_start.py +18 -0
- rasa/cli/project_templates/telco/config.yml +27 -0
- rasa/cli/project_templates/telco/credentials.yml +33 -0
- rasa/cli/project_templates/telco/csvs/billing.csv +19 -0
- rasa/cli/project_templates/telco/csvs/customers.csv +5 -0
- rasa/cli/project_templates/telco/data/billing/flow_understand_bill.yml +45 -0
- rasa/cli/project_templates/telco/data/general/bot_challenge.yml +6 -0
- rasa/cli/project_templates/telco/data/general/feedback.yml +20 -0
- rasa/cli/project_templates/telco/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/telco/data/general/hello.yml +6 -0
- rasa/cli/project_templates/telco/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/telco/data/general/patterns.yml +30 -0
- rasa/cli/project_templates/telco/data/network/flow_reboot_router.yml +8 -0
- rasa/cli/project_templates/telco/data/network/flow_reset_router.yml +7 -0
- rasa/cli/project_templates/telco/data/network/flow_solve_internet_issue.yml +73 -0
- rasa/cli/project_templates/telco/docs/docs.md +5 -0
- rasa/cli/project_templates/telco/docs/network/reset_vs_rboot_router.txt +1 -0
- rasa/cli/project_templates/telco/docs/network/restart_router.txt +6 -0
- rasa/cli/project_templates/telco/docs/network/run_speed_test.txt +6 -0
- rasa/cli/project_templates/telco/domain/billing/domain_undertand_bill.yml +102 -0
- rasa/cli/project_templates/telco/domain/general/bot_challenge.yml +4 -0
- rasa/cli/project_templates/telco/domain/general/feedback.yml +25 -0
- rasa/cli/project_templates/telco/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/telco/domain/general/hello.yml +5 -0
- rasa/cli/project_templates/telco/domain/general/human_handoff.yml +29 -0
- rasa/cli/project_templates/telco/domain/general/patterns.yml +33 -0
- rasa/cli/project_templates/telco/domain/network/domain_reboot_router.yml +21 -0
- rasa/cli/project_templates/telco/domain/network/domain_reset_router.yml +12 -0
- rasa/cli/project_templates/telco/domain/network/domain_run_speed_test.yml +25 -0
- rasa/cli/project_templates/telco/domain/network/domain_solve_internet_issue.yml +75 -0
- rasa/cli/project_templates/telco/domain/shared.yml +129 -0
- rasa/cli/project_templates/telco/endpoints.yml +63 -0
- rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +40 -0
- rasa/cli/project_templates/tutorial/config.yml +2 -1
- rasa/cli/scaffold.py +46 -2
- rasa/core/actions/action.py +0 -1
- rasa/core/channels/inspector/dist/assets/{arc-1ddec37b.js → arc-18042c22.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-18af387c.js → blockDiagram-38ab4fdb-fdd6bcfa.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-250127a3.js → c4Diagram-3d4e48cf-f5ae6786.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-b9b536fc.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-c3388b34.js → classDiagram-70f12bd4-81efba3e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-9c893a82.js → classDiagram-v2-f2320105-3b6b6a92.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-78d2ddcf.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-c111213b.js → createText-2e5e7dd3-31422447.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-812a729d.js → edges-e0da2a9e-518a90db.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-fd5051bc.js → erDiagram-9861fffd-a6d3c25a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-3287ac02.js → flowDb-956e92f1-e048c2be.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-692fb0b2.js → flowDiagram-66a62f08-c7474c91.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-8b09c060.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-008376f1.js → flowchart-elk-definition-4a651766-cb4d8723.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-df330a69.js → ganttDiagram-c361ad54-346636a2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-e03676fb.js → gitGraphDiagram-72cf32ee-7c508874.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-46fad2ba.js → graph-14702d8a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-a484ac55.js → index-3862675e-f18b534b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-a003633f.js → index-4d4bdf3a.js} +231 -231
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-3f9e6ec2.js → infoDiagram-f8f76790-64154b83.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-79f72383.js → journeyDiagram-49397b02-833a5f95.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-aad098e5.js → layout-5a3b2123.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-219ab7ae.js → line-2272a8c7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-2cddbe62.js → linear-35bcf273.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-1d41ed99.js → mindmap-definition-fc14e90a-92dcb0e9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-cc496ee8.js → pieDiagram-8a3498a8-94dbc900.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-84d32884.js → quadrantDiagram-120e2f19-8b7a9c33.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-c0deb984.js → requirementDiagram-deff3bca-6f7eab81.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-b9d7fd62.js → sankeyDiagram-04a897e0-f43e581d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-7d517565.js → sequenceDiagram-704730f1-0bcbefc3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-98ef9b27.js → stateDiagram-587899a1-b8a74083.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-cee70748.js → stateDiagram-v2-d93cdb3a-2070218f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-3f9d1c96.js → styles-6aaf32cf-f1d54e34.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-67471923.js → styles-9a916d00-980de489.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-bd093fb7.js → styles-c10674c1-3c03abde.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-675794e8.js → svgDrawCommon-08f97a94-46ba068f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-0ac67617.js → timeline-definition-85554ec2-901f5e3d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-c018dc37.js → xychartDiagram-e933f94c-acbc628a.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +2 -2
- rasa/core/channels/inspector/index.html +1 -1
- rasa/core/channels/inspector/src/App.tsx +10 -11
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +12 -3
- rasa/core/channels/studio_chat.py +25 -7
- rasa/core/policies/enterprise_search_policy.py +4 -7
- rasa/core/policies/flows/flow_executor.py +8 -1
- rasa/dialogue_understanding/generator/flow_retrieval.py +10 -9
- rasa/engine/storage/local_model_storage.py +45 -2
- rasa/model_manager/model_api.py +1 -2
- rasa/model_manager/runner_service.py +1 -1
- rasa/model_manager/trainer_service.py +12 -9
- rasa/model_manager/utils.py +1 -29
- rasa/shared/core/domain.py +62 -15
- rasa/shared/core/flows/flow_step.py +7 -1
- rasa/shared/core/flows/steps/call.py +8 -1
- rasa/shared/core/flows/yaml_flows_io.py +16 -8
- rasa/shared/core/slots.py +4 -0
- rasa/shared/importers/importer.py +6 -0
- rasa/shared/importers/utils.py +77 -1
- rasa/studio/upload.py +12 -46
- rasa/telemetry.py +97 -23
- rasa/utils/io.py +27 -9
- rasa/utils/json_utils.py +6 -1
- rasa/utils/log_utils.py +5 -1
- rasa/utils/openapi.py +144 -0
- rasa/validator.py +7 -3
- rasa/version.py +1 -1
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250901.dist-info}/METADATA +9 -10
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250901.dist-info}/RECORD +347 -73
- rasa/core/channels/inspector/dist/assets/channel-59f6d54b.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-26177ddb.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-29c03f5a.js +0 -1
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250901.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250901.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250901.dist-info}/entry_points.txt +0 -0
|
@@ -262,12 +262,9 @@ class YamlFlowsWriter:
|
|
|
262
262
|
Returns:
|
|
263
263
|
The dumped YAML.
|
|
264
264
|
"""
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
del dumped_flow["id"]
|
|
269
|
-
dump[flow.id] = dumped_flow
|
|
270
|
-
return dump_obj_as_yaml_to_string({KEY_FLOWS: dump})
|
|
265
|
+
return dump_obj_as_yaml_to_string(
|
|
266
|
+
{KEY_FLOWS: get_flows_as_json(flows, should_clean_json)}
|
|
267
|
+
)
|
|
271
268
|
|
|
272
269
|
@staticmethod
|
|
273
270
|
def dump(
|
|
@@ -424,9 +421,20 @@ def process_yaml_content(yaml_content: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
424
421
|
return yaml_content
|
|
425
422
|
|
|
426
423
|
|
|
424
|
+
def get_flows_as_json(
|
|
425
|
+
flows: FlowsList, should_clean_json: bool = False
|
|
426
|
+
) -> Dict[str, Any]:
|
|
427
|
+
"""Get the flows as a JSON dictionary."""
|
|
428
|
+
dump = {}
|
|
429
|
+
for flow in flows:
|
|
430
|
+
dumped_flow = get_flow_as_json(flow, should_clean_json)
|
|
431
|
+
del dumped_flow["id"]
|
|
432
|
+
dump[flow.id] = dumped_flow
|
|
433
|
+
return dump
|
|
434
|
+
|
|
435
|
+
|
|
427
436
|
def get_flow_as_json(flow: Flow, should_clean_json: bool = False) -> Dict[str, Any]:
|
|
428
|
-
"""
|
|
429
|
-
Clean the Flow JSON by removing default values and empty fields.
|
|
437
|
+
"""Clean the Flow JSON by removing default values and empty fields.
|
|
430
438
|
|
|
431
439
|
Args:
|
|
432
440
|
flow: The Flow object to clean.
|
rasa/shared/core/slots.py
CHANGED
|
@@ -273,10 +273,14 @@ class Slot(ABC):
|
|
|
273
273
|
try:
|
|
274
274
|
return rasa.shared.utils.common.class_from_module_path(type_name)
|
|
275
275
|
except (ImportError, AttributeError):
|
|
276
|
+
known_types = [
|
|
277
|
+
cls.type_name for cls in rasa.shared.utils.common.all_subclasses(Slot)
|
|
278
|
+
]
|
|
276
279
|
raise InvalidSlotTypeException(
|
|
277
280
|
f"Failed to find slot type, '{type_name}' is neither a known type nor "
|
|
278
281
|
f"user-defined. If you are creating your own slot type, make "
|
|
279
282
|
f"sure its module path is correct. "
|
|
283
|
+
f"Known types: {', '.join(known_types)} "
|
|
280
284
|
f"You can find all build in types at {DOCS_URL_SLOTS}"
|
|
281
285
|
)
|
|
282
286
|
|
|
@@ -207,6 +207,12 @@ class TrainingDataImporter(ABC):
|
|
|
207
207
|
)
|
|
208
208
|
]
|
|
209
209
|
|
|
210
|
+
return TrainingDataImporter.wrap_in_builtins(importers)
|
|
211
|
+
|
|
212
|
+
@staticmethod
|
|
213
|
+
def wrap_in_builtins(
|
|
214
|
+
importers: List["TrainingDataImporter"],
|
|
215
|
+
) -> "TrainingDataImporter":
|
|
210
216
|
return LanguageImporter(
|
|
211
217
|
E2EImporter(
|
|
212
218
|
FlowSyncImporter(ResponsesSyncImporter(CombinedDataImporter(importers)))
|
rasa/shared/importers/utils.py
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
from typing import Iterable, List, Optional, Text
|
|
1
|
+
from typing import Any, Dict, Iterable, List, Optional, Text
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
2
4
|
|
|
3
5
|
from rasa.shared.core.domain import Domain
|
|
4
6
|
from rasa.shared.core.flows import FlowsList
|
|
7
|
+
from rasa.shared.core.flows.yaml_flows_io import KEY_FLOWS, get_flows_as_json
|
|
5
8
|
from rasa.shared.core.training_data.structures import StoryGraph
|
|
9
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
10
|
+
from rasa.shared.nlu.training_data.formats.rasa_yaml import RasaYAMLWriter
|
|
6
11
|
from rasa.shared.nlu.training_data.training_data import TrainingData
|
|
12
|
+
from rasa.utils.json_utils import extract_values
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CALMUserData(BaseModel):
|
|
16
|
+
"""All pieces that will be uploaded to Rasa Studio."""
|
|
17
|
+
|
|
18
|
+
flows: Dict[str, Any] = Field(default_factory=dict)
|
|
19
|
+
domain: Dict[str, Any] = Field(default_factory=dict)
|
|
20
|
+
config: Dict[str, Any] = Field(default_factory=dict)
|
|
21
|
+
endpoints: Dict[str, Any] = Field(default_factory=dict)
|
|
22
|
+
nlu: Dict[str, Any] = Field(default_factory=dict)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
DOMAIN_KEYS = [
|
|
26
|
+
"version",
|
|
27
|
+
"actions",
|
|
28
|
+
"responses",
|
|
29
|
+
"slots",
|
|
30
|
+
"intents",
|
|
31
|
+
"entities",
|
|
32
|
+
"forms",
|
|
33
|
+
"session_config",
|
|
34
|
+
]
|
|
7
35
|
|
|
8
36
|
|
|
9
37
|
def training_data_from_paths(paths: Iterable[Text], language: Text) -> TrainingData:
|
|
@@ -34,3 +62,51 @@ def flows_from_paths(files: List[Text]) -> FlowsList:
|
|
|
34
62
|
)
|
|
35
63
|
flows.validate()
|
|
36
64
|
return flows
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def extract_calm_import_parts_from_importer(
|
|
68
|
+
importer: TrainingDataImporter,
|
|
69
|
+
config: Optional[Dict[str, Any]] = None,
|
|
70
|
+
endpoints: Optional[Dict[str, Any]] = None,
|
|
71
|
+
) -> CALMUserData:
|
|
72
|
+
"""Extracts CALMUserData from a TrainingDataImporter.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
importer: The training data importer
|
|
76
|
+
data_paths: The path(s) to the training data for flows
|
|
77
|
+
config: Optional config dict, if not provided will use importer.get_config()
|
|
78
|
+
endpoints: Optional endpoints dict, defaults to empty dict
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
CALMUserData containing flows, domain, config, endpoints, and nlu data
|
|
82
|
+
"""
|
|
83
|
+
# Extract config
|
|
84
|
+
if config is None:
|
|
85
|
+
config = importer.get_config()
|
|
86
|
+
|
|
87
|
+
# Extract domain
|
|
88
|
+
domain_from_files = importer.get_user_domain().as_dict()
|
|
89
|
+
domain = extract_values(domain_from_files, DOMAIN_KEYS)
|
|
90
|
+
|
|
91
|
+
# Extract flows
|
|
92
|
+
flows = importer.get_user_flows()
|
|
93
|
+
flows_dict = {KEY_FLOWS: get_flows_as_json(flows)}
|
|
94
|
+
|
|
95
|
+
# Extract NLU data
|
|
96
|
+
nlu_data = importer.get_nlu_data()
|
|
97
|
+
nlu_examples = nlu_data.filter_training_examples(
|
|
98
|
+
lambda ex: ex.get("intent") in nlu_data.intents
|
|
99
|
+
)
|
|
100
|
+
nlu_dict = RasaYAMLWriter().training_data_to_dict(nlu_examples)
|
|
101
|
+
|
|
102
|
+
# Use provided endpoints or default to empty dict
|
|
103
|
+
if endpoints is None:
|
|
104
|
+
endpoints = {}
|
|
105
|
+
|
|
106
|
+
return CALMUserData(
|
|
107
|
+
flows=flows_dict or {},
|
|
108
|
+
domain=domain or {},
|
|
109
|
+
config=config or {},
|
|
110
|
+
endpoints=endpoints or {},
|
|
111
|
+
nlu=nlu_dict or {},
|
|
112
|
+
)
|
rasa/studio/upload.py
CHANGED
|
@@ -7,7 +7,6 @@ from typing import Any, Dict, Iterable, List, Optional, Set, Text, Tuple, Union
|
|
|
7
7
|
import questionary
|
|
8
8
|
import requests
|
|
9
9
|
import structlog
|
|
10
|
-
from pydantic import BaseModel, Field
|
|
11
10
|
|
|
12
11
|
import rasa.cli.telemetry
|
|
13
12
|
import rasa.cli.utils
|
|
@@ -24,9 +23,13 @@ from rasa.shared.constants import (
|
|
|
24
23
|
DEFAULT_DOMAIN_PATHS,
|
|
25
24
|
)
|
|
26
25
|
from rasa.shared.core.domain import Domain
|
|
27
|
-
from rasa.shared.core.flows.yaml_flows_io import YAMLFlowsReader
|
|
26
|
+
from rasa.shared.core.flows.yaml_flows_io import YAMLFlowsReader
|
|
28
27
|
from rasa.shared.exceptions import RasaException
|
|
29
|
-
from rasa.shared.importers.importer import
|
|
28
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
29
|
+
from rasa.shared.importers.utils import (
|
|
30
|
+
CALMUserData,
|
|
31
|
+
extract_calm_import_parts_from_importer,
|
|
32
|
+
)
|
|
30
33
|
from rasa.shared.nlu.training_data.formats.rasa_yaml import (
|
|
31
34
|
RasaYAMLReader,
|
|
32
35
|
RasaYAMLWriter,
|
|
@@ -34,7 +37,6 @@ from rasa.shared.nlu.training_data.formats.rasa_yaml import (
|
|
|
34
37
|
from rasa.shared.utils.llm import collect_custom_prompts
|
|
35
38
|
from rasa.shared.utils.yaml import (
|
|
36
39
|
dump_obj_as_yaml_to_string,
|
|
37
|
-
read_yaml,
|
|
38
40
|
read_yaml_file,
|
|
39
41
|
)
|
|
40
42
|
from rasa.studio import results_logger
|
|
@@ -43,6 +45,7 @@ from rasa.studio.config import StudioConfig
|
|
|
43
45
|
from rasa.studio.results_logger import StudioResult, with_studio_error_handler
|
|
44
46
|
from rasa.studio.utils import validate_argument_paths
|
|
45
47
|
from rasa.telemetry import track_upload_to_studio_failed
|
|
48
|
+
from rasa.utils.json_utils import extract_values
|
|
46
49
|
|
|
47
50
|
structlogger = structlog.get_logger()
|
|
48
51
|
|
|
@@ -68,16 +71,6 @@ DOMAIN_KEYS = [
|
|
|
68
71
|
]
|
|
69
72
|
|
|
70
73
|
|
|
71
|
-
class CALMImportParts(BaseModel):
|
|
72
|
-
"""All pieces that will be uploaded to Rasa Studio."""
|
|
73
|
-
|
|
74
|
-
flows: Dict[str, Any]
|
|
75
|
-
domain: Dict[str, Any]
|
|
76
|
-
config: Dict[str, Any]
|
|
77
|
-
endpoints: Dict[str, Any]
|
|
78
|
-
nlu: Dict[str, Any] = Field(default_factory=dict)
|
|
79
|
-
|
|
80
|
-
|
|
81
74
|
def _get_selected_entities_and_intents(
|
|
82
75
|
args: argparse.Namespace,
|
|
83
76
|
intents_from_files: Set[Text],
|
|
@@ -195,11 +188,6 @@ config_keys = [
|
|
|
195
188
|
]
|
|
196
189
|
|
|
197
190
|
|
|
198
|
-
def extract_values(data: Dict, keys: List[Text]) -> Dict:
|
|
199
|
-
"""Extracts values for given keys from a dictionary."""
|
|
200
|
-
return {key: data.get(key) for key in keys if data.get(key)}
|
|
201
|
-
|
|
202
|
-
|
|
203
191
|
def _get_assistant_name(config: Dict[Text, Any]) -> str:
|
|
204
192
|
config_assistant_id = config.get("assistant_id", "")
|
|
205
193
|
assistant_name = questionary.text(
|
|
@@ -238,7 +226,7 @@ def build_calm_import_parts(
|
|
|
238
226
|
config_path: Text,
|
|
239
227
|
endpoints_path: Optional[Text] = None,
|
|
240
228
|
assistant_name: Optional[Text] = None,
|
|
241
|
-
) -> Tuple[str,
|
|
229
|
+
) -> Tuple[str, CALMUserData]:
|
|
242
230
|
"""Builds the parts of the assistant to be uploaded to Studio.
|
|
243
231
|
|
|
244
232
|
Args:
|
|
@@ -251,9 +239,11 @@ def build_calm_import_parts(
|
|
|
251
239
|
Returns:
|
|
252
240
|
The assistant name and the parts to be uploaded
|
|
253
241
|
"""
|
|
242
|
+
training_data_paths = data_path if isinstance(data_path, list) else [str(data_path)]
|
|
254
243
|
importer = TrainingDataImporter.load_from_dict(
|
|
255
244
|
domain_path=domain_path,
|
|
256
245
|
config_path=config_path,
|
|
246
|
+
training_data_paths=training_data_paths,
|
|
257
247
|
expand_env_vars=False,
|
|
258
248
|
)
|
|
259
249
|
|
|
@@ -261,34 +251,10 @@ def build_calm_import_parts(
|
|
|
261
251
|
endpoints = read_yaml_file(endpoints_path, expand_env_vars=False)
|
|
262
252
|
assistant_name = assistant_name or _get_assistant_name(config)
|
|
263
253
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
training_data_paths = data_path if isinstance(data_path, list) else [str(data_path)]
|
|
268
|
-
flow_importer = FlowSyncImporter.load_from_dict(
|
|
269
|
-
training_data_paths=training_data_paths, expand_env_vars=False
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
flows = list(flow_importer.get_user_flows())
|
|
273
|
-
flows_yaml = YamlFlowsWriter().dumps(flows)
|
|
274
|
-
flows = read_yaml(flows_yaml, expand_env_vars=False)
|
|
275
|
-
|
|
276
|
-
nlu_importer = TrainingDataImporter.load_from_dict(
|
|
277
|
-
training_data_paths=training_data_paths, expand_env_vars=False
|
|
278
|
-
)
|
|
279
|
-
nlu_data = nlu_importer.get_nlu_data()
|
|
280
|
-
nlu_examples = nlu_data.filter_training_examples(
|
|
281
|
-
lambda ex: ex.get("intent") in nlu_data.intents
|
|
282
|
-
)
|
|
283
|
-
nlu_examples_yaml = RasaYAMLWriter().dumps(nlu_examples)
|
|
284
|
-
nlu = read_yaml(nlu_examples_yaml, expand_env_vars=False)
|
|
285
|
-
|
|
286
|
-
parts = CALMImportParts(
|
|
287
|
-
flows=flows,
|
|
288
|
-
domain=domain,
|
|
254
|
+
parts = extract_calm_import_parts_from_importer(
|
|
255
|
+
importer=importer,
|
|
289
256
|
config=config,
|
|
290
257
|
endpoints=endpoints,
|
|
291
|
-
nlu=nlu,
|
|
292
258
|
)
|
|
293
259
|
|
|
294
260
|
return assistant_name, parts
|
rasa/telemetry.py
CHANGED
|
@@ -3,7 +3,6 @@ import contextlib
|
|
|
3
3
|
import hashlib
|
|
4
4
|
import inspect
|
|
5
5
|
import json
|
|
6
|
-
import logging
|
|
7
6
|
import multiprocessing
|
|
8
7
|
import os
|
|
9
8
|
import platform
|
|
@@ -70,7 +69,7 @@ if typing.TYPE_CHECKING:
|
|
|
70
69
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
71
70
|
from rasa.shared.nlu.training_data.training_data import TrainingData
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
structlogger = structlog.get_logger()
|
|
74
73
|
|
|
75
74
|
SEGMENT_TRACK_ENDPOINT = "https://api.segment.io/v1/track"
|
|
76
75
|
SEGMENT_IDENTIFY_ENDPOINT = "https://api.segment.io/v1/identify"
|
|
@@ -197,6 +196,10 @@ TELEMETRY_E2E_TEST_CONVERSION_EVENT = "E2E Test Conversion Completed"
|
|
|
197
196
|
E2E_TEST_CONVERSION_FILE_TYPE = "file_type"
|
|
198
197
|
E2E_TEST_CONVERSION_TEST_CASE_COUNT = "test_case_count"
|
|
199
198
|
|
|
199
|
+
# Copilot telemetry
|
|
200
|
+
TELEMETRY_COPILOT_USER_MESSAGE_EVENT = "copilot_user_message"
|
|
201
|
+
TELEMETRY_COPILOT_BOT_MESSAGE_EVENT = "copilot_bot_message"
|
|
202
|
+
|
|
200
203
|
|
|
201
204
|
def print_telemetry_reporting_info() -> None:
|
|
202
205
|
"""Print telemetry information to std out."""
|
|
@@ -255,7 +258,11 @@ def _is_telemetry_enabled_in_configuration() -> bool:
|
|
|
255
258
|
|
|
256
259
|
return stored_config[CONFIG_TELEMETRY_ENABLED]
|
|
257
260
|
except ValueError as e:
|
|
258
|
-
|
|
261
|
+
structlogger.debug(
|
|
262
|
+
"telemetry.is_telemetry_enabled_in_configuration.error",
|
|
263
|
+
error=str(e),
|
|
264
|
+
event_info="Could not read telemetry settings from configuration file",
|
|
265
|
+
)
|
|
259
266
|
|
|
260
267
|
# seems like there is no config, we'll create one and enable telemetry
|
|
261
268
|
success = _write_default_telemetry_configuration()
|
|
@@ -272,7 +279,10 @@ def is_telemetry_enabled() -> bool:
|
|
|
272
279
|
from rasa.utils import licensing
|
|
273
280
|
|
|
274
281
|
if licensing.is_champion_server_license():
|
|
275
|
-
|
|
282
|
+
structlogger.debug(
|
|
283
|
+
"telemetry.enabled.developer_license",
|
|
284
|
+
event_info="Telemetry is enabled for developer licenses.",
|
|
285
|
+
)
|
|
276
286
|
return True
|
|
277
287
|
|
|
278
288
|
telemetry_environ = os.environ.get(TELEMETRY_ENABLED_ENVIRONMENT_VARIABLE)
|
|
@@ -308,9 +318,13 @@ def initialize_telemetry() -> bool:
|
|
|
308
318
|
|
|
309
319
|
return telemetry_environ.lower() == "true"
|
|
310
320
|
except Exception as e: # skipcq:PYL-W0703
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
321
|
+
structlogger.exception(
|
|
322
|
+
"telemetry.initialize_telemetry.error",
|
|
323
|
+
error=str(e),
|
|
324
|
+
event_info=(
|
|
325
|
+
"Failed to initialize telemetry reporting. "
|
|
326
|
+
"Telemetry reporting will be disabled."
|
|
327
|
+
),
|
|
314
328
|
)
|
|
315
329
|
return False
|
|
316
330
|
|
|
@@ -481,7 +495,10 @@ def print_telemetry_payload(payload: Dict[Text, Any]) -> None:
|
|
|
481
495
|
payload: payload to be delivered to segment.
|
|
482
496
|
"""
|
|
483
497
|
payload_json = json.dumps(payload, indent=2)
|
|
484
|
-
|
|
498
|
+
structlogger.debug(
|
|
499
|
+
"telemetry.print_telemetry_payload.debug",
|
|
500
|
+
event_info=f"Telemetry payload: {payload_json}",
|
|
501
|
+
)
|
|
485
502
|
|
|
486
503
|
|
|
487
504
|
def _get_telemetry_write_key() -> Optional[Text]:
|
|
@@ -535,10 +552,24 @@ def _send_request(url: Text, payload: Dict[Text, Any]) -> None:
|
|
|
535
552
|
if not write_key:
|
|
536
553
|
# If RASA_TELEMETRY_WRITE_KEY is empty or `None`, telemetry has not
|
|
537
554
|
# been enabled for this build (e.g. because it is running from source)
|
|
538
|
-
|
|
555
|
+
structlogger.debug(
|
|
556
|
+
"telemetry.send_request.no_telemetry_key",
|
|
557
|
+
event_info="Skipping request to external service: telemetry key not set.",
|
|
558
|
+
)
|
|
539
559
|
return
|
|
540
560
|
|
|
541
|
-
|
|
561
|
+
send_segment_request(url, payload, write_key)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def send_segment_request(url: Text, payload: Dict[Text, Any], write_key: Text) -> None:
|
|
565
|
+
"""Send a request to the Segment API.
|
|
566
|
+
|
|
567
|
+
Args:
|
|
568
|
+
url: URL of the Segment API endpoint
|
|
569
|
+
payload: payload to send to the Segment API
|
|
570
|
+
write_key: write key for the Segment API
|
|
571
|
+
"""
|
|
572
|
+
headers = segment_request_header(write_key)
|
|
542
573
|
|
|
543
574
|
resp = requests.post(
|
|
544
575
|
url=url,
|
|
@@ -548,15 +579,22 @@ def _send_request(url: Text, payload: Dict[Text, Any]) -> None:
|
|
|
548
579
|
)
|
|
549
580
|
# handle different failure cases
|
|
550
581
|
if resp.status_code != 200:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
582
|
+
structlogger.debug(
|
|
583
|
+
"telemetry.send_segment_request.error_response",
|
|
584
|
+
event_info=(
|
|
585
|
+
f"Segment telemetry request returned a {resp.status_code} "
|
|
586
|
+
f"response. Body: {resp.text}"
|
|
587
|
+
),
|
|
554
588
|
)
|
|
555
589
|
else:
|
|
556
590
|
data = resp.json()
|
|
557
591
|
if not data.get("success"):
|
|
558
|
-
|
|
559
|
-
|
|
592
|
+
structlogger.debug(
|
|
593
|
+
"telemetry.send_segment_request.failure",
|
|
594
|
+
event_info=(
|
|
595
|
+
f"Segment telemetry request returned a failure. "
|
|
596
|
+
f"Response: {data}"
|
|
597
|
+
),
|
|
560
598
|
)
|
|
561
599
|
|
|
562
600
|
|
|
@@ -609,6 +647,15 @@ def with_default_context_fields(
|
|
|
609
647
|
return {**_default_context_fields(), **context}
|
|
610
648
|
|
|
611
649
|
|
|
650
|
+
def get_deployment_stack() -> Text:
|
|
651
|
+
"""Return the deployment stack.
|
|
652
|
+
|
|
653
|
+
Returns:
|
|
654
|
+
The deployment stack.
|
|
655
|
+
"""
|
|
656
|
+
return os.environ.get("DEPLOYMENT_STACK", "")
|
|
657
|
+
|
|
658
|
+
|
|
612
659
|
def _default_context_fields() -> Dict[Text, Any]:
|
|
613
660
|
"""Return a dictionary that contains the default context values.
|
|
614
661
|
|
|
@@ -632,6 +679,7 @@ def _default_context_fields() -> Dict[Text, Any]:
|
|
|
632
679
|
"cpu": multiprocessing.cpu_count(),
|
|
633
680
|
"docker": _is_docker(),
|
|
634
681
|
"license_hash": get_license_hash(),
|
|
682
|
+
"deployment_stack": get_deployment_stack(),
|
|
635
683
|
"company": property_of_active_license(
|
|
636
684
|
lambda active_license: active_license.company
|
|
637
685
|
),
|
|
@@ -663,7 +711,10 @@ def _track(
|
|
|
663
711
|
telemetry_id = get_telemetry_id()
|
|
664
712
|
|
|
665
713
|
if not telemetry_id:
|
|
666
|
-
|
|
714
|
+
structlogger.debug(
|
|
715
|
+
"telemetry.track.no_id_found",
|
|
716
|
+
event_info="Will not report telemetry events as no ID was found.",
|
|
717
|
+
)
|
|
667
718
|
return
|
|
668
719
|
|
|
669
720
|
if not properties:
|
|
@@ -681,7 +732,11 @@ def _track(
|
|
|
681
732
|
with_default_context_fields(context),
|
|
682
733
|
)
|
|
683
734
|
except Exception as e: # skipcq:PYL-W0703
|
|
684
|
-
|
|
735
|
+
structlogger.debug(
|
|
736
|
+
"telemetry.track.error",
|
|
737
|
+
error=str(e),
|
|
738
|
+
event_info="Skipping telemetry reporting",
|
|
739
|
+
)
|
|
685
740
|
|
|
686
741
|
|
|
687
742
|
def _identify(
|
|
@@ -702,7 +757,10 @@ def _identify(
|
|
|
702
757
|
telemetry_id = get_telemetry_id()
|
|
703
758
|
|
|
704
759
|
if not telemetry_id:
|
|
705
|
-
|
|
760
|
+
structlogger.debug(
|
|
761
|
+
"telemetry.identify.no_id_found",
|
|
762
|
+
event_info="Will not report telemetry events as no ID was found.",
|
|
763
|
+
)
|
|
706
764
|
return
|
|
707
765
|
|
|
708
766
|
if not traits:
|
|
@@ -710,7 +768,11 @@ def _identify(
|
|
|
710
768
|
|
|
711
769
|
_send_traits(telemetry_id, traits, with_default_context_fields(context))
|
|
712
770
|
except Exception as e:
|
|
713
|
-
|
|
771
|
+
structlogger.debug(
|
|
772
|
+
"telemetry.identify.error",
|
|
773
|
+
error=str(e),
|
|
774
|
+
event_info="Skipping telemetry reporting",
|
|
775
|
+
)
|
|
714
776
|
|
|
715
777
|
|
|
716
778
|
def _send_traits(
|
|
@@ -868,13 +930,16 @@ def strip_sensitive_data_from_sentry_event(
|
|
|
868
930
|
|
|
869
931
|
|
|
870
932
|
@ensure_telemetry_enabled
|
|
871
|
-
def initialize_error_reporting() -> None:
|
|
933
|
+
def initialize_error_reporting(private_mode: bool = True) -> None:
|
|
872
934
|
"""Sets up automated error reporting.
|
|
873
935
|
|
|
874
936
|
Exceptions are reported to sentry. We avoid sending any metadata (local
|
|
875
937
|
variables, paths, ...) to make sure we don't compromise any data. Only the
|
|
876
938
|
exception and its stacktrace is logged and only if the exception origins
|
|
877
939
|
from the `rasa` package.
|
|
940
|
+
|
|
941
|
+
Args:
|
|
942
|
+
private_mode: If True, try to send as little data as possible.
|
|
878
943
|
"""
|
|
879
944
|
import sentry_sdk
|
|
880
945
|
from sentry_sdk import configure_scope
|
|
@@ -892,11 +957,18 @@ def initialize_error_reporting() -> None:
|
|
|
892
957
|
|
|
893
958
|
telemetry_id = get_telemetry_id()
|
|
894
959
|
|
|
960
|
+
# in hello rasa we use a different project, so we need to be able
|
|
961
|
+
# to set the whole url. since we can't change the behavior of sentry in pro
|
|
962
|
+
# we have two kinds of keys, full urls and jsut the key within the fixed rasa
|
|
963
|
+
# pro project.
|
|
964
|
+
if not key.startswith("https://"):
|
|
965
|
+
key = f"https://{key}.ingest.sentry.io/2801673"
|
|
966
|
+
|
|
895
967
|
# this is a very defensive configuration, avoiding as many integrations as
|
|
896
968
|
# possible. it also submits very little data (exception with error message
|
|
897
969
|
# and line numbers).
|
|
898
970
|
sentry_sdk.init(
|
|
899
|
-
|
|
971
|
+
key,
|
|
900
972
|
before_send=before_send,
|
|
901
973
|
integrations=[
|
|
902
974
|
ExcepthookIntegration(),
|
|
@@ -916,7 +988,7 @@ def initialize_error_reporting() -> None:
|
|
|
916
988
|
OSError,
|
|
917
989
|
],
|
|
918
990
|
in_app_include=["rasa"], # only submit errors in this package
|
|
919
|
-
include_local_variables=
|
|
991
|
+
include_local_variables=not private_mode,
|
|
920
992
|
release=f"rasa-{rasa.__version__}",
|
|
921
993
|
default_integrations=False,
|
|
922
994
|
environment="development" if in_continuous_integration() else "production",
|
|
@@ -937,6 +1009,7 @@ def initialize_error_reporting() -> None:
|
|
|
937
1009
|
# os is a nested dict, hence we report it separately
|
|
938
1010
|
scope.set_context("Operating System", default_context.pop("os"))
|
|
939
1011
|
scope.set_context("Environment", default_context)
|
|
1012
|
+
structlogger.debug("telemetry.sentry.initialized")
|
|
940
1013
|
|
|
941
1014
|
|
|
942
1015
|
@contextlib.contextmanager
|
|
@@ -1426,6 +1499,7 @@ def track_shell_started(model_type: Text, assistant_id: Text) -> None:
|
|
|
1426
1499
|
|
|
1427
1500
|
Args:
|
|
1428
1501
|
model_type: Type of the model, core / nlu or rasa.
|
|
1502
|
+
assistant_id: ID of the assistant being inspected.
|
|
1429
1503
|
"""
|
|
1430
1504
|
_track(
|
|
1431
1505
|
TELEMETRY_SHELL_STARTED_EVENT,
|
|
@@ -1997,7 +2071,7 @@ def _extract_stream_pii(event_broker: Optional["EventBroker"]) -> bool:
|
|
|
1997
2071
|
def track_privacy_enabled(
|
|
1998
2072
|
privacy_config: "PrivacyConfig", event_broker: Optional["EventBroker"]
|
|
1999
2073
|
) -> None:
|
|
2000
|
-
"""Track when PII management capability is enabled"""
|
|
2074
|
+
"""Track when PII management capability is enabled."""
|
|
2001
2075
|
stream_pii = _extract_stream_pii(event_broker)
|
|
2002
2076
|
privacy_properties = _extract_privacy_enabled_event_properties(
|
|
2003
2077
|
privacy_config, stream_pii
|
rasa/utils/io.py
CHANGED
|
@@ -26,6 +26,7 @@ from typing_extensions import Protocol
|
|
|
26
26
|
|
|
27
27
|
import rasa.shared.constants
|
|
28
28
|
import rasa.shared.utils.io
|
|
29
|
+
from rasa.shared.exceptions import RasaException
|
|
29
30
|
|
|
30
31
|
if TYPE_CHECKING:
|
|
31
32
|
from prompt_toolkit.validation import Validator
|
|
@@ -124,9 +125,7 @@ def create_path(file_path: Text) -> None:
|
|
|
124
125
|
def file_type_validator(
|
|
125
126
|
valid_file_types: List[Text], error_message: Text
|
|
126
127
|
) -> Type["Validator"]:
|
|
127
|
-
"""Creates a
|
|
128
|
-
file paths.
|
|
129
|
-
"""
|
|
128
|
+
"""Creates a file type validator class for the questionary package."""
|
|
130
129
|
|
|
131
130
|
def is_valid(path: Text) -> bool:
|
|
132
131
|
return path is not None and any(
|
|
@@ -137,9 +136,7 @@ def file_type_validator(
|
|
|
137
136
|
|
|
138
137
|
|
|
139
138
|
def not_empty_validator(error_message: Text) -> Type["Validator"]:
|
|
140
|
-
"""Creates a
|
|
141
|
-
that the user entered something other than whitespace.
|
|
142
|
-
"""
|
|
139
|
+
"""Creates a not empty validator class for the questionary package."""
|
|
143
140
|
|
|
144
141
|
def is_valid(input: Text) -> bool:
|
|
145
142
|
return input is not None and input.strip() != ""
|
|
@@ -150,9 +147,7 @@ def not_empty_validator(error_message: Text) -> Type["Validator"]:
|
|
|
150
147
|
def create_validator(
|
|
151
148
|
function: Callable[[Text], bool], error_message: Text
|
|
152
149
|
) -> Type["Validator"]:
|
|
153
|
-
"""Helper method to create
|
|
154
|
-
removed when questionary supports `Validator` objects.
|
|
155
|
-
"""
|
|
150
|
+
"""Helper method to create a validator class from a callable function."""
|
|
156
151
|
from prompt_toolkit.document import Document
|
|
157
152
|
from prompt_toolkit.validation import ValidationError, Validator
|
|
158
153
|
|
|
@@ -250,3 +245,26 @@ def write_yaml(
|
|
|
250
245
|
|
|
251
246
|
with Path(target).open("w", encoding="utf-8") as outfile:
|
|
252
247
|
dumper.dump(data, outfile, transform=transform)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
class InvalidPathException(RasaException):
|
|
251
|
+
"""Raised if a path is invalid - e.g. path traversal is detected."""
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def subpath(parent: str, child: str) -> str:
|
|
255
|
+
"""Return the path to the child directory of the parent directory.
|
|
256
|
+
|
|
257
|
+
Ensures, that child doesn't navigate to parent directories. Prevents
|
|
258
|
+
path traversal. Raises an InvalidPathException if the path is invalid.
|
|
259
|
+
|
|
260
|
+
Based on Snyk's directory traversal mitigation:
|
|
261
|
+
https://learn.snyk.io/lesson/directory-traversal/
|
|
262
|
+
"""
|
|
263
|
+
safe_path = os.path.abspath(os.path.join(parent, child))
|
|
264
|
+
parent = os.path.abspath(parent)
|
|
265
|
+
|
|
266
|
+
common_base = os.path.commonpath([parent, safe_path])
|
|
267
|
+
if common_base != parent:
|
|
268
|
+
raise InvalidPathException(f"Invalid path: {safe_path}")
|
|
269
|
+
|
|
270
|
+
return safe_path
|
rasa/utils/json_utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from decimal import Decimal
|
|
3
|
-
from typing import Any, Text
|
|
3
|
+
from typing import Any, Dict, List, Text
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class DecimalEncoder(json.JSONEncoder):
|
|
@@ -58,3 +58,8 @@ def replace_decimals_with_floats(obj: Any) -> Any:
|
|
|
58
58
|
Input `obj` with all `Decimal` types replaced by `float`s.
|
|
59
59
|
"""
|
|
60
60
|
return json.loads(json.dumps(obj, cls=DecimalEncoder))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def extract_values(data: Dict, keys: List[Text]) -> Dict:
|
|
64
|
+
"""Extracts values for given keys from a dictionary."""
|
|
65
|
+
return {key: data.get(key) for key in keys if data.get(key)}
|
rasa/utils/log_utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
5
|
import sys
|
|
6
|
-
from typing import Any, Optional
|
|
6
|
+
from typing import Any, List, Optional
|
|
7
7
|
|
|
8
8
|
import structlog
|
|
9
9
|
from structlog.dev import ConsoleRenderer
|
|
@@ -37,6 +37,7 @@ class HumanConsoleRenderer(ConsoleRenderer):
|
|
|
37
37
|
def configure_structlog(
|
|
38
38
|
log_level: Optional[int] = None,
|
|
39
39
|
include_time: bool = False,
|
|
40
|
+
additional_processors: Optional[List[structlog.typing.Processor]] = None,
|
|
40
41
|
) -> None:
|
|
41
42
|
"""Configure logging of the server."""
|
|
42
43
|
if log_level is None: # Log level NOTSET is 0 so we use `is None` here
|
|
@@ -75,6 +76,9 @@ def configure_structlog(
|
|
|
75
76
|
if include_time:
|
|
76
77
|
shared_processors.append(structlog.processors.TimeStamper(fmt="iso"))
|
|
77
78
|
|
|
79
|
+
if additional_processors:
|
|
80
|
+
shared_processors.extend(additional_processors)
|
|
81
|
+
|
|
78
82
|
if not FORCE_JSON_LOGGING and sys.stderr.isatty():
|
|
79
83
|
# Pretty printing when we run in a terminal session.
|
|
80
84
|
# Automatically prints pretty tracebacks when "rich" is installed
|