rasa-pro 3.14.0.dev20250825__py3-none-any.whl → 3.14.0.dev20250922__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 +92 -0
- rasa/builder/copilot/__init__.py +0 -0
- rasa/builder/copilot/constants.py +31 -0
- rasa/builder/copilot/copilot.py +450 -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 +500 -0
- rasa/builder/copilot/prompts/__init__.py +0 -0
- rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +766 -0
- rasa/builder/copilot/prompts/latest_user_message_context_prompt.jinja2 +61 -0
- rasa/builder/copilot/signing.py +305 -0
- rasa/builder/copilot/telemetry.py +226 -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 +140 -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 +282 -0
- rasa/builder/llm_service.py +246 -0
- rasa/builder/logging_utils.py +265 -0
- rasa/builder/main.py +234 -0
- rasa/builder/models.py +216 -0
- rasa/builder/project_generator.py +458 -0
- rasa/builder/project_info.py +72 -0
- rasa/builder/scrape_rasa_docs.py +97 -0
- rasa/builder/service.py +1350 -0
- rasa/builder/shared/tracker_context.py +212 -0
- rasa/builder/skill_to_bot_prompt.jinja2 +164 -0
- rasa/builder/template_cache.py +69 -0
- rasa/builder/training_service.py +194 -0
- rasa/builder/validation_service.py +97 -0
- rasa/cli/project_templates/basic/README.md +23 -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/actions/actions.md +10 -0
- rasa/cli/project_templates/basic/config.yml +29 -0
- rasa/cli/project_templates/basic/credentials.yml +33 -0
- rasa/cli/project_templates/basic/data/data.md +8 -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 +11 -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 +67 -0
- rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
- rasa/cli/project_templates/default/config.yml +4 -0
- rasa/cli/project_templates/default/endpoints.yml +4 -0
- rasa/cli/project_templates/finance/README.md +26 -0
- rasa/cli/project_templates/finance/actions/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
- rasa/cli/project_templates/finance/actions/actions.md +15 -0
- rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/cards/check_that_card_exists.py +21 -0
- rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
- rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
- rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
- rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
- rasa/cli/project_templates/finance/actions/db.py +117 -0
- rasa/cli/project_templates/finance/actions/general/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/general/action_human_handoff.py +49 -0
- rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
- rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
- rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
- rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
- rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
- rasa/cli/project_templates/finance/config.yml +29 -0
- rasa/cli/project_templates/finance/credentials.yml +33 -0
- rasa/cli/project_templates/finance/data/accounts/check_balance.yml +9 -0
- rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
- rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
- rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
- rasa/cli/project_templates/finance/data/cards/block_card.yml +45 -0
- rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
- rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
- rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
- rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
- rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
- rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
- rasa/cli/project_templates/finance/data/data.md +14 -0
- rasa/cli/project_templates/finance/data/general/bot_challenge.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 +6 -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_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/transfers/check_transfer_limit.yml +18 -0
- rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
- rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
- rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +34 -0
- rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
- rasa/cli/project_templates/finance/db/cards.json +18 -0
- rasa/cli/project_templates/finance/db/contacts.json +10 -0
- rasa/cli/project_templates/finance/db/my_account.json +6 -0
- rasa/cli/project_templates/finance/db/transactions.json +22 -0
- rasa/cli/project_templates/finance/docs/docs.md +8 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
- rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +15 -0
- rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
- rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
- rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
- rasa/cli/project_templates/finance/domain/cards/block_card.yml +44 -0
- rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
- rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
- rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
- rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
- rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
- rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
- rasa/cli/project_templates/finance/domain/domain.md +18 -0
- rasa/cli/project_templates/finance/domain/general/_shared.yml +39 -0
- rasa/cli/project_templates/finance/domain/general/bot_challenge.yml +4 -0
- rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +8 -0
- rasa/cli/project_templates/finance/domain/general/feedback.yml +25 -0
- rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +31 -0
- rasa/cli/project_templates/finance/domain/general/welcome.yml +39 -0
- rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
- rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
- rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
- rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +221 -0
- rasa/cli/project_templates/finance/endpoints.yml +67 -0
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/check_balance.yml +9 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/download_statements.yml +43 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/cards/block_card.yml +55 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/feedback.yml +46 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/goodbye.yml +9 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/hello.yml +8 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/human_handoff.yml +35 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/patterns.yml +22 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/transfers/transfer_money.yml +56 -0
- rasa/cli/project_templates/telco/README.md +25 -0
- rasa/cli/project_templates/telco/actions/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/actions.md +12 -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 +29 -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/data.md +11 -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 +8 -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/understand_bill.yml +102 -0
- rasa/cli/project_templates/telco/domain/domain.md +13 -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 +26 -0
- rasa/cli/project_templates/telco/domain/general/patterns.yml +33 -0
- rasa/cli/project_templates/telco/domain/network/reboot_router.yml +21 -0
- rasa/cli/project_templates/telco/domain/network/reset_router.yml +12 -0
- rasa/cli/project_templates/telco/domain/network/run_speed_test.yml +25 -0
- rasa/cli/project_templates/telco/domain/network/solve_internet_issue.yml +75 -0
- rasa/cli/project_templates/telco/domain/shared.yml +129 -0
- rasa/cli/project_templates/telco/endpoints.yml +67 -0
- rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +40 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/billing/understand_bill.yml +67 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +46 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/goodbye.yml +9 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +8 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +35 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +23 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/network/solve_internet_issue.yml +57 -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/actions/action_run_slot_rejections.py +1 -1
- rasa/core/actions/direct_custom_actions_executor.py +9 -2
- rasa/core/brokers/broker.py +1 -1
- rasa/core/brokers/kafka.py +52 -8
- rasa/core/channels/development_inspector.py +1 -21
- rasa/core/channels/hangouts.py +2 -2
- rasa/core/channels/inspector/dist/assets/{arc-1ddec37b.js → arc-35222594.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-18af387c.js → blockDiagram-38ab4fdb-a0efbfd3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-250127a3.js → c4Diagram-3d4e48cf-0584c0f2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-8e08bed9.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-c3388b34.js → classDiagram-70f12bd4-39f40dbe.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-9c893a82.js → classDiagram-v2-f2320105-1ad755f3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-78c82dea.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-c111213b.js → createText-2e5e7dd3-b0f4f0fe.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-812a729d.js → edges-e0da2a9e-9039bff9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-fd5051bc.js → erDiagram-9861fffd-65c9b127.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-3287ac02.js → flowDb-956e92f1-4f08b38e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-692fb0b2.js → flowDiagram-66a62f08-e95c362a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b08f601.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-008376f1.js → flowchart-elk-definition-4a651766-703c3015.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-df330a69.js → ganttDiagram-c361ad54-699328ea.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-e03676fb.js → gitGraphDiagram-72cf32ee-04cf4b05.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-46fad2ba.js → graph-ee94449e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-a484ac55.js → index-3862675e-940162b4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-a003633f.js → index-c941dcb3.js} +239 -238
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-3f9e6ec2.js → infoDiagram-f8f76790-c79c2866.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-79f72383.js → journeyDiagram-49397b02-84489d30.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-aad098e5.js → layout-a9aa9858.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-219ab7ae.js → line-eb73cf26.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-2cddbe62.js → linear-b3399f9a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-1d41ed99.js → mindmap-definition-fc14e90a-b095bf1a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-cc496ee8.js → pieDiagram-8a3498a8-07644b66.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-84d32884.js → quadrantDiagram-120e2f19-573a3f9c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-c0deb984.js → requirementDiagram-deff3bca-d457e1e1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-b9d7fd62.js → sankeyDiagram-04a897e0-9d26e1a2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-7d517565.js → sequenceDiagram-704730f1-3a9cde10.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-98ef9b27.js → stateDiagram-587899a1-4f3e8cec.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-cee70748.js → stateDiagram-v2-d93cdb3a-e617e5bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-3f9d1c96.js → styles-6aaf32cf-eab30d2f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-67471923.js → styles-9a916d00-09994be2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-bd093fb7.js → styles-c10674c1-b7110364.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-675794e8.js → svgDrawCommon-08f97a94-3ebc92ad.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-0ac67617.js → timeline-definition-85554ec2-7d13d2f2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-c018dc37.js → xychartDiagram-e933f94c-488385e1.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 +15 -42
- rasa/core/channels/inspector/src/components/Chat.tsx +2 -3
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +20 -3
- rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +63 -35
- rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +14 -0
- rasa/core/channels/inspector/src/types.ts +32 -7
- rasa/core/channels/studio_chat.py +43 -43
- rasa/core/channels/voice_stream/asr/asr_event.py +1 -1
- rasa/core/channels/voice_stream/asr/azure.py +6 -3
- rasa/core/channels/voice_stream/asr/deepgram.py +1 -1
- rasa/core/channels/voice_stream/audiocodes.py +3 -0
- rasa/core/channels/voice_stream/browser_audio.py +55 -3
- rasa/core/channels/voice_stream/genesys.py +2 -1
- rasa/core/channels/voice_stream/jambonz.py +9 -1
- rasa/core/channels/voice_stream/twilio_media_streams.py +16 -0
- rasa/core/channels/voice_stream/voice_channel.py +61 -0
- rasa/core/concurrent_lock_store.py +66 -16
- rasa/core/constants.py +7 -0
- rasa/core/iam_credentials_providers/__init__.py +0 -0
- rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +226 -0
- rasa/core/iam_credentials_providers/credentials_provider_protocol.py +90 -0
- rasa/core/lock_store.py +46 -10
- rasa/core/nlg/generator.py +1 -1
- rasa/core/policies/enterprise_search_policy.py +4 -7
- rasa/core/policies/flows/flow_executor.py +9 -2
- rasa/core/processor.py +32 -0
- rasa/core/redis_connection_factory.py +469 -0
- rasa/core/tracker_stores/redis_tracker_store.py +32 -14
- rasa/core/tracker_stores/sql_tracker_store.py +57 -1
- rasa/dialogue_understanding/generator/flow_retrieval.py +10 -9
- rasa/engine/graph.py +5 -1
- rasa/engine/loader.py +12 -0
- rasa/engine/storage/local_model_storage.py +83 -3
- rasa/model_manager/model_api.py +1 -2
- rasa/model_manager/runner_service.py +1 -1
- rasa/model_manager/socket_bridge.py +1 -2
- rasa/model_manager/trainer_service.py +12 -9
- rasa/model_manager/utils.py +1 -29
- rasa/model_manager/warm_rasa_process.py +13 -3
- rasa/shared/core/constants.py +1 -0
- rasa/shared/core/domain.py +62 -15
- rasa/shared/core/events.py +2 -0
- rasa/shared/core/flows/flow.py +1 -1
- 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/shared/nlu/training_data/schemas/responses.yml +3 -0
- 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/utils/pypred.py +38 -0
- rasa/validator.py +19 -11
- rasa/version.py +1 -1
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/METADATA +27 -25
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/RECORD +348 -109
- 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.dev20250922.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/entry_points.txt +0 -0
rasa/engine/graph.py
CHANGED
|
@@ -69,6 +69,7 @@ class SchemaNode:
|
|
|
69
69
|
|
|
70
70
|
def matches_type(self, node_type: Type, include_subtypes: bool = True) -> bool:
|
|
71
71
|
"""Checks if schema node's 'uses' is of specified node type.
|
|
72
|
+
|
|
72
73
|
By default, it also checks for subtypes of the specified node type.
|
|
73
74
|
"""
|
|
74
75
|
return (self.uses is node_type) or (
|
|
@@ -171,6 +172,7 @@ class GraphSchema:
|
|
|
171
172
|
|
|
172
173
|
def has_node(self, node_type: Type, include_subtypes: bool = True) -> bool:
|
|
173
174
|
"""Checks if the graph schema contains a node of the specified node type.
|
|
175
|
+
|
|
174
176
|
By default, it also checks for subtypes of the specified node type.
|
|
175
177
|
"""
|
|
176
178
|
for node in self.nodes.values():
|
|
@@ -181,7 +183,7 @@ class GraphSchema:
|
|
|
181
183
|
def count_nodes_of_a_given_type(
|
|
182
184
|
self, node_type: Type, include_subtypes: bool = True
|
|
183
185
|
) -> int:
|
|
184
|
-
"""Counts the number of the nodes of specified class"""
|
|
186
|
+
"""Counts the number of the nodes of specified class."""
|
|
185
187
|
counter = 0
|
|
186
188
|
for node in self.nodes.values():
|
|
187
189
|
if (node.uses is node_type) or (
|
|
@@ -353,6 +355,7 @@ class ExecutionContext:
|
|
|
353
355
|
|
|
354
356
|
def has_node(self, node_type: Type, include_subtypes: bool = True) -> bool:
|
|
355
357
|
"""Checks if the graph node of the given type is present in the graph schema.
|
|
358
|
+
|
|
356
359
|
By default, it also checks for subtypes of the specified node type.
|
|
357
360
|
"""
|
|
358
361
|
return self.graph_schema.has_node(node_type, include_subtypes)
|
|
@@ -555,6 +558,7 @@ class GraphNode:
|
|
|
555
558
|
structlogger.error(
|
|
556
559
|
"graph.node.error_running_component",
|
|
557
560
|
node_name=self._node_name,
|
|
561
|
+
error=str(e),
|
|
558
562
|
)
|
|
559
563
|
raise
|
|
560
564
|
|
rasa/engine/loader.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Tuple, Type
|
|
3
3
|
|
|
4
|
+
import structlog
|
|
5
|
+
|
|
4
6
|
from rasa.engine.graph import ExecutionContext
|
|
5
7
|
from rasa.engine.runner.interface import GraphRunner
|
|
6
8
|
from rasa.engine.storage.storage import ModelMetadata, ModelStorage
|
|
@@ -9,6 +11,8 @@ from rasa.engine.validation import (
|
|
|
9
11
|
validate_model_group_configuration_setup,
|
|
10
12
|
)
|
|
11
13
|
|
|
14
|
+
structlogger = structlog.get_logger()
|
|
15
|
+
|
|
12
16
|
|
|
13
17
|
def load_predict_graph_runner(
|
|
14
18
|
storage_path: Path,
|
|
@@ -30,6 +34,10 @@ def load_predict_graph_runner(
|
|
|
30
34
|
model_storage, model_metadata = model_storage_class.from_model_archive(
|
|
31
35
|
storage_path=storage_path, model_archive_path=model_archive_path
|
|
32
36
|
)
|
|
37
|
+
structlogger.debug(
|
|
38
|
+
"engine.loader.load_predict_graph_runner.success",
|
|
39
|
+
model_id=model_metadata.model_id,
|
|
40
|
+
)
|
|
33
41
|
|
|
34
42
|
# Components using LLMs or embeddings can reference model groups defined in
|
|
35
43
|
# the endpoints.yml file for their client configurations. To ensure they will work
|
|
@@ -38,6 +46,10 @@ def load_predict_graph_runner(
|
|
|
38
46
|
validate_model_group_configuration_setup()
|
|
39
47
|
validate_model_client_configuration_setup_during_inference_time(model_metadata)
|
|
40
48
|
|
|
49
|
+
structlogger.debug(
|
|
50
|
+
"engine.loader.config.validation.success",
|
|
51
|
+
model_id=model_metadata.model_id,
|
|
52
|
+
)
|
|
41
53
|
runner = graph_runner_class.create(
|
|
42
54
|
graph_schema=model_metadata.predict_schema,
|
|
43
55
|
model_storage=model_storage,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import os
|
|
4
5
|
import shutil
|
|
5
6
|
import sys
|
|
7
|
+
import tarfile
|
|
6
8
|
import tempfile
|
|
7
9
|
import uuid
|
|
8
10
|
from contextlib import contextmanager
|
|
9
11
|
from datetime import datetime
|
|
10
12
|
from pathlib import Path
|
|
11
|
-
from typing import Generator, Optional, Text, Tuple, Union
|
|
13
|
+
from typing import Callable, Generator, List, Optional, Text, Tuple, Union
|
|
12
14
|
|
|
13
15
|
from tarsafe import TarSafe
|
|
14
16
|
|
|
@@ -57,6 +59,35 @@ def windows_safe_temporary_directory(
|
|
|
57
59
|
yield temporary_directory
|
|
58
60
|
|
|
59
61
|
|
|
62
|
+
def filter_normpath(member: tarfile.TarInfo, dest_path: str) -> tarfile.TarInfo:
|
|
63
|
+
"""Normalize tar member paths for safe extraction"""
|
|
64
|
+
if member.name:
|
|
65
|
+
member.name = os.path.normpath(member.name)
|
|
66
|
+
return member
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
FilterFunction = Callable[[tarfile.TarInfo, str], Optional[tarfile.TarInfo]]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def create_combined_filter(existing_filter: Optional[FilterFunction]) -> FilterFunction:
|
|
73
|
+
"""Create a filter that combines existing filter with path normalization"""
|
|
74
|
+
|
|
75
|
+
def combined_filter(
|
|
76
|
+
member: tarfile.TarInfo, dest_path: str
|
|
77
|
+
) -> Optional[tarfile.TarInfo]:
|
|
78
|
+
"""Apply existing filter first, then path normalization"""
|
|
79
|
+
if existing_filter is not None:
|
|
80
|
+
filtered_member = existing_filter(member, dest_path)
|
|
81
|
+
if filtered_member is None:
|
|
82
|
+
return None # Rejected by existing filter
|
|
83
|
+
member = filtered_member # Use the filtered result
|
|
84
|
+
|
|
85
|
+
# Apply our path normalization
|
|
86
|
+
return filter_normpath(member, dest_path)
|
|
87
|
+
|
|
88
|
+
return combined_filter
|
|
89
|
+
|
|
90
|
+
|
|
60
91
|
class LocalModelStorage(ModelStorage):
|
|
61
92
|
"""Stores and provides output of `GraphComponents` on local disk."""
|
|
62
93
|
|
|
@@ -122,9 +153,29 @@ class LocalModelStorage(ModelStorage):
|
|
|
122
153
|
# this restriction in environments where it's not possible
|
|
123
154
|
# to override this behavior, mostly for internal policy reasons
|
|
124
155
|
# reference: https://stackoverflow.com/a/49102229
|
|
125
|
-
|
|
156
|
+
try:
|
|
157
|
+
# Use extraction filter to normalize paths for compatibility
|
|
158
|
+
# before trying the \\?\ prefix approach first
|
|
159
|
+
prev_filter = getattr(tar, "extraction_filter", None)
|
|
160
|
+
tar.extraction_filter = create_combined_filter(prev_filter)
|
|
161
|
+
tar.extractall(
|
|
162
|
+
f"\\\\?\\{temporary_directory}",
|
|
163
|
+
members=yield_safe_members(tar.getmembers()),
|
|
164
|
+
)
|
|
165
|
+
except Exception:
|
|
166
|
+
# Fallback for Python versions with tarfile security fix
|
|
167
|
+
logger.warning(
|
|
168
|
+
"Failed to extract model archive with long path support. "
|
|
169
|
+
"Falling back to regular extraction."
|
|
170
|
+
)
|
|
171
|
+
tar.extractall(
|
|
172
|
+
temporary_directory,
|
|
173
|
+
members=yield_safe_members(tar.getmembers()),
|
|
174
|
+
)
|
|
126
175
|
else:
|
|
127
|
-
tar.extractall(
|
|
176
|
+
tar.extractall(
|
|
177
|
+
temporary_directory, members=yield_safe_members(tar.getmembers())
|
|
178
|
+
)
|
|
128
179
|
LocalModelStorage._assert_not_rasa2_archive(temporary_directory)
|
|
129
180
|
|
|
130
181
|
@staticmethod
|
|
@@ -244,3 +295,32 @@ class LocalModelStorage(ModelStorage):
|
|
|
244
295
|
core_target=model_configuration.core_target,
|
|
245
296
|
nlu_target=model_configuration.nlu_target,
|
|
246
297
|
)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def yield_safe_members(
|
|
301
|
+
members: List[tarfile.TarInfo],
|
|
302
|
+
) -> Generator[tarfile.TarInfo, None, None]:
|
|
303
|
+
"""
|
|
304
|
+
Filter function for tar.extractall members parameter.
|
|
305
|
+
Validates each member and yields only safe ones.
|
|
306
|
+
|
|
307
|
+
Args:
|
|
308
|
+
members: Iterator of TarInfo objects from tar.getmembers()
|
|
309
|
+
|
|
310
|
+
Yields:
|
|
311
|
+
TarInfo: Safe members to extract
|
|
312
|
+
"""
|
|
313
|
+
for member in members:
|
|
314
|
+
# Skip absolute paths
|
|
315
|
+
if Path(member.name).is_absolute():
|
|
316
|
+
continue
|
|
317
|
+
|
|
318
|
+
# Skip paths with directory traversal sequences
|
|
319
|
+
if ".." in member.name or "\\.." in member.name:
|
|
320
|
+
continue
|
|
321
|
+
|
|
322
|
+
# Skip special file types unless you need them
|
|
323
|
+
if member.isdev() or member.issym():
|
|
324
|
+
continue
|
|
325
|
+
|
|
326
|
+
yield member
|
rasa/model_manager/model_api.py
CHANGED
|
@@ -39,11 +39,9 @@ from rasa.model_manager.trainer_service import (
|
|
|
39
39
|
update_training_status,
|
|
40
40
|
)
|
|
41
41
|
from rasa.model_manager.utils import (
|
|
42
|
-
InvalidPathException,
|
|
43
42
|
get_logs_content,
|
|
44
43
|
logs_base_path,
|
|
45
44
|
models_base_path,
|
|
46
|
-
subpath,
|
|
47
45
|
)
|
|
48
46
|
from rasa.model_manager.warm_rasa_process import (
|
|
49
47
|
initialize_warm_rasa_process,
|
|
@@ -53,6 +51,7 @@ from rasa.server import ErrorResponse
|
|
|
53
51
|
from rasa.shared.exceptions import InvalidConfigException
|
|
54
52
|
from rasa.shared.utils.yaml import dump_obj_as_yaml_to_string
|
|
55
53
|
from rasa.studio.upload import build_calm_import_parts
|
|
54
|
+
from rasa.utils.io import InvalidPathException, subpath
|
|
56
55
|
|
|
57
56
|
dotenv.load_dotenv()
|
|
58
57
|
|
|
@@ -15,11 +15,11 @@ from rasa.model_manager import config
|
|
|
15
15
|
from rasa.model_manager.utils import (
|
|
16
16
|
logs_path,
|
|
17
17
|
models_base_path,
|
|
18
|
-
subpath,
|
|
19
18
|
write_encoded_data_to_file,
|
|
20
19
|
)
|
|
21
20
|
from rasa.model_manager.warm_rasa_process import start_rasa_process
|
|
22
21
|
from rasa.studio.prompts import handle_prompts
|
|
22
|
+
from rasa.utils.io import subpath
|
|
23
23
|
|
|
24
24
|
structlogger = structlog.get_logger()
|
|
25
25
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import json
|
|
2
1
|
from typing import Any, Dict, Optional
|
|
3
2
|
|
|
4
3
|
import structlog
|
|
@@ -145,7 +144,7 @@ async def create_bridge_client(
|
|
|
145
144
|
|
|
146
145
|
@client.event # type: ignore[misc]
|
|
147
146
|
async def tracker(data: Dict[str, Any]) -> None:
|
|
148
|
-
await sio_server.emit("tracker",
|
|
147
|
+
await sio_server.emit("tracker", data, room=sid)
|
|
149
148
|
|
|
150
149
|
@client.event # type: ignore[misc]
|
|
151
150
|
async def disconnect() -> None:
|
|
@@ -14,7 +14,6 @@ from rasa.model_manager.utils import (
|
|
|
14
14
|
ensure_base_directory_exists,
|
|
15
15
|
logs_path,
|
|
16
16
|
models_base_path,
|
|
17
|
-
subpath,
|
|
18
17
|
write_encoded_data_to_file,
|
|
19
18
|
)
|
|
20
19
|
from rasa.model_manager.warm_rasa_process import (
|
|
@@ -22,6 +21,7 @@ from rasa.model_manager.warm_rasa_process import (
|
|
|
22
21
|
)
|
|
23
22
|
from rasa.model_training import generate_random_model_name
|
|
24
23
|
from rasa.studio.prompts import handle_prompts
|
|
24
|
+
from rasa.utils.io import subpath
|
|
25
25
|
|
|
26
26
|
structlogger = structlog.get_logger()
|
|
27
27
|
|
|
@@ -53,6 +53,15 @@ class TrainingSession(BaseModel):
|
|
|
53
53
|
"""Check if the training is running."""
|
|
54
54
|
return self.status == TrainingSessionStatus.RUNNING
|
|
55
55
|
|
|
56
|
+
def has_just_finished(self) -> bool:
|
|
57
|
+
if not self.is_status_indicating_alive():
|
|
58
|
+
# skip if the training is not running
|
|
59
|
+
return False
|
|
60
|
+
if self.process.poll() is None:
|
|
61
|
+
# process is still running
|
|
62
|
+
return False
|
|
63
|
+
return True
|
|
64
|
+
|
|
56
65
|
def model_path(self) -> str:
|
|
57
66
|
"""Return the path to the model."""
|
|
58
67
|
return subpath(models_base_path(), f"{self.model_name}.tar.gz")
|
|
@@ -89,14 +98,8 @@ def terminate_training(training: TrainingSession) -> None:
|
|
|
89
98
|
|
|
90
99
|
|
|
91
100
|
def update_training_status(training: TrainingSession) -> None:
|
|
92
|
-
if
|
|
93
|
-
|
|
94
|
-
return
|
|
95
|
-
if training.process.poll() is None:
|
|
96
|
-
# process is still running
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
complete_training(training)
|
|
101
|
+
if training.has_just_finished():
|
|
102
|
+
complete_training(training)
|
|
100
103
|
|
|
101
104
|
|
|
102
105
|
def complete_training(training: TrainingSession) -> None:
|
rasa/model_manager/utils.py
CHANGED
|
@@ -5,15 +5,11 @@ from typing import Optional
|
|
|
5
5
|
import structlog
|
|
6
6
|
|
|
7
7
|
from rasa.model_manager import config
|
|
8
|
-
from rasa.
|
|
8
|
+
from rasa.utils.io import subpath
|
|
9
9
|
|
|
10
10
|
structlogger = structlog.get_logger()
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class InvalidPathException(RasaException):
|
|
14
|
-
"""Raised if a path is invalid - e.g. path traversal is detected."""
|
|
15
|
-
|
|
16
|
-
|
|
17
13
|
def write_encoded_data_to_file(encoded_data: bytes, file: str) -> None:
|
|
18
14
|
"""Write base64 encoded data to a file."""
|
|
19
15
|
# create the directory if it does not exist of the parent directory
|
|
@@ -53,30 +49,6 @@ def logs_path(action_id: str) -> str:
|
|
|
53
49
|
return subpath(logs_base_path(), f"{action_id}.txt")
|
|
54
50
|
|
|
55
51
|
|
|
56
|
-
def subpath(parent: str, child: str) -> str:
|
|
57
|
-
"""Return the path to the child directory of the parent directory.
|
|
58
|
-
|
|
59
|
-
Ensures, that child doesn't navigate to parent directories. Prevents
|
|
60
|
-
path traversal. Raises an InvalidPathException if the path is invalid.
|
|
61
|
-
|
|
62
|
-
Based on Snyk's directory traversal mitigation:
|
|
63
|
-
https://learn.snyk.io/lesson/directory-traversal/
|
|
64
|
-
"""
|
|
65
|
-
safe_path = os.path.abspath(os.path.join(parent, child))
|
|
66
|
-
parent = os.path.abspath(parent)
|
|
67
|
-
|
|
68
|
-
common_base = os.path.commonpath([parent, safe_path])
|
|
69
|
-
if common_base != parent:
|
|
70
|
-
raise InvalidPathException(f"Invalid path: {safe_path}")
|
|
71
|
-
|
|
72
|
-
if os.path.basename(safe_path) != child:
|
|
73
|
-
raise InvalidPathException(
|
|
74
|
-
f"Invalid path - path traversal detected: {safe_path}"
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
return safe_path
|
|
78
|
-
|
|
79
|
-
|
|
80
52
|
def get_logs_content(action_id: str) -> Optional[str]:
|
|
81
53
|
"""Return the content of the log file for a given action id."""
|
|
82
54
|
try:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import shlex
|
|
3
3
|
import subprocess
|
|
4
|
+
import time
|
|
4
5
|
import uuid
|
|
5
6
|
from dataclasses import dataclass
|
|
6
7
|
from typing import List
|
|
@@ -149,19 +150,28 @@ def warmup() -> None:
|
|
|
149
150
|
We import them now, so that the training / deployment can later
|
|
150
151
|
directly start.
|
|
151
152
|
"""
|
|
153
|
+
start_time = time.time()
|
|
152
154
|
try:
|
|
153
155
|
import langchain # noqa: F401
|
|
154
156
|
import litellm # noqa: F401
|
|
155
157
|
import matplotlib # noqa: F401
|
|
156
158
|
import numpy # noqa: F401
|
|
157
159
|
import pandas # noqa: F401
|
|
158
|
-
import presidio_analyzer # noqa: F401
|
|
159
|
-
import spacy # noqa: F401
|
|
160
160
|
import tensorflow # noqa: F401
|
|
161
161
|
|
|
162
162
|
import rasa.validator # noqa: F401
|
|
163
|
-
except ImportError:
|
|
163
|
+
except ImportError as e:
|
|
164
|
+
structlogger.warning(
|
|
165
|
+
"model_trainer.warmup_error",
|
|
166
|
+
error=str(e),
|
|
167
|
+
)
|
|
164
168
|
pass
|
|
169
|
+
finally:
|
|
170
|
+
end_time = time.time()
|
|
171
|
+
structlogger.debug(
|
|
172
|
+
"model_trainer.warmup_time",
|
|
173
|
+
time_in_seconds=end_time - start_time,
|
|
174
|
+
)
|
|
165
175
|
|
|
166
176
|
|
|
167
177
|
def warm_rasa_main() -> None:
|
rasa/shared/core/constants.py
CHANGED
|
@@ -55,6 +55,7 @@ ACTION_REPEAT_BOT_MESSAGES = "action_repeat_bot_messages"
|
|
|
55
55
|
|
|
56
56
|
ACTION_METADATA_EXECUTION_SUCCESS = "execution_success"
|
|
57
57
|
ACTION_METADATA_EXECUTION_ERROR_MESSAGE = "execution_error_message"
|
|
58
|
+
ACTION_METADATA_EXECUTION_TIME = "execution_times"
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
DEFAULT_ACTION_NAMES = [
|
rasa/shared/core/domain.py
CHANGED
|
@@ -98,6 +98,8 @@ IS_RETRIEVAL_INTENT_KEY = "is_retrieval_intent"
|
|
|
98
98
|
ENTITY_ROLES_KEY = "roles"
|
|
99
99
|
ENTITY_GROUPS_KEY = "groups"
|
|
100
100
|
ENTITY_FEATURIZATION_KEY = "influence_conversation"
|
|
101
|
+
STORE_ENTITIES_AS_SLOTS_KEY = "store_entities_as_slots"
|
|
102
|
+
DOMAIN_CONFIG_KEY = "config"
|
|
101
103
|
|
|
102
104
|
KEY_SLOTS = "slots"
|
|
103
105
|
KEY_INTENTS = "intents"
|
|
@@ -146,6 +148,8 @@ MERGE_FUNC_MAPPING: Dict[Text, Callable[..., Any]] = {
|
|
|
146
148
|
KEY_FORMS: rasa.shared.utils.common.merge_dicts,
|
|
147
149
|
}
|
|
148
150
|
|
|
151
|
+
DEFAULT_STORE_ENTITIES_AS_SLOTS = True
|
|
152
|
+
|
|
149
153
|
DICT_DATA_KEYS = [
|
|
150
154
|
key
|
|
151
155
|
for key, value in MERGE_FUNC_MAPPING.items()
|
|
@@ -318,7 +322,7 @@ class Domain:
|
|
|
318
322
|
actions = cls._collect_action_names(domain_actions)
|
|
319
323
|
|
|
320
324
|
additional_arguments = {
|
|
321
|
-
**data.get(
|
|
325
|
+
**data.get(DOMAIN_CONFIG_KEY, {}),
|
|
322
326
|
"actions_which_explicitly_need_domain": (
|
|
323
327
|
cls._collect_actions_which_explicitly_need_domain(domain_actions)
|
|
324
328
|
),
|
|
@@ -468,9 +472,9 @@ class Domain:
|
|
|
468
472
|
return domain_dict
|
|
469
473
|
|
|
470
474
|
if override:
|
|
471
|
-
config = domain_dict.get(
|
|
475
|
+
config = domain_dict.get(DOMAIN_CONFIG_KEY, {})
|
|
472
476
|
for key, val in config.items():
|
|
473
|
-
combined[
|
|
477
|
+
combined[DOMAIN_CONFIG_KEY][key] = val
|
|
474
478
|
|
|
475
479
|
if (
|
|
476
480
|
override
|
|
@@ -508,10 +512,10 @@ class Domain:
|
|
|
508
512
|
return combined
|
|
509
513
|
|
|
510
514
|
def partial_merge(self, other: Domain) -> Domain:
|
|
511
|
-
"""
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
+
"""Returns a new Domain with intersection-based merging.
|
|
516
|
+
|
|
517
|
+
For each domain section only overwrite items that already exist in self.
|
|
518
|
+
Brand-new items in `other` are ignored.
|
|
515
519
|
|
|
516
520
|
Args:
|
|
517
521
|
other: The domain to merge with.
|
|
@@ -543,9 +547,9 @@ class Domain:
|
|
|
543
547
|
return Domain.from_dict(updated_self)
|
|
544
548
|
|
|
545
549
|
def difference(self, other: Domain) -> Domain:
|
|
546
|
-
"""
|
|
547
|
-
|
|
548
|
-
|
|
550
|
+
"""Returns a new Domain containing items in `self` that are NOT in `other`.
|
|
551
|
+
|
|
552
|
+
Uses simple equality checks for dict/list items.
|
|
549
553
|
|
|
550
554
|
Args:
|
|
551
555
|
other: The domain to compare with.
|
|
@@ -598,9 +602,16 @@ class Domain:
|
|
|
598
602
|
) -> Dict:
|
|
599
603
|
# add the config, session_config and training data version defaults
|
|
600
604
|
# if not included in the original domain dict
|
|
601
|
-
if
|
|
605
|
+
if (
|
|
606
|
+
DOMAIN_CONFIG_KEY not in data
|
|
607
|
+
and store_entities_as_slots != DEFAULT_STORE_ENTITIES_AS_SLOTS
|
|
608
|
+
):
|
|
602
609
|
data.update(
|
|
603
|
-
{
|
|
610
|
+
{
|
|
611
|
+
DOMAIN_CONFIG_KEY: {
|
|
612
|
+
STORE_ENTITIES_AS_SLOTS_KEY: store_entities_as_slots
|
|
613
|
+
}
|
|
614
|
+
}
|
|
604
615
|
)
|
|
605
616
|
|
|
606
617
|
if SESSION_CONFIG_KEY not in data:
|
|
@@ -937,7 +948,7 @@ class Domain:
|
|
|
937
948
|
forms: Union[Dict[Text, Any], List[Text]],
|
|
938
949
|
data: Dict,
|
|
939
950
|
action_texts: Optional[List[Text]] = None,
|
|
940
|
-
store_entities_as_slots: bool =
|
|
951
|
+
store_entities_as_slots: bool = DEFAULT_STORE_ENTITIES_AS_SLOTS,
|
|
941
952
|
session_config: SessionConfig = SessionConfig.default(),
|
|
942
953
|
**kwargs: Any,
|
|
943
954
|
) -> None:
|
|
@@ -1711,9 +1722,45 @@ class Domain:
|
|
|
1711
1722
|
else:
|
|
1712
1723
|
return True
|
|
1713
1724
|
|
|
1714
|
-
def
|
|
1725
|
+
def _uses_custom_session_config(self) -> bool:
|
|
1726
|
+
"""Check if the domain uses a custom session config."""
|
|
1727
|
+
return self._data.get(SESSION_CONFIG_KEY) != SessionConfig.default().as_dict()
|
|
1728
|
+
|
|
1729
|
+
def _uses_custom_domain_config(self) -> bool:
|
|
1730
|
+
"""Check if the domain uses a custom domain config."""
|
|
1731
|
+
return self._data.get(DOMAIN_CONFIG_KEY) != {
|
|
1732
|
+
STORE_ENTITIES_AS_SLOTS_KEY: DEFAULT_STORE_ENTITIES_AS_SLOTS
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
def _cleaned_json_data(self) -> Dict[Text, Any]:
|
|
1736
|
+
"""Remove default values from the domain data.
|
|
1737
|
+
|
|
1738
|
+
Only retains data that was customized by the user.
|
|
1739
|
+
|
|
1740
|
+
Returns:
|
|
1741
|
+
A cleaned dictionary version of the domain.
|
|
1742
|
+
"""
|
|
1743
|
+
cleaned_data = copy.deepcopy(self._data)
|
|
1744
|
+
|
|
1745
|
+
# Remove default config if it only contains store_entities_as_slots: False
|
|
1746
|
+
if DOMAIN_CONFIG_KEY in cleaned_data and not self._uses_custom_domain_config():
|
|
1747
|
+
del cleaned_data[DOMAIN_CONFIG_KEY]
|
|
1748
|
+
|
|
1749
|
+
# Remove default session config if it matches the default values
|
|
1750
|
+
if (
|
|
1751
|
+
SESSION_CONFIG_KEY in cleaned_data
|
|
1752
|
+
and not self._uses_custom_session_config()
|
|
1753
|
+
):
|
|
1754
|
+
del cleaned_data[SESSION_CONFIG_KEY]
|
|
1755
|
+
|
|
1756
|
+
return cleaned_data
|
|
1757
|
+
|
|
1758
|
+
def as_dict(self, should_clean_json: bool = False) -> Dict[Text, Any]:
|
|
1715
1759
|
"""Return serialized `Domain`."""
|
|
1716
|
-
|
|
1760
|
+
if should_clean_json:
|
|
1761
|
+
return self._cleaned_json_data()
|
|
1762
|
+
else:
|
|
1763
|
+
return self._data
|
|
1717
1764
|
|
|
1718
1765
|
@staticmethod
|
|
1719
1766
|
def get_responses_with_multilines(
|
rasa/shared/core/events.py
CHANGED
|
@@ -35,6 +35,7 @@ from rasa.shared.core.constants import (
|
|
|
35
35
|
ACTION_LISTEN_NAME,
|
|
36
36
|
ACTION_METADATA_EXECUTION_ERROR_MESSAGE,
|
|
37
37
|
ACTION_METADATA_EXECUTION_SUCCESS,
|
|
38
|
+
ACTION_METADATA_EXECUTION_TIME,
|
|
38
39
|
ACTION_NAME_SENDER_ID_CONNECTOR_STR,
|
|
39
40
|
ACTION_SESSION_START_NAME,
|
|
40
41
|
ENTITY_LABEL_SEPARATOR,
|
|
@@ -1815,6 +1816,7 @@ class ActionExecuted(Event):
|
|
|
1815
1816
|
items_to_ignore = [
|
|
1816
1817
|
ACTION_METADATA_EXECUTION_SUCCESS,
|
|
1817
1818
|
ACTION_METADATA_EXECUTION_ERROR_MESSAGE,
|
|
1819
|
+
ACTION_METADATA_EXECUTION_TIME,
|
|
1818
1820
|
]
|
|
1819
1821
|
meta_no_nones = {
|
|
1820
1822
|
k: v
|
rasa/shared/core/flows/flow.py
CHANGED
|
@@ -8,7 +8,6 @@ from typing import Any, Dict, List, Optional, Set, Text, Tuple, Union
|
|
|
8
8
|
|
|
9
9
|
import structlog
|
|
10
10
|
from pydantic import BaseModel
|
|
11
|
-
from pypred import Predicate
|
|
12
11
|
|
|
13
12
|
import rasa.shared.utils.io
|
|
14
13
|
from rasa.engine.language import Language
|
|
@@ -53,6 +52,7 @@ from rasa.shared.core.flows.steps.constants import (
|
|
|
53
52
|
)
|
|
54
53
|
from rasa.shared.core.flows.steps.continuation import ContinueFlowStep
|
|
55
54
|
from rasa.shared.core.slots import Slot
|
|
55
|
+
from rasa.utils.pypred import Predicate
|
|
56
56
|
|
|
57
57
|
structlogger = structlog.get_logger()
|
|
58
58
|
|
|
@@ -52,7 +52,13 @@ def step_from_json(flow_id: Text, data: Dict[Text, Any]) -> FlowStep:
|
|
|
52
52
|
return SetSlotsFlowStep.from_json(flow_id, data)
|
|
53
53
|
if "noop" in data:
|
|
54
54
|
return NoOperationFlowStep.from_json(flow_id, data)
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
required_properties = ["action", "collect", "link", "call", "set_slots", "noop"]
|
|
57
|
+
raise RasaException(
|
|
58
|
+
f"Failed to parse step from json. Unknown type for {data}. "
|
|
59
|
+
f"At least one of the following properties is required: "
|
|
60
|
+
f"{', '.join(required_properties)}"
|
|
61
|
+
)
|
|
56
62
|
|
|
57
63
|
|
|
58
64
|
@dataclass
|
|
@@ -50,7 +50,14 @@ class CallFlowStep(FlowStep):
|
|
|
50
50
|
|
|
51
51
|
if should_resolve_calls:
|
|
52
52
|
if not self.called_flow_reference:
|
|
53
|
-
raise ValueError(
|
|
53
|
+
raise ValueError(
|
|
54
|
+
f"Flow step '{self.id}' in flow '{self.flow_id}' is trying "
|
|
55
|
+
f"to call flow '{self.call}', but the flow reference could "
|
|
56
|
+
f"not be resolved. Please ensure that:\n"
|
|
57
|
+
f"1. A flow named '{self.call}' is defined in your domain\n"
|
|
58
|
+
f"2. The flow name is spelled correctly (case-sensitive)\n"
|
|
59
|
+
f"3. The called flow is properly formatted with valid YAML syntax"
|
|
60
|
+
)
|
|
54
61
|
|
|
55
62
|
yield from self.called_flow_reference.steps_with_calls_resolved
|
|
56
63
|
|
|
@@ -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)))
|