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
|
@@ -5,26 +5,25 @@ import {
|
|
|
5
5
|
useColorModeValue,
|
|
6
6
|
useToast,
|
|
7
7
|
} from '@chakra-ui/react'
|
|
8
|
-
import { useEffect, useState, useCallback } from 'react'
|
|
9
8
|
import axios from 'axios'
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import queryString from 'query-string'
|
|
10
|
+
import { useCallback, useEffect, useState } from 'react'
|
|
11
|
+
import useWebSocket, { ReadyState } from 'react-use-websocket'
|
|
12
|
+
import { Chat } from './components/Chat'
|
|
13
|
+
import { DiagramFlow } from './components/DiagramFlow'
|
|
13
14
|
import { DialougeInformation } from './components/DialogueInformation'
|
|
15
|
+
import { DialogueStack } from './components/DialogueStack'
|
|
14
16
|
import { LoadingSpinner } from './components/LoadingSpinner'
|
|
15
|
-
import { DiagramFlow } from './components/DiagramFlow'
|
|
16
17
|
import { RecruitmentPanel } from './components/RecruitmentPanel'
|
|
18
|
+
import { Welcome } from './components/Welcome'
|
|
17
19
|
import { formatSlots } from './helpers/formatters'
|
|
18
|
-
import { Slot, Stack, Event, Flow, SelectedStack, Tracker } from './types'
|
|
19
20
|
import {
|
|
20
21
|
createHistoricalStack,
|
|
21
22
|
flowStepTrail,
|
|
22
23
|
updatedActiveFrame,
|
|
23
24
|
} from './helpers/utils'
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import { LatencyDisplay } from './components/LatencyDisplay'
|
|
27
|
-
import useWebSocket, { ReadyState } from 'react-use-websocket'
|
|
25
|
+
import { useOurTheme } from './theme'
|
|
26
|
+
import { Event, Flow, SelectedStack, Slot, Stack, Tracker } from './types'
|
|
28
27
|
|
|
29
28
|
export function App() {
|
|
30
29
|
const toast = useToast()
|
|
@@ -129,13 +128,6 @@ export function App() {
|
|
|
129
128
|
!rasaChatSessionId ||
|
|
130
129
|
lastJsonMessage?.sender_id === rasaChatSessionId
|
|
131
130
|
) {
|
|
132
|
-
if (lastJsonMessage.latency) {
|
|
133
|
-
console.log('Latency update:', lastJsonMessage.latency)
|
|
134
|
-
setLatency((prevLatency: any) => ({
|
|
135
|
-
...prevLatency,
|
|
136
|
-
...lastJsonMessage.latency,
|
|
137
|
-
}))
|
|
138
|
-
}
|
|
139
131
|
setSlots(formatSlots(lastJsonMessage.slots))
|
|
140
132
|
setEvents(lastJsonMessage.events)
|
|
141
133
|
const updatedStack = createHistoricalStack(
|
|
@@ -184,21 +176,6 @@ export function App() {
|
|
|
184
176
|
: 'max-content minmax(10rem, 17.5rem) minmax(10rem, auto)',
|
|
185
177
|
gridRowGap: rasaSpace[1],
|
|
186
178
|
}
|
|
187
|
-
const rightColumnSx = {
|
|
188
|
-
height: '100%',
|
|
189
|
-
overflow: 'hidden',
|
|
190
|
-
gridTemplateColumns: '1fr',
|
|
191
|
-
gridTemplateRows: 'max-content 1fr',
|
|
192
|
-
gridRowGap: rasaSpace[1],
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const chatContainerSx = {
|
|
196
|
-
...borderRadiusSx,
|
|
197
|
-
padding: rasaSpace[1],
|
|
198
|
-
bg: useColorModeValue('neutral.50', 'neutral.50'),
|
|
199
|
-
overflow: 'auto', // Allow scrolling for chat
|
|
200
|
-
height: '100%',
|
|
201
|
-
}
|
|
202
179
|
|
|
203
180
|
const onFrameSelected = (stack: Stack) => {
|
|
204
181
|
setFrame({
|
|
@@ -252,6 +229,7 @@ export function App() {
|
|
|
252
229
|
slots={slots}
|
|
253
230
|
events={events}
|
|
254
231
|
story={story}
|
|
232
|
+
latency={latency}
|
|
255
233
|
/>
|
|
256
234
|
</Grid>
|
|
257
235
|
</GridItem>
|
|
@@ -263,16 +241,11 @@ export function App() {
|
|
|
263
241
|
slots={slots}
|
|
264
242
|
/>
|
|
265
243
|
</GridItem>
|
|
266
|
-
|
|
267
|
-
<
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<Chat events={events || []} />
|
|
272
|
-
</GridItem>
|
|
273
|
-
)}
|
|
274
|
-
</Grid>
|
|
275
|
-
</GridItem>
|
|
244
|
+
{shouldShowTranscript && (
|
|
245
|
+
<GridItem>
|
|
246
|
+
<Chat events={events || []} />
|
|
247
|
+
</GridItem>
|
|
248
|
+
)}
|
|
276
249
|
</Grid>
|
|
277
250
|
)
|
|
278
251
|
}
|
|
@@ -5,7 +5,6 @@ import { Command, Event } from '../types'
|
|
|
5
5
|
|
|
6
6
|
interface Props extends FlexProps {
|
|
7
7
|
events: Event[]
|
|
8
|
-
hasLatencyDisplay?: boolean
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export const Chat = ({ sx, events, ...props }: Props) => {
|
|
@@ -13,9 +12,9 @@ export const Chat = ({ sx, events, ...props }: Props) => {
|
|
|
13
12
|
...sx,
|
|
14
13
|
p: 0,
|
|
15
14
|
flexDirection: 'column',
|
|
16
|
-
height: '100%',
|
|
17
15
|
}
|
|
18
16
|
|
|
17
|
+
const maxHeight = document.documentElement.scrollHeight - 64
|
|
19
18
|
// 21 and 25 are the rem number we're using for the columns. We add 0.75rem for the padding
|
|
20
19
|
// A potential improvement would be to add a onresize event for both width and height
|
|
21
20
|
let remReference = 21.75
|
|
@@ -111,7 +110,7 @@ export const Chat = ({ sx, events, ...props }: Props) => {
|
|
|
111
110
|
borderRadius: '10px',
|
|
112
111
|
border: 'none',
|
|
113
112
|
width: columnWidth,
|
|
114
|
-
height:
|
|
113
|
+
height: maxHeight,
|
|
115
114
|
}}
|
|
116
115
|
history={messages}
|
|
117
116
|
demo={true}
|
|
@@ -13,13 +13,14 @@ import {
|
|
|
13
13
|
useTab,
|
|
14
14
|
useToast,
|
|
15
15
|
} from '@chakra-ui/react'
|
|
16
|
+
import { useEffect } from 'react'
|
|
16
17
|
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
|
|
18
|
+
import { useCopyToClipboard } from 'usehooks-ts'
|
|
19
|
+
import { formatTestCases } from '../helpers/formatters'
|
|
17
20
|
import { useOurTheme } from '../theme'
|
|
18
21
|
import { Event, Slot } from '../types'
|
|
19
|
-
import { formatTestCases } from '../helpers/formatters'
|
|
20
|
-
import { useCopyToClipboard } from 'usehooks-ts'
|
|
21
|
-
import { useEffect } from 'react'
|
|
22
22
|
import { FullscreenButton } from './FullscreenButton'
|
|
23
|
+
import { LatencyDisplay } from './LatencyDisplay'
|
|
23
24
|
import { SlotTable, Slots } from './Slots'
|
|
24
25
|
|
|
25
26
|
interface Props extends FlexProps {
|
|
@@ -27,6 +28,7 @@ interface Props extends FlexProps {
|
|
|
27
28
|
events: Event[]
|
|
28
29
|
story: string
|
|
29
30
|
slots: Slot[]
|
|
31
|
+
latency: any
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export const DialougeInformation = ({
|
|
@@ -35,6 +37,7 @@ export const DialougeInformation = ({
|
|
|
35
37
|
events,
|
|
36
38
|
story,
|
|
37
39
|
slots,
|
|
40
|
+
latency,
|
|
38
41
|
...props
|
|
39
42
|
}: Props) => {
|
|
40
43
|
const toast = useToast()
|
|
@@ -92,6 +95,7 @@ export const DialougeInformation = ({
|
|
|
92
95
|
}, [copiedText, toast])
|
|
93
96
|
|
|
94
97
|
const testCases = formatTestCases(events, rasaChatSessionId)
|
|
98
|
+
const rasaLatency = getLastActionListenEvent(events)?.metadata?.execution_times
|
|
95
99
|
|
|
96
100
|
return (
|
|
97
101
|
<Flex sx={containerSx} {...props}>
|
|
@@ -105,6 +109,7 @@ export const DialougeInformation = ({
|
|
|
105
109
|
<CustomTab>Slots</CustomTab>
|
|
106
110
|
<CustomTab>End-2-end test</CustomTab>
|
|
107
111
|
<CustomTab>Tracker state</CustomTab>
|
|
112
|
+
<CustomTab>Latency</CustomTab>
|
|
108
113
|
</TabList>
|
|
109
114
|
<TabPanels height="100%" overflow="hidden">
|
|
110
115
|
<TabPanel sx={tabPanelSx}>
|
|
@@ -160,6 +165,14 @@ export const DialougeInformation = ({
|
|
|
160
165
|
</FullscreenButton>
|
|
161
166
|
</HStack>
|
|
162
167
|
</TabPanel>
|
|
168
|
+
<TabPanel sx={tabPanelSx}>
|
|
169
|
+
<Box sx={overflowBox}>
|
|
170
|
+
<LatencyDisplay
|
|
171
|
+
voiceLatency={latency}
|
|
172
|
+
rasaLatency={rasaLatency}
|
|
173
|
+
/>
|
|
174
|
+
</Box>
|
|
175
|
+
</TabPanel>
|
|
163
176
|
</TabPanels>
|
|
164
177
|
</Tabs>
|
|
165
178
|
</Flex>
|
|
@@ -185,3 +198,7 @@ const CustomTab = (props: TabProps) => {
|
|
|
185
198
|
</Button>
|
|
186
199
|
)
|
|
187
200
|
}
|
|
201
|
+
|
|
202
|
+
const getLastActionListenEvent = (events: Event[]): Event | undefined => {
|
|
203
|
+
return [...events].reverse().find((event) => event.name === 'action_listen')
|
|
204
|
+
}
|
|
@@ -2,40 +2,47 @@ import {
|
|
|
2
2
|
Box,
|
|
3
3
|
Flex,
|
|
4
4
|
FlexProps,
|
|
5
|
-
Text,
|
|
6
|
-
useColorModeValue,
|
|
7
|
-
Tooltip,
|
|
8
5
|
Table,
|
|
9
6
|
Tbody,
|
|
10
|
-
Tr,
|
|
11
7
|
Td,
|
|
8
|
+
Text,
|
|
9
|
+
Tooltip,
|
|
10
|
+
Tr,
|
|
11
|
+
useColorModeValue,
|
|
12
12
|
} from '@chakra-ui/react'
|
|
13
13
|
import { useOurTheme } from '../theme'
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
isRasaLatency,
|
|
16
|
+
isVoiceLatency,
|
|
17
|
+
RasaLatency,
|
|
18
|
+
VoiceLatency,
|
|
19
|
+
} from '../types'
|
|
15
20
|
|
|
16
|
-
interface
|
|
17
|
-
latency:
|
|
21
|
+
interface MinimalDisplayProps extends FlexProps {
|
|
22
|
+
latency: RasaLatency
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Simple latency display for text-only conversations.
|
|
22
27
|
* Shows a single response time value.
|
|
23
28
|
*/
|
|
24
|
-
const MinimalDisplay = ({ latency, sx, ...props }:
|
|
29
|
+
const MinimalDisplay = ({ latency, sx, ...props }: MinimalDisplayProps) => {
|
|
25
30
|
const containerSx = {
|
|
26
31
|
...sx,
|
|
27
32
|
display: 'flex',
|
|
28
33
|
alignItems: 'center',
|
|
29
34
|
}
|
|
30
|
-
|
|
35
|
+
|
|
31
36
|
const getLatencyColor = (latency: number) => {
|
|
32
37
|
if (latency < 1500) return 'green.500'
|
|
33
38
|
if (latency < 2500) return 'orange.500'
|
|
34
39
|
return 'red.500'
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
const value = Math.round(
|
|
38
|
-
|
|
41
|
+
|
|
42
|
+
const value = Math.round(
|
|
43
|
+
(latency.command_processor || 0) + (latency.prediction_loop || 0),
|
|
44
|
+
)
|
|
45
|
+
const color = getLatencyColor(value)
|
|
39
46
|
|
|
40
47
|
return (
|
|
41
48
|
<Flex sx={containerSx} {...props}>
|
|
@@ -49,11 +56,15 @@ const MinimalDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
49
56
|
)
|
|
50
57
|
}
|
|
51
58
|
|
|
59
|
+
interface WaterfallDisplayProps extends FlexProps {
|
|
60
|
+
latency: VoiceLatency
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
/**
|
|
53
64
|
* Detailed latency waterfall chart for voice conversations.
|
|
54
65
|
* Displays processing times for ASR, Rasa, and TTS components.
|
|
55
66
|
*/
|
|
56
|
-
const WaterfallDisplay = ({ latency, sx, ...props }:
|
|
67
|
+
const WaterfallDisplay = ({ latency, sx, ...props }: WaterfallDisplayProps) => {
|
|
57
68
|
const { rasaSpace } = useOurTheme()
|
|
58
69
|
|
|
59
70
|
const containerSx = {
|
|
@@ -61,13 +72,13 @@ const WaterfallDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
61
72
|
flexDirection: 'column',
|
|
62
73
|
gap: rasaSpace[1],
|
|
63
74
|
}
|
|
64
|
-
|
|
75
|
+
|
|
65
76
|
const headerSx = {
|
|
66
77
|
fontSize: 'sm',
|
|
67
78
|
fontWeight: 'bold',
|
|
68
79
|
color: useColorModeValue('gray.700', 'gray.300'),
|
|
69
80
|
}
|
|
70
|
-
|
|
81
|
+
|
|
71
82
|
const waterfallBarSx = {
|
|
72
83
|
height: '24px',
|
|
73
84
|
borderRadius: '4px',
|
|
@@ -75,10 +86,10 @@ const WaterfallDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
75
86
|
border: '1px solid',
|
|
76
87
|
borderColor: useColorModeValue('gray.200', 'gray.600'),
|
|
77
88
|
}
|
|
78
|
-
|
|
89
|
+
|
|
79
90
|
const legendTableSx = {
|
|
80
91
|
size: 'sm',
|
|
81
|
-
mt: rasaSpace[0.5]
|
|
92
|
+
mt: rasaSpace[0.5],
|
|
82
93
|
}
|
|
83
94
|
|
|
84
95
|
const getLatencyColor = (type: string) => {
|
|
@@ -95,8 +106,10 @@ const WaterfallDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
95
106
|
const descriptions: { [key: string]: string } = {
|
|
96
107
|
asr: 'Time from the first Partial Transcript event to the Final Transcript event from Speech Recognition. It also includes the time taken by the user to speak.',
|
|
97
108
|
rasa: 'Time taken by Rasa to process the text from the Final Transcript event from Speech Recognition until a text response is generated.',
|
|
98
|
-
tts_first:
|
|
99
|
-
|
|
109
|
+
tts_first:
|
|
110
|
+
'Time between the request sent to Text-to-Speech processing and the first byte of audio received by Rasa.',
|
|
111
|
+
tts_complete:
|
|
112
|
+
'Time taken by Text-to-Speech to complete audio generation. It depends on the length of the text and could overlap with the Bot speaking time.',
|
|
100
113
|
}
|
|
101
114
|
return descriptions[type] || ''
|
|
102
115
|
}
|
|
@@ -151,10 +164,10 @@ const WaterfallDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
151
164
|
)
|
|
152
165
|
|
|
153
166
|
// Calculate total latency for title (Rasa + TTS First Byte)
|
|
154
|
-
const totalDisplayLatency =
|
|
155
|
-
(latency.rasa_processing_latency_ms || 0) +
|
|
156
|
-
(latency.tts_first_byte_latency_ms || 0)
|
|
157
|
-
|
|
167
|
+
const totalDisplayLatency =
|
|
168
|
+
(latency.rasa_processing_latency_ms || 0) +
|
|
169
|
+
(latency.tts_first_byte_latency_ms || 0)
|
|
170
|
+
|
|
158
171
|
return (
|
|
159
172
|
<Flex sx={containerSx} {...props}>
|
|
160
173
|
<Text sx={headerSx}>
|
|
@@ -241,28 +254,43 @@ const WaterfallDisplay = ({ latency, sx, ...props }: Props) => {
|
|
|
241
254
|
)
|
|
242
255
|
}
|
|
243
256
|
|
|
257
|
+
interface LatencyDisplayProps extends FlexProps {
|
|
258
|
+
voiceLatency?: any
|
|
259
|
+
rasaLatency?: any
|
|
260
|
+
}
|
|
261
|
+
|
|
244
262
|
/**
|
|
245
263
|
* Displays processing latency information for the conversation.
|
|
246
|
-
* Shows either a detailed waterfall chart for voice conversations or
|
|
264
|
+
* Shows either a detailed waterfall chart for voice conversations or
|
|
247
265
|
* a simpler display for text-only conversations.
|
|
248
266
|
*/
|
|
249
267
|
export const LatencyDisplay = ({
|
|
250
268
|
sx,
|
|
251
|
-
|
|
269
|
+
voiceLatency,
|
|
270
|
+
rasaLatency,
|
|
252
271
|
...props
|
|
253
|
-
}:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return
|
|
272
|
+
}: LatencyDisplayProps) => {
|
|
273
|
+
// We give priority to voice latency as most comprehensive.
|
|
274
|
+
if (isVoiceLatency(voiceLatency)) {
|
|
275
|
+
return <WaterfallDisplay latency={voiceLatency} sx={sx} {...props} />
|
|
257
276
|
}
|
|
258
277
|
|
|
259
|
-
//
|
|
260
|
-
|
|
261
|
-
latency
|
|
278
|
+
// If voice latency is not available, we use rasa latency.
|
|
279
|
+
if (isRasaLatency(rasaLatency)) {
|
|
280
|
+
return <MinimalDisplay latency={rasaLatency} sx={sx} {...props} />
|
|
281
|
+
}
|
|
262
282
|
|
|
263
|
-
|
|
264
|
-
|
|
283
|
+
// If rasa latency is not available, we are either waiting for first data from voice stream or the conversation is not started yet.
|
|
284
|
+
if (!rasaLatency) {
|
|
285
|
+
return <Text>Rasa latency data is not available yet</Text>
|
|
265
286
|
}
|
|
266
287
|
|
|
267
|
-
|
|
288
|
+
// If rasa latency is available but did not pass type guard, we are in an unexpected state
|
|
289
|
+
// and we should log an error but gracefully fallback to showing no data.
|
|
290
|
+
console.warn(
|
|
291
|
+
`Latency data has unexpected format. Raw data of rasaLatency: ${rasaLatency},
|
|
292
|
+
raw data of voice latency: ${voiceLatency}`,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
return <Text>Latency data is not available yet</Text>
|
|
268
296
|
}
|
|
@@ -52,6 +52,7 @@ interface AudioQueue {
|
|
|
52
52
|
addMarker: (id: string) => void
|
|
53
53
|
reduceMarkers: (bytesRead: number) => void
|
|
54
54
|
popMarkers: () => void
|
|
55
|
+
clear: () => void
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
const createAudioQueue = (socket: WebSocket): AudioQueue => {
|
|
@@ -108,6 +109,14 @@ const createAudioQueue = (socket: WebSocket): AudioQueue => {
|
|
|
108
109
|
}
|
|
109
110
|
})
|
|
110
111
|
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Clears the audio queue, removing all buffered audio and markers.
|
|
115
|
+
*/
|
|
116
|
+
clear: function () {
|
|
117
|
+
this.buffer = new Float32Array(0)
|
|
118
|
+
this.marks = []
|
|
119
|
+
},
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
122
|
|
|
@@ -204,7 +213,12 @@ const addDataToAudioQueue =
|
|
|
204
213
|
}
|
|
205
214
|
console.log('Voice Latency Metrics:', data['latency'])
|
|
206
215
|
audioQueue.addMarker(data['marker'])
|
|
216
|
+
} else if (data['interruptPlayback']) {
|
|
217
|
+
// User interrupted the bot, immediately clear the audio queue
|
|
218
|
+
audioQueue.clear()
|
|
219
|
+
console.log('Audio queue cleared due to user interruption.')
|
|
207
220
|
}
|
|
221
|
+
|
|
208
222
|
} catch (error) {
|
|
209
223
|
console.error('Error processing server incoming audio data:', error)
|
|
210
224
|
}
|
|
@@ -17,7 +17,8 @@ export interface Event {
|
|
|
17
17
|
timestamp: string
|
|
18
18
|
update?: string
|
|
19
19
|
parse_data?: { commands: Command[] }
|
|
20
|
-
metadata?: { utter_action?: string }
|
|
20
|
+
metadata?: { utter_action?: string; execution_times?: RasaLatency }
|
|
21
|
+
name?: string
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface Command {
|
|
@@ -42,11 +43,16 @@ export interface Stack {
|
|
|
42
43
|
ended: boolean
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
export interface RasaLatency {
|
|
47
|
+
command_processor: number
|
|
48
|
+
prediction_loop: number
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface VoiceLatency {
|
|
52
|
+
rasa_processing_latency_ms: number
|
|
53
|
+
asr_latency_ms: number
|
|
54
|
+
tts_first_byte_latency_ms: number
|
|
55
|
+
tts_complete_latency_ms: number
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
export interface Tracker {
|
|
@@ -54,7 +60,6 @@ export interface Tracker {
|
|
|
54
60
|
slots: { [key: string]: unknown }
|
|
55
61
|
events: Event[]
|
|
56
62
|
stack: Stack[]
|
|
57
|
-
latency?: LatencyData
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
export interface Flow {
|
|
@@ -96,3 +101,23 @@ interface Step {
|
|
|
96
101
|
utter: string
|
|
97
102
|
set_slots?: unknown
|
|
98
103
|
}
|
|
104
|
+
|
|
105
|
+
export function isRasaLatency(obj: any): obj is RasaLatency {
|
|
106
|
+
return (
|
|
107
|
+
obj !== null &&
|
|
108
|
+
typeof obj === 'object' &&
|
|
109
|
+
typeof obj.command_processor === 'number' &&
|
|
110
|
+
typeof obj.prediction_loop === 'number'
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function isVoiceLatency(obj: any): obj is VoiceLatency {
|
|
115
|
+
return (
|
|
116
|
+
obj !== null &&
|
|
117
|
+
typeof obj === 'object' &&
|
|
118
|
+
typeof obj.rasa_processing_latency_ms === 'number' &&
|
|
119
|
+
typeof obj.asr_latency_ms === 'number' &&
|
|
120
|
+
typeof obj.tts_first_byte_latency_ms === 'number' &&
|
|
121
|
+
typeof obj.tts_complete_latency_ms === 'number'
|
|
122
|
+
)
|
|
123
|
+
}
|
|
@@ -4,7 +4,6 @@ import asyncio
|
|
|
4
4
|
import audioop
|
|
5
5
|
import base64
|
|
6
6
|
import json
|
|
7
|
-
import time
|
|
8
7
|
import uuid
|
|
9
8
|
from functools import partial
|
|
10
9
|
from typing import (
|
|
@@ -17,9 +16,9 @@ from typing import (
|
|
|
17
16
|
Optional,
|
|
18
17
|
Text,
|
|
19
18
|
Tuple,
|
|
19
|
+
Union,
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
import orjson
|
|
23
22
|
import structlog
|
|
24
23
|
|
|
25
24
|
from rasa.core.channels import UserMessage
|
|
@@ -53,9 +52,7 @@ if TYPE_CHECKING:
|
|
|
53
52
|
structlogger = structlog.get_logger()
|
|
54
53
|
|
|
55
54
|
|
|
56
|
-
def tracker_as_dump(
|
|
57
|
-
tracker: "DialogueStateTracker", latency: Optional[float] = None
|
|
58
|
-
) -> str:
|
|
55
|
+
def tracker_as_dump(tracker: "DialogueStateTracker") -> Dict[str, Any]:
|
|
59
56
|
"""Create a dump of the tracker state."""
|
|
60
57
|
from rasa.shared.core.trackers import get_trackers_for_conversation_sessions
|
|
61
58
|
|
|
@@ -67,10 +64,7 @@ def tracker_as_dump(
|
|
|
67
64
|
last_tracker = multiple_tracker_sessions[-1]
|
|
68
65
|
|
|
69
66
|
state = last_tracker.current_state(EventVerbosity.AFTER_RESTART)
|
|
70
|
-
|
|
71
|
-
if latency is not None:
|
|
72
|
-
state["latency"] = {"rasa_processing_latency_ms": latency}
|
|
73
|
-
return orjson.dumps(state, option=orjson.OPT_SERIALIZE_NUMPY).decode("utf-8")
|
|
67
|
+
return state
|
|
74
68
|
|
|
75
69
|
|
|
76
70
|
def does_need_action_prediction(tracker: "DialogueStateTracker") -> bool:
|
|
@@ -214,7 +208,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
214
208
|
enable_silence_timeout=credentials.get("enable_silence_timeout", False),
|
|
215
209
|
)
|
|
216
210
|
|
|
217
|
-
async def emit(self, event: str, data: str, room: str) -> None:
|
|
211
|
+
async def emit(self, event: str, data: Union[Dict, str], room: str) -> None:
|
|
218
212
|
"""Emits an event to the websocket."""
|
|
219
213
|
if not self.sio_server:
|
|
220
214
|
structlogger.error("studio_chat.emit.sio_not_initialized")
|
|
@@ -224,32 +218,16 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
224
218
|
def _register_tracker_update_hook(self) -> None:
|
|
225
219
|
plugin_manager().register(StudioTrackerUpdatePlugin(self))
|
|
226
220
|
|
|
227
|
-
async def on_tracker_updated(
|
|
228
|
-
self, tracker: "DialogueStateTracker", latency: Optional[float] = None
|
|
229
|
-
) -> None:
|
|
221
|
+
async def on_tracker_updated(self, tracker: "DialogueStateTracker") -> None:
|
|
230
222
|
"""Triggers a tracker update notification after a change to the tracker."""
|
|
231
|
-
await self.publish_tracker_update(
|
|
232
|
-
tracker.sender_id, tracker_as_dump(tracker, latency)
|
|
233
|
-
)
|
|
223
|
+
await self.publish_tracker_update(tracker.sender_id, tracker_as_dump(tracker))
|
|
234
224
|
|
|
235
|
-
async def publish_tracker_update(
|
|
225
|
+
async def publish_tracker_update(
|
|
226
|
+
self, sender_id: str, tracker_dump: Dict[str, Any]
|
|
227
|
+
) -> None:
|
|
236
228
|
"""Publishes a tracker update notification to the websocket."""
|
|
237
229
|
await self.emit("tracker", tracker_dump, room=sender_id)
|
|
238
230
|
|
|
239
|
-
def _record_turn_start_time(self, sender_id: Text) -> None:
|
|
240
|
-
"""Records the start time of a new turn."""
|
|
241
|
-
self._turn_start_times[sender_id] = time.time()
|
|
242
|
-
|
|
243
|
-
def _get_latency(self, sender_id: Text) -> Optional[float]:
|
|
244
|
-
"""Returns the latency of the current turn in milliseconds."""
|
|
245
|
-
if sender_id not in self._turn_start_times:
|
|
246
|
-
return None
|
|
247
|
-
|
|
248
|
-
latency = (time.time() - self._turn_start_times[sender_id]) * 1000
|
|
249
|
-
# The turn is over, so we can remove the start time
|
|
250
|
-
del self._turn_start_times[sender_id]
|
|
251
|
-
return latency
|
|
252
|
-
|
|
253
231
|
async def on_message_proxy(
|
|
254
232
|
self,
|
|
255
233
|
on_new_message: Callable[[UserMessage], Awaitable[Any]],
|
|
@@ -259,8 +237,14 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
259
237
|
|
|
260
238
|
Triggers a tracker update notification after processing the message.
|
|
261
239
|
"""
|
|
262
|
-
|
|
263
|
-
|
|
240
|
+
try:
|
|
241
|
+
await on_new_message(message)
|
|
242
|
+
except Exception as e:
|
|
243
|
+
structlogger.exception(
|
|
244
|
+
"studio_chat.on_new_message.error",
|
|
245
|
+
error=str(e),
|
|
246
|
+
sender_id=message.sender_id,
|
|
247
|
+
)
|
|
264
248
|
|
|
265
249
|
if not self.agent or not self.agent.is_ready():
|
|
266
250
|
structlogger.error("studio_chat.on_message_proxy.agent_not_initialized")
|
|
@@ -278,8 +262,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
278
262
|
structlogger.error("studio_chat.on_message_proxy.tracker_not_found")
|
|
279
263
|
return
|
|
280
264
|
|
|
281
|
-
|
|
282
|
-
await self.on_tracker_updated(tracker, latency)
|
|
265
|
+
await self.on_tracker_updated(tracker)
|
|
283
266
|
|
|
284
267
|
async def emit_error(self, message: str, room: str, e: Exception) -> None:
|
|
285
268
|
await self.emit(
|
|
@@ -379,16 +362,23 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
379
362
|
call_state.is_bot_speaking = True
|
|
380
363
|
return ContinueConversationAction()
|
|
381
364
|
|
|
382
|
-
def
|
|
365
|
+
def create_output_channel(
|
|
383
366
|
self, voice_websocket: "Websocket", tts_engine: TTSEngine
|
|
384
367
|
) -> VoiceOutputChannel:
|
|
385
|
-
"""Create a voice output channel."""
|
|
368
|
+
"""Create a voice output channel. This is used by VoiceInputChannel."""
|
|
386
369
|
return StudioVoiceOutputChannel(
|
|
387
370
|
voice_websocket,
|
|
388
371
|
tts_engine,
|
|
389
372
|
self.tts_cache,
|
|
390
373
|
)
|
|
391
374
|
|
|
375
|
+
async def interrupt_playback(
|
|
376
|
+
self, ws: Websocket, call_parameters: CallParameters
|
|
377
|
+
) -> None:
|
|
378
|
+
"""Interrupt the current playback of audio."""
|
|
379
|
+
structlogger.debug("studio_chat.interrupt_playback")
|
|
380
|
+
await ws.send(json.dumps({"interruptPlayback": True}))
|
|
381
|
+
|
|
392
382
|
def _start_voice_session(
|
|
393
383
|
self,
|
|
394
384
|
session_id: str,
|
|
@@ -459,8 +449,9 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
459
449
|
def blueprint(
|
|
460
450
|
self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
|
|
461
451
|
) -> SocketBlueprint:
|
|
462
|
-
|
|
463
|
-
|
|
452
|
+
socket_blueprint = super().blueprint(
|
|
453
|
+
partial(self.on_message_proxy, on_new_message)
|
|
454
|
+
)
|
|
464
455
|
|
|
465
456
|
if not self.sio_server:
|
|
466
457
|
structlogger.error("studio_chat.blueprint.sio_not_initialized")
|
|
@@ -470,7 +461,8 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
470
461
|
async def after_server_start(
|
|
471
462
|
app: "Sanic", _: asyncio.AbstractEventLoop
|
|
472
463
|
) -> None:
|
|
473
|
-
|
|
464
|
+
if hasattr(app.ctx, "agent"):
|
|
465
|
+
self.agent = app.ctx.agent
|
|
474
466
|
|
|
475
467
|
@self.sio_server.on("disconnect", namespace=self.namespace)
|
|
476
468
|
async def disconnect(sid: Text) -> None:
|
|
@@ -495,7 +487,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
495
487
|
|
|
496
488
|
# start a voice session if requested
|
|
497
489
|
if data and data.get("is_voice", False):
|
|
498
|
-
self._start_voice_session(data["session_id"], sid,
|
|
490
|
+
self._start_voice_session(data["session_id"], sid, on_new_message)
|
|
499
491
|
|
|
500
492
|
@self.sio_server.on(self.user_message_evt, namespace=self.namespace)
|
|
501
493
|
async def handle_message(sid: Text, data: Dict) -> None:
|
|
@@ -508,8 +500,16 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
508
500
|
ws.put_message(data)
|
|
509
501
|
return
|
|
510
502
|
|
|
511
|
-
|
|
512
|
-
|
|
503
|
+
try:
|
|
504
|
+
# Handle text messages
|
|
505
|
+
await self.handle_user_message(sid, data, on_new_message)
|
|
506
|
+
except Exception as e:
|
|
507
|
+
structlogger.exception(
|
|
508
|
+
"studio_chat.sio.handle_message.error",
|
|
509
|
+
error=str(e),
|
|
510
|
+
sid=sid,
|
|
511
|
+
)
|
|
512
|
+
await self.emit("error", str(e), room=sid)
|
|
513
513
|
|
|
514
514
|
@self.sio_server.on("update_tracker", namespace=self.namespace)
|
|
515
515
|
async def on_update_tracker(sid: Text, data: Dict) -> None:
|