rasa-pro 3.14.0.dev20250901__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.

Files changed (361) hide show
  1. rasa/builder/config.py +1 -0
  2. rasa/builder/copilot/constants.py +3 -0
  3. rasa/builder/copilot/copilot.py +128 -54
  4. rasa/builder/copilot/models.py +39 -3
  5. rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +183 -188
  6. rasa/builder/copilot/prompts/latest_user_message_context_prompt.jinja2 +61 -0
  7. rasa/builder/copilot/telemetry.py +46 -20
  8. rasa/builder/document_retrieval/models.py +3 -3
  9. rasa/builder/download.py +1 -8
  10. rasa/builder/jobs.py +33 -21
  11. rasa/builder/main.py +38 -62
  12. rasa/builder/models.py +7 -7
  13. rasa/builder/project_generator.py +143 -147
  14. rasa/builder/service.py +42 -27
  15. rasa/builder/template_cache.py +69 -0
  16. rasa/builder/training_service.py +74 -4
  17. rasa/cli/project_templates/basic/README.md +23 -0
  18. rasa/cli/project_templates/basic/actions/actions.md +10 -0
  19. rasa/cli/project_templates/basic/config.yml +6 -4
  20. rasa/cli/project_templates/basic/data/data.md +5 -6
  21. rasa/cli/project_templates/basic/domain/domain.md +7 -5
  22. rasa/cli/project_templates/basic/domain/general/show_faqs.yml +1 -1
  23. rasa/cli/project_templates/basic/endpoints.yml +5 -1
  24. rasa/cli/project_templates/default/config.yml +4 -0
  25. rasa/cli/project_templates/default/endpoints.yml +4 -0
  26. rasa/cli/project_templates/finance/README.md +26 -0
  27. rasa/cli/project_templates/finance/actions/__init__.py +0 -46
  28. rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
  29. rasa/cli/project_templates/finance/actions/actions.md +15 -0
  30. rasa/cli/project_templates/finance/actions/{transfers/action_process_immediate_payment.py → cards/check_that_card_exists.py} +6 -3
  31. rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
  32. rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
  33. rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
  34. rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
  35. rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
  36. rasa/cli/project_templates/finance/actions/db.py +117 -0
  37. rasa/cli/project_templates/finance/actions/general/__init__.py +0 -0
  38. rasa/cli/project_templates/finance/actions/general/action_human_handoff.py +49 -0
  39. rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
  40. rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
  41. rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
  42. rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
  43. rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
  44. rasa/cli/project_templates/finance/config.yml +8 -0
  45. rasa/cli/project_templates/finance/credentials.yml +7 -6
  46. rasa/cli/project_templates/finance/data/accounts/check_balance.yml +3 -4
  47. rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
  48. rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
  49. rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
  50. rasa/cli/project_templates/finance/data/cards/block_card.yml +37 -58
  51. rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
  52. rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
  53. rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
  54. rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
  55. rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
  56. rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
  57. rasa/cli/project_templates/finance/data/data.md +14 -0
  58. rasa/cli/project_templates/finance/data/general/bot_challenge.yml +6 -0
  59. rasa/cli/project_templates/finance/data/general/goodbye.yml +1 -1
  60. rasa/cli/project_templates/finance/data/general/hello.yml +1 -2
  61. rasa/cli/project_templates/finance/data/general/help.yml +2 -2
  62. rasa/cli/project_templates/finance/data/general/human_handoff.yml +2 -2
  63. rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +1 -1
  64. rasa/cli/project_templates/finance/data/transfers/check_transfer_limit.yml +18 -0
  65. rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
  66. rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
  67. rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +29 -62
  68. rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
  69. rasa/cli/project_templates/finance/db/cards.json +18 -0
  70. rasa/cli/project_templates/finance/db/contacts.json +10 -0
  71. rasa/cli/project_templates/finance/db/my_account.json +6 -0
  72. rasa/cli/project_templates/finance/db/transactions.json +22 -0
  73. rasa/cli/project_templates/finance/docs/docs.md +8 -0
  74. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
  75. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
  76. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
  77. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
  78. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
  79. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
  80. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
  81. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
  82. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
  83. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
  84. rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +9 -5
  85. rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
  86. rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
  87. rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
  88. rasa/cli/project_templates/finance/domain/cards/block_card.yml +33 -90
  89. rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
  90. rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
  91. rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
  92. rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
  93. rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
  94. rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
  95. rasa/cli/project_templates/finance/domain/domain.md +18 -0
  96. rasa/cli/project_templates/finance/domain/general/_shared.yml +39 -0
  97. rasa/cli/project_templates/finance/domain/general/bot_challenge.yml +4 -0
  98. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -2
  99. rasa/cli/project_templates/finance/domain/general/feedback.yml +0 -3
  100. rasa/cli/project_templates/finance/domain/general/goodbye.yml +6 -6
  101. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +10 -9
  102. rasa/cli/project_templates/finance/domain/general/welcome.yml +33 -2
  103. rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
  104. rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
  105. rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
  106. rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +203 -61
  107. rasa/cli/project_templates/finance/endpoints.yml +8 -4
  108. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +31 -12
  109. rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/check_balance.yml +9 -0
  110. rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/download_statements.yml +43 -0
  111. rasa/cli/project_templates/finance/tests/e2e_test_cases/cards/block_card.yml +55 -0
  112. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
  113. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/feedback.yml +46 -0
  114. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/goodbye.yml +9 -0
  115. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/hello.yml +8 -0
  116. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/human_handoff.yml +35 -0
  117. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/patterns.yml +22 -0
  118. rasa/cli/project_templates/finance/tests/e2e_test_cases/transfers/transfer_money.yml +56 -0
  119. rasa/cli/project_templates/telco/README.md +25 -0
  120. rasa/cli/project_templates/telco/actions/actions.md +12 -0
  121. rasa/cli/project_templates/telco/config.yml +6 -4
  122. rasa/cli/project_templates/telco/data/data.md +11 -0
  123. rasa/cli/project_templates/telco/data/general/human_handoff.yml +1 -1
  124. rasa/cli/project_templates/telco/docs/docs.md +3 -0
  125. rasa/cli/project_templates/telco/domain/domain.md +13 -0
  126. rasa/cli/project_templates/telco/domain/general/human_handoff.yml +3 -6
  127. rasa/cli/project_templates/telco/endpoints.yml +5 -1
  128. rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +1 -1
  129. rasa/cli/project_templates/telco/tests/e2e_test_cases/billing/understand_bill.yml +67 -0
  130. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
  131. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +46 -0
  132. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/goodbye.yml +9 -0
  133. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +8 -0
  134. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +35 -0
  135. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +23 -0
  136. rasa/cli/project_templates/telco/tests/e2e_test_cases/network/solve_internet_issue.yml +57 -0
  137. rasa/core/actions/action_run_slot_rejections.py +1 -1
  138. rasa/core/actions/direct_custom_actions_executor.py +9 -2
  139. rasa/core/brokers/broker.py +1 -1
  140. rasa/core/brokers/kafka.py +52 -8
  141. rasa/core/channels/development_inspector.py +1 -21
  142. rasa/core/channels/hangouts.py +2 -2
  143. rasa/core/channels/inspector/dist/assets/{arc-18042c22.js → arc-35222594.js} +1 -1
  144. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-fdd6bcfa.js → blockDiagram-38ab4fdb-a0efbfd3.js} +1 -1
  145. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-f5ae6786.js → c4Diagram-3d4e48cf-0584c0f2.js} +1 -1
  146. rasa/core/channels/inspector/dist/assets/channel-8e08bed9.js +1 -0
  147. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-81efba3e.js → classDiagram-70f12bd4-39f40dbe.js} +1 -1
  148. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-3b6b6a92.js → classDiagram-v2-f2320105-1ad755f3.js} +1 -1
  149. rasa/core/channels/inspector/dist/assets/clone-78c82dea.js +1 -0
  150. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-31422447.js → createText-2e5e7dd3-b0f4f0fe.js} +1 -1
  151. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-518a90db.js → edges-e0da2a9e-9039bff9.js} +1 -1
  152. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-a6d3c25a.js → erDiagram-9861fffd-65c9b127.js} +1 -1
  153. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-e048c2be.js → flowDb-956e92f1-4f08b38e.js} +1 -1
  154. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-c7474c91.js → flowDiagram-66a62f08-e95c362a.js} +1 -1
  155. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b08f601.js +1 -0
  156. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-cb4d8723.js → flowchart-elk-definition-4a651766-703c3015.js} +1 -1
  157. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-346636a2.js → ganttDiagram-c361ad54-699328ea.js} +1 -1
  158. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-7c508874.js → gitGraphDiagram-72cf32ee-04cf4b05.js} +1 -1
  159. rasa/core/channels/inspector/dist/assets/{graph-14702d8a.js → graph-ee94449e.js} +1 -1
  160. rasa/core/channels/inspector/dist/assets/{index-3862675e-f18b534b.js → index-3862675e-940162b4.js} +1 -1
  161. rasa/core/channels/inspector/dist/assets/{index-4d4bdf3a.js → index-c941dcb3.js} +132 -131
  162. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-64154b83.js → infoDiagram-f8f76790-c79c2866.js} +1 -1
  163. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-833a5f95.js → journeyDiagram-49397b02-84489d30.js} +1 -1
  164. rasa/core/channels/inspector/dist/assets/{layout-5a3b2123.js → layout-a9aa9858.js} +1 -1
  165. rasa/core/channels/inspector/dist/assets/{line-2272a8c7.js → line-eb73cf26.js} +1 -1
  166. rasa/core/channels/inspector/dist/assets/{linear-35bcf273.js → linear-b3399f9a.js} +1 -1
  167. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-92dcb0e9.js → mindmap-definition-fc14e90a-b095bf1a.js} +1 -1
  168. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-94dbc900.js → pieDiagram-8a3498a8-07644b66.js} +1 -1
  169. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-8b7a9c33.js → quadrantDiagram-120e2f19-573a3f9c.js} +1 -1
  170. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-6f7eab81.js → requirementDiagram-deff3bca-d457e1e1.js} +1 -1
  171. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-f43e581d.js → sankeyDiagram-04a897e0-9d26e1a2.js} +1 -1
  172. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-0bcbefc3.js → sequenceDiagram-704730f1-3a9cde10.js} +1 -1
  173. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-b8a74083.js → stateDiagram-587899a1-4f3e8cec.js} +1 -1
  174. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-2070218f.js → stateDiagram-v2-d93cdb3a-e617e5bf.js} +1 -1
  175. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-f1d54e34.js → styles-6aaf32cf-eab30d2f.js} +1 -1
  176. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-980de489.js → styles-9a916d00-09994be2.js} +1 -1
  177. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-3c03abde.js → styles-c10674c1-b7110364.js} +1 -1
  178. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-46ba068f.js → svgDrawCommon-08f97a94-3ebc92ad.js} +1 -1
  179. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-901f5e3d.js → timeline-definition-85554ec2-7d13d2f2.js} +1 -1
  180. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-acbc628a.js → xychartDiagram-e933f94c-488385e1.js} +1 -1
  181. rasa/core/channels/inspector/dist/index.html +1 -1
  182. rasa/core/channels/inspector/src/App.tsx +5 -31
  183. rasa/core/channels/inspector/src/components/Chat.tsx +2 -3
  184. rasa/core/channels/inspector/src/components/DialogueInformation.tsx +9 -1
  185. rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +63 -35
  186. rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +14 -0
  187. rasa/core/channels/inspector/src/types.ts +32 -7
  188. rasa/core/channels/studio_chat.py +23 -41
  189. rasa/core/channels/voice_stream/asr/asr_event.py +1 -1
  190. rasa/core/channels/voice_stream/asr/azure.py +6 -3
  191. rasa/core/channels/voice_stream/asr/deepgram.py +1 -1
  192. rasa/core/channels/voice_stream/audiocodes.py +3 -0
  193. rasa/core/channels/voice_stream/browser_audio.py +55 -3
  194. rasa/core/channels/voice_stream/genesys.py +2 -1
  195. rasa/core/channels/voice_stream/jambonz.py +9 -1
  196. rasa/core/channels/voice_stream/twilio_media_streams.py +16 -0
  197. rasa/core/channels/voice_stream/voice_channel.py +61 -0
  198. rasa/core/concurrent_lock_store.py +66 -16
  199. rasa/core/constants.py +7 -0
  200. rasa/core/iam_credentials_providers/__init__.py +0 -0
  201. rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +226 -0
  202. rasa/core/iam_credentials_providers/credentials_provider_protocol.py +90 -0
  203. rasa/core/lock_store.py +46 -10
  204. rasa/core/nlg/generator.py +1 -1
  205. rasa/core/policies/flows/flow_executor.py +1 -1
  206. rasa/core/processor.py +32 -0
  207. rasa/core/redis_connection_factory.py +469 -0
  208. rasa/core/tracker_stores/redis_tracker_store.py +32 -14
  209. rasa/core/tracker_stores/sql_tracker_store.py +57 -1
  210. rasa/engine/graph.py +5 -1
  211. rasa/engine/loader.py +12 -0
  212. rasa/engine/storage/local_model_storage.py +41 -4
  213. rasa/model_manager/socket_bridge.py +1 -2
  214. rasa/model_manager/warm_rasa_process.py +13 -3
  215. rasa/shared/core/constants.py +1 -0
  216. rasa/shared/core/events.py +2 -0
  217. rasa/shared/core/flows/flow.py +1 -1
  218. rasa/shared/nlu/training_data/schemas/responses.yml +3 -0
  219. rasa/utils/pypred.py +38 -0
  220. rasa/validator.py +12 -8
  221. rasa/version.py +1 -1
  222. {rasa_pro-3.14.0.dev20250901.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/METADATA +19 -16
  223. {rasa_pro-3.14.0.dev20250901.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/RECORD +231 -266
  224. rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +0 -47
  225. rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +0 -40
  226. rasa/cli/project_templates/finance/actions/action_session_start.py +0 -74
  227. rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +0 -48
  228. rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +0 -36
  229. rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +0 -54
  230. rasa/cli/project_templates/finance/actions/database.py +0 -277
  231. rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +0 -52
  232. rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +0 -51
  233. rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +0 -40
  234. rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +0 -40
  235. rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +0 -46
  236. rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +0 -49
  237. rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +0 -19
  238. rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +0 -36
  239. rasa/cli/project_templates/finance/csvs/accounts.csv +0 -8
  240. rasa/cli/project_templates/finance/csvs/advisors.csv +0 -7
  241. rasa/cli/project_templates/finance/csvs/appointments.csv +0 -211
  242. rasa/cli/project_templates/finance/csvs/branches.csv +0 -10
  243. rasa/cli/project_templates/finance/csvs/cards.csv +0 -11
  244. rasa/cli/project_templates/finance/csvs/payees.csv +0 -11
  245. rasa/cli/project_templates/finance/csvs/transactions.csv +0 -71
  246. rasa/cli/project_templates/finance/csvs/users.csv +0 -4
  247. rasa/cli/project_templates/finance/data/cards/select_card.yml +0 -12
  248. rasa/cli/project_templates/finance/data/general/bot_identity.yml +0 -6
  249. rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +0 -5
  250. rasa/cli/project_templates/finance/data/system/source/accounts.json +0 -51
  251. rasa/cli/project_templates/finance/data/system/source/advisors.json +0 -44
  252. rasa/cli/project_templates/finance/data/system/source/appointments.json +0 -1474
  253. rasa/cli/project_templates/finance/data/system/source/branches.json +0 -47
  254. rasa/cli/project_templates/finance/data/system/source/cards.json +0 -72
  255. rasa/cli/project_templates/finance/data/system/source/payees.json +0 -74
  256. rasa/cli/project_templates/finance/data/system/source/transactions.json +0 -492
  257. rasa/cli/project_templates/finance/data/system/source/users.json +0 -29
  258. rasa/cli/project_templates/finance/data/transfers/add_payee.yml +0 -29
  259. rasa/cli/project_templates/finance/data/transfers/list_payees.yml +0 -5
  260. rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +0 -21
  261. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +0 -8
  262. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +0 -8
  263. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +0 -8
  264. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +0 -8
  265. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +0 -8
  266. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +0 -7
  267. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +0 -8
  268. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +0 -8
  269. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +0 -8
  270. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +0 -8
  271. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +0 -8
  272. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +0 -8
  273. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +0 -8
  274. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +0 -8
  275. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +0 -8
  276. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +0 -8
  277. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +0 -8
  278. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +0 -8
  279. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +0 -8
  280. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +0 -8
  281. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +0 -50
  282. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +0 -50
  283. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +0 -48
  284. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +0 -50
  285. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +0 -50
  286. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +0 -47
  287. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +0 -50
  288. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +0 -50
  289. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +0 -47
  290. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +0 -50
  291. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +0 -50
  292. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +0 -50
  293. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +0 -47
  294. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +0 -50
  295. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +0 -50
  296. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +0 -47
  297. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +0 -50
  298. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +0 -50
  299. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +0 -47
  300. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +0 -50
  301. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +0 -50
  302. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +0 -47
  303. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +0 -47
  304. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +0 -50
  305. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +0 -50
  306. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +0 -47
  307. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +0 -50
  308. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +0 -50
  309. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +0 -47
  310. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +0 -50
  311. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +0 -50
  312. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +0 -47
  313. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +0 -50
  314. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +0 -50
  315. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +0 -50
  316. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +0 -47
  317. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +0 -50
  318. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +0 -50
  319. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +0 -47
  320. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +0 -50
  321. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +0 -50
  322. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +0 -47
  323. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +0 -50
  324. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +0 -50
  325. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +0 -50
  326. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +0 -47
  327. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +0 -50
  328. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +0 -50
  329. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +0 -47
  330. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +0 -50
  331. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +0 -50
  332. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +0 -47
  333. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +0 -50
  334. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +0 -50
  335. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +0 -47
  336. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +0 -47
  337. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +0 -50
  338. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +0 -50
  339. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +0 -50
  340. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +0 -50
  341. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +0 -47
  342. rasa/cli/project_templates/finance/domain/cards/select_card.yml +0 -12
  343. rasa/cli/project_templates/finance/domain/general/assistant_details.yml +0 -12
  344. rasa/cli/project_templates/finance/domain/general/bot_identity.yml +0 -5
  345. rasa/cli/project_templates/finance/domain/general/defaults.yml +0 -24
  346. rasa/cli/project_templates/finance/domain/general/help.yml +0 -5
  347. rasa/cli/project_templates/finance/domain/general/utils.yml +0 -13
  348. rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +0 -47
  349. rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +0 -4
  350. rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +0 -16
  351. rasa/core/channels/inspector/dist/assets/channel-b9b536fc.js +0 -1
  352. rasa/core/channels/inspector/dist/assets/clone-78d2ddcf.js +0 -1
  353. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-8b09c060.js +0 -1
  354. /rasa/cli/project_templates/telco/domain/billing/{domain_undertand_bill.yml → understand_bill.yml} +0 -0
  355. /rasa/cli/project_templates/telco/domain/network/{domain_reboot_router.yml → reboot_router.yml} +0 -0
  356. /rasa/cli/project_templates/telco/domain/network/{domain_reset_router.yml → reset_router.yml} +0 -0
  357. /rasa/cli/project_templates/telco/domain/network/{domain_run_speed_test.yml → run_speed_test.yml} +0 -0
  358. /rasa/cli/project_templates/telco/domain/network/{domain_solve_internet_issue.yml → solve_internet_issue.yml} +0 -0
  359. {rasa_pro-3.14.0.dev20250901.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/NOTICE +0 -0
  360. {rasa_pro-3.14.0.dev20250901.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/WHEEL +0 -0
  361. {rasa_pro-3.14.0.dev20250901.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/entry_points.txt +0 -0
@@ -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: '100%',
113
+ height: maxHeight,
115
114
  }}
116
115
  history={messages}
117
116
  demo={true}
@@ -95,6 +95,7 @@ export const DialougeInformation = ({
95
95
  }, [copiedText, toast])
96
96
 
97
97
  const testCases = formatTestCases(events, rasaChatSessionId)
98
+ const rasaLatency = getLastActionListenEvent(events)?.metadata?.execution_times
98
99
 
99
100
  return (
100
101
  <Flex sx={containerSx} {...props}>
@@ -166,7 +167,10 @@ export const DialougeInformation = ({
166
167
  </TabPanel>
167
168
  <TabPanel sx={tabPanelSx}>
168
169
  <Box sx={overflowBox}>
169
- <LatencyDisplay latency={latency} />
170
+ <LatencyDisplay
171
+ voiceLatency={latency}
172
+ rasaLatency={rasaLatency}
173
+ />
170
174
  </Box>
171
175
  </TabPanel>
172
176
  </TabPanels>
@@ -194,3 +198,7 @@ const CustomTab = (props: TabProps) => {
194
198
  </Button>
195
199
  )
196
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 { LatencyData } from '../types'
14
+ import {
15
+ isRasaLatency,
16
+ isVoiceLatency,
17
+ RasaLatency,
18
+ VoiceLatency,
19
+ } from '../types'
15
20
 
16
- interface Props extends FlexProps {
17
- latency: LatencyData
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 }: 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(latency.rasa_processing_latency_ms || 0);
38
- const color = getLatencyColor(value);
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 }: 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: 'Time between the request sent to Text-to-Speech processing and the first byte of audio received by Rasa.',
99
- tts_complete: '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.'
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
- latency,
269
+ voiceLatency,
270
+ rasaLatency,
252
271
  ...props
253
- }: Props) => {
254
- if (!latency) {
255
- console.warn('Latency data is not available')
256
- return null
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
- // Show waterfall if voice metrics are available, otherwise show minimal display
260
- const isVoiceMetricsAvailable =
261
- latency.asr_latency_ms && latency.tts_complete_latency_ms
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
- if (isVoiceMetricsAvailable) {
264
- return <WaterfallDisplay latency={latency} sx={sx} {...props} />
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
- return <MinimalDisplay latency={latency} sx={sx} {...props} />
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 LatencyData {
46
- rasa_processing_latency_ms?: number
47
- asr_latency_ms?: number
48
- tts_first_byte_latency_ms?: number
49
- tts_complete_latency_ms?: number
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 (
@@ -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
- ) -> Dict[str, Any]:
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
 
@@ -66,13 +63,7 @@ def tracker_as_dump(
66
63
  else:
67
64
  last_tracker = multiple_tracker_sessions[-1]
68
65
 
69
- # TODO: this is a bug: the bridge converts this back to json, but it
70
- # should be json in the first place
71
66
  state = last_tracker.current_state(EventVerbosity.AFTER_RESTART)
72
-
73
- if latency is not None:
74
- state["latency"] = {"rasa_processing_latency_ms": latency}
75
-
76
67
  return state
77
68
 
78
69
 
@@ -227,32 +218,16 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
227
218
  def _register_tracker_update_hook(self) -> None:
228
219
  plugin_manager().register(StudioTrackerUpdatePlugin(self))
229
220
 
230
- async def on_tracker_updated(
231
- self, tracker: "DialogueStateTracker", latency: Optional[float] = None
232
- ) -> None:
221
+ async def on_tracker_updated(self, tracker: "DialogueStateTracker") -> None:
233
222
  """Triggers a tracker update notification after a change to the tracker."""
234
- await self.publish_tracker_update(
235
- tracker.sender_id, tracker_as_dump(tracker, latency)
236
- )
223
+ await self.publish_tracker_update(tracker.sender_id, tracker_as_dump(tracker))
237
224
 
238
- async def publish_tracker_update(self, sender_id: str, tracker_dump: str) -> None:
225
+ async def publish_tracker_update(
226
+ self, sender_id: str, tracker_dump: Dict[str, Any]
227
+ ) -> None:
239
228
  """Publishes a tracker update notification to the websocket."""
240
229
  await self.emit("tracker", tracker_dump, room=sender_id)
241
230
 
242
- def _record_turn_start_time(self, sender_id: Text) -> None:
243
- """Records the start time of a new turn."""
244
- self._turn_start_times[sender_id] = time.time()
245
-
246
- def _get_latency(self, sender_id: Text) -> Optional[float]:
247
- """Returns the latency of the current turn in milliseconds."""
248
- if sender_id not in self._turn_start_times:
249
- return None
250
-
251
- latency = (time.time() - self._turn_start_times[sender_id]) * 1000
252
- # The turn is over, so we can remove the start time
253
- del self._turn_start_times[sender_id]
254
- return latency
255
-
256
231
  async def on_message_proxy(
257
232
  self,
258
233
  on_new_message: Callable[[UserMessage], Awaitable[Any]],
@@ -262,7 +237,6 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
262
237
 
263
238
  Triggers a tracker update notification after processing the message.
264
239
  """
265
- self._record_turn_start_time(message.sender_id)
266
240
  try:
267
241
  await on_new_message(message)
268
242
  except Exception as e:
@@ -288,8 +262,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
288
262
  structlogger.error("studio_chat.on_message_proxy.tracker_not_found")
289
263
  return
290
264
 
291
- latency = self._get_latency(message.sender_id)
292
- await self.on_tracker_updated(tracker, latency)
265
+ await self.on_tracker_updated(tracker)
293
266
 
294
267
  async def emit_error(self, message: str, room: str, e: Exception) -> None:
295
268
  await self.emit(
@@ -389,16 +362,23 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
389
362
  call_state.is_bot_speaking = True
390
363
  return ContinueConversationAction()
391
364
 
392
- def _create_output_channel(
365
+ def create_output_channel(
393
366
  self, voice_websocket: "Websocket", tts_engine: TTSEngine
394
367
  ) -> VoiceOutputChannel:
395
- """Create a voice output channel."""
368
+ """Create a voice output channel. This is used by VoiceInputChannel."""
396
369
  return StudioVoiceOutputChannel(
397
370
  voice_websocket,
398
371
  tts_engine,
399
372
  self.tts_cache,
400
373
  )
401
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
+
402
382
  def _start_voice_session(
403
383
  self,
404
384
  session_id: str,
@@ -469,8 +449,9 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
469
449
  def blueprint(
470
450
  self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
471
451
  ) -> SocketBlueprint:
472
- proxied_on_message = partial(self.on_message_proxy, on_new_message)
473
- socket_blueprint = super().blueprint(proxied_on_message)
452
+ socket_blueprint = super().blueprint(
453
+ partial(self.on_message_proxy, on_new_message)
454
+ )
474
455
 
475
456
  if not self.sio_server:
476
457
  structlogger.error("studio_chat.blueprint.sio_not_initialized")
@@ -480,7 +461,8 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
480
461
  async def after_server_start(
481
462
  app: "Sanic", _: asyncio.AbstractEventLoop
482
463
  ) -> None:
483
- self.agent = app.ctx.agent
464
+ if hasattr(app.ctx, "agent"):
465
+ self.agent = app.ctx.agent
484
466
 
485
467
  @self.sio_server.on("disconnect", namespace=self.namespace)
486
468
  async def disconnect(sid: Text) -> None:
@@ -505,7 +487,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
505
487
 
506
488
  # start a voice session if requested
507
489
  if data and data.get("is_voice", False):
508
- self._start_voice_session(data["session_id"], sid, proxied_on_message)
490
+ self._start_voice_session(data["session_id"], sid, on_new_message)
509
491
 
510
492
  @self.sio_server.on(self.user_message_evt, namespace=self.namespace)
511
493
  async def handle_message(sid: Text, data: Dict) -> None:
@@ -520,7 +502,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
520
502
 
521
503
  try:
522
504
  # Handle text messages
523
- await self.handle_user_message(sid, data, proxied_on_message)
505
+ await self.handle_user_message(sid, data, on_new_message)
524
506
  except Exception as e:
525
507
  structlogger.exception(
526
508
  "studio_chat.sio.handle_message.error",
@@ -15,7 +15,7 @@ class NewTranscript(ASREvent):
15
15
 
16
16
  @dataclass
17
17
  class UserIsSpeaking(ASREvent):
18
- pass
18
+ text: str
19
19
 
20
20
 
21
21
  @dataclass
@@ -1,7 +1,7 @@
1
1
  import asyncio
2
2
  import os
3
3
  from dataclasses import dataclass
4
- from typing import Any, AsyncIterator, Dict, Optional
4
+ from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, Optional
5
5
 
6
6
  import structlog
7
7
 
@@ -15,6 +15,9 @@ from rasa.core.channels.voice_stream.audio_bytes import HERTZ, RasaAudioBytes
15
15
  from rasa.shared.constants import AZURE_SPEECH_API_KEY_ENV_VAR
16
16
  from rasa.shared.exceptions import ConnectionException
17
17
 
18
+ if TYPE_CHECKING:
19
+ from azure.cognitiveservices.speech import SpeechRecognitionEventArgs
20
+
18
21
  logger = structlog.get_logger(__name__)
19
22
 
20
23
 
@@ -43,9 +46,9 @@ class AzureASR(ASREngine[AzureASRConfig]):
43
46
  )
44
47
  self.main_loop = asyncio.get_running_loop()
45
48
 
46
- def signal_user_is_speaking(self, event: Any) -> None:
49
+ def signal_user_is_speaking(self, event: "SpeechRecognitionEventArgs") -> None:
47
50
  """Replace the azure event with a generic is speaking event."""
48
- self.fill_queue(UserIsSpeaking())
51
+ self.fill_queue(UserIsSpeaking(event.result.text))
49
52
 
50
53
  def fill_queue(self, event: Any) -> None:
51
54
  """Either puts the event or a dedicated ASR Event into the queue."""
@@ -117,7 +117,7 @@ class DeepgramASR(ASREngine[DeepgramASRConfig]):
117
117
  self.accumulated_transcript, transcript
118
118
  )
119
119
  elif transcript:
120
- return UserIsSpeaking()
120
+ return UserIsSpeaking(transcript)
121
121
  # event that comes after utterance_end_ms of no new transcript
122
122
  elif data_type == "UtteranceEnd":
123
123
  if self.accumulated_transcript:
@@ -89,6 +89,7 @@ class AudiocodesVoiceOutputChannel(VoiceOutputChannel):
89
89
  # This is an approximation, as the bot will be sent the audio chunks next
90
90
  # which are played to the user immediately.
91
91
  call_state.is_bot_speaking = True
92
+ VoiceInputChannel._cancel_silence_timeout_watcher()
92
93
 
93
94
  async def send_intermediate_marker(self, recipient_id: str) -> None:
94
95
  """Audiocodes doesn't need intermediate markers, so do nothing."""
@@ -116,6 +117,7 @@ class AudiocodesVoiceInputChannel(VoiceInputChannel):
116
117
  server_url: str,
117
118
  asr_config: Dict,
118
119
  tts_config: Dict,
120
+ interruptions: Optional[Dict[str, int]] = None,
119
121
  token: Optional[Text] = None,
120
122
  ):
121
123
  mark_as_beta_feature("Audiocodes (audiocodes_stream) Channel")
@@ -123,6 +125,7 @@ class AudiocodesVoiceInputChannel(VoiceInputChannel):
123
125
  server_url=server_url,
124
126
  asr_config=asr_config,
125
127
  tts_config=tts_config,
128
+ interruptions=interruptions,
126
129
  )
127
130
  self.token = token
128
131
 
@@ -3,7 +3,9 @@ from __future__ import annotations
3
3
  import audioop
4
4
  import base64
5
5
  import json
6
+ import os
6
7
  import uuid
8
+ import wave
7
9
  from typing import Any, Awaitable, Callable, Dict, Optional, Tuple
8
10
 
9
11
  import structlog
@@ -69,11 +71,48 @@ class BrowserAudioOutputChannel(VoiceOutputChannel):
69
71
 
70
72
 
71
73
  class BrowserAudioInputChannel(VoiceInputChannel):
74
+ requires_voice_license = False
75
+
72
76
  def __init__(
73
- self, server_url: str, asr_config: Dict[str, Any], tts_config: Dict[str, Any]
77
+ self,
78
+ server_url: str,
79
+ asr_config: Dict[str, Any],
80
+ tts_config: Dict[str, Any],
81
+ recording: bool = False,
82
+ interruptions: Optional[Dict[str, int]] = None,
74
83
  ) -> None:
75
84
  """Initializes the browser audio input channel."""
76
- super().__init__(server_url, asr_config, tts_config)
85
+ super().__init__(server_url, asr_config, tts_config, interruptions)
86
+
87
+ # For debugging, recording of user audio might be useful
88
+ # to identify audio quality issues or transcription errors
89
+ self._recording_enabled = recording
90
+ self._wav_file: Optional[wave.Wave_write] = None
91
+
92
+ def _start_recording(self, call_id: str, user_id: str) -> None:
93
+ os.makedirs("recordings", exist_ok=True)
94
+ filename = f"{user_id}_{call_id}.wav"
95
+ file_path = os.path.join("recordings", filename)
96
+
97
+ if not self._recording_enabled:
98
+ return
99
+
100
+ self._wav_file = wave.open(file_path, "wb")
101
+ self._wav_file.setnchannels(1) # Mono audio
102
+ self._wav_file.setsampwidth(4) # 32-bit audio (4 bytes)
103
+ self._wav_file.setframerate(8000) # 8kHz sample rate
104
+ logger.info("voice_channel.user_audio_recording.started", file_path=file_path)
105
+
106
+ def _append_audio_to_recording(self, audio_bytes: bytes) -> None:
107
+ if self._wav_file and self._recording_enabled:
108
+ self._wav_file.writeframes(audio_bytes)
109
+
110
+ def _stop_recording(self) -> None:
111
+ """Close the recording file if it's open."""
112
+ if self._wav_file:
113
+ self._wav_file.close()
114
+ self._wav_file = None
115
+ logger.debug("voice_channel.user_audio_recording.stopped")
77
116
 
78
117
  @classmethod
79
118
  def name(cls) -> str:
@@ -94,7 +133,7 @@ class BrowserAudioInputChannel(VoiceInputChannel):
94
133
  credentials: Optional[Dict[str, Any]],
95
134
  ) -> BrowserAudioInputChannel:
96
135
  cls.validate_basic_credentials(credentials)
97
- new_creds = repack_voice_credentials(credentials)
136
+ new_creds = repack_voice_credentials(credentials or {})
98
137
  return cls(**new_creds)
99
138
 
100
139
  def map_input_message(
@@ -105,6 +144,7 @@ class BrowserAudioInputChannel(VoiceInputChannel):
105
144
  data = json.loads(message)
106
145
  if "audio" in data:
107
146
  channel_bytes = base64.b64decode(data["audio"])
147
+ self._append_audio_to_recording(channel_bytes)
108
148
  audio_bytes = self.channel_bytes_to_rasa_audio_bytes(channel_bytes)
109
149
  return NewAudioAction(audio_bytes)
110
150
  elif "marker" in data:
@@ -120,6 +160,13 @@ class BrowserAudioInputChannel(VoiceInputChannel):
120
160
  call_state.is_bot_speaking = True
121
161
  return ContinueConversationAction()
122
162
 
163
+ async def interrupt_playback(
164
+ self, ws: Websocket, call_parameters: CallParameters
165
+ ) -> None:
166
+ """Interrupt the current playback of audio."""
167
+ logger.debug("browser_audio.interrupt_playback")
168
+ await ws.send(json.dumps({"interruptPlayback": True}))
169
+
123
170
  def create_output_channel(
124
171
  self, voice_websocket: Websocket, tts_engine: TTSEngine
125
172
  ) -> VoiceOutputChannel:
@@ -142,8 +189,13 @@ class BrowserAudioInputChannel(VoiceInputChannel):
142
189
  @blueprint.websocket("/websocket") # type: ignore
143
190
  async def handle_message(request: Request, ws: Websocket) -> None:
144
191
  try:
192
+ call_parameters = await self.collect_call_parameters(ws)
193
+ if call_parameters and call_parameters.call_id:
194
+ self._start_recording(call_parameters.call_id, "local")
145
195
  await self.run_audio_streaming(on_new_message, ws)
146
196
  except Exception as e:
147
197
  logger.error("browser_audio.handle_message.error", error=e)
198
+ finally:
199
+ self._stop_recording()
148
200
 
149
201
  return blueprint