rasa-pro 3.14.0a15__py3-none-any.whl → 3.14.0a17__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 (331) hide show
  1. rasa/builder/config.py +1 -0
  2. rasa/builder/copilot/constants.py +3 -0
  3. rasa/builder/copilot/copilot.py +127 -31
  4. rasa/builder/copilot/models.py +34 -0
  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/jobs.py +15 -5
  10. rasa/builder/main.py +14 -5
  11. rasa/builder/models.py +7 -7
  12. rasa/builder/project_generator.py +128 -23
  13. rasa/builder/service.py +42 -27
  14. rasa/builder/template_cache.py +183 -9
  15. rasa/cli/project_templates/basic/README.md +23 -0
  16. rasa/cli/project_templates/basic/actions/actions.md +10 -0
  17. rasa/cli/project_templates/basic/config.yml +4 -4
  18. rasa/cli/project_templates/basic/data/data.md +5 -6
  19. rasa/cli/project_templates/basic/domain/domain.md +7 -5
  20. rasa/cli/project_templates/basic/domain/general/show_faqs.yml +1 -1
  21. rasa/cli/project_templates/basic/endpoints.yml +1 -1
  22. rasa/cli/project_templates/finance/README.md +26 -0
  23. rasa/cli/project_templates/finance/actions/__init__.py +0 -46
  24. rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
  25. rasa/cli/project_templates/finance/actions/actions.md +15 -0
  26. rasa/cli/project_templates/finance/actions/{transfers/action_process_immediate_payment.py → cards/check_that_card_exists.py} +6 -3
  27. rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
  28. rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
  29. rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
  30. rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
  31. rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
  32. rasa/cli/project_templates/finance/actions/db.py +117 -0
  33. rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
  34. rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
  35. rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
  36. rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
  37. rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
  38. rasa/cli/project_templates/finance/config.yml +6 -0
  39. rasa/cli/project_templates/finance/credentials.yml +7 -6
  40. rasa/cli/project_templates/finance/data/accounts/check_balance.yml +3 -4
  41. rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
  42. rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
  43. rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
  44. rasa/cli/project_templates/finance/data/cards/block_card.yml +37 -58
  45. rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
  46. rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
  47. rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
  48. rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
  49. rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
  50. rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
  51. rasa/cli/project_templates/finance/data/data.md +14 -0
  52. rasa/cli/project_templates/finance/data/general/agent_details.yml +6 -0
  53. rasa/cli/project_templates/finance/data/general/hello.yml +1 -2
  54. rasa/cli/project_templates/finance/data/general/help.yml +2 -2
  55. rasa/cli/project_templates/finance/data/general/human_handoff.yml +1 -1
  56. rasa/cli/project_templates/finance/data/transfers/check_transfer_limit.yml +18 -0
  57. rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
  58. rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
  59. rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +29 -62
  60. rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
  61. rasa/cli/project_templates/finance/db/cards.json +18 -0
  62. rasa/cli/project_templates/finance/db/contacts.json +10 -0
  63. rasa/cli/project_templates/finance/db/my_account.json +6 -0
  64. rasa/cli/project_templates/finance/db/transactions.json +22 -0
  65. rasa/cli/project_templates/finance/docs/docs.md +8 -0
  66. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
  67. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
  68. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
  69. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
  70. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
  71. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
  72. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
  73. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
  74. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
  75. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
  76. rasa/cli/project_templates/finance/domain/_system/patterns/pattern_session_start.yml +11 -0
  77. rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +9 -5
  78. rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
  79. rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
  80. rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
  81. rasa/cli/project_templates/finance/domain/cards/block_card.yml +33 -90
  82. rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
  83. rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
  84. rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
  85. rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
  86. rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
  87. rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
  88. rasa/cli/project_templates/finance/domain/domain.md +18 -0
  89. rasa/cli/project_templates/finance/domain/general/_shared.yml +53 -0
  90. rasa/cli/project_templates/finance/domain/general/agent_details.yml +31 -0
  91. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -2
  92. rasa/cli/project_templates/finance/domain/general/feedback.yml +0 -3
  93. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +7 -3
  94. rasa/cli/project_templates/finance/domain/general/welcome.yml +5 -2
  95. rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
  96. rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
  97. rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
  98. rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +203 -61
  99. rasa/cli/project_templates/finance/endpoints.yml +4 -3
  100. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +31 -12
  101. rasa/cli/project_templates/telco/README.md +25 -0
  102. rasa/cli/project_templates/telco/actions/actions.md +12 -0
  103. rasa/cli/project_templates/telco/config.yml +4 -4
  104. rasa/cli/project_templates/telco/data/data.md +11 -0
  105. rasa/cli/project_templates/telco/data/general/human_handoff.yml +1 -1
  106. rasa/cli/project_templates/telco/docs/docs.md +3 -0
  107. rasa/cli/project_templates/telco/domain/domain.md +13 -0
  108. rasa/cli/project_templates/telco/domain/general/human_handoff.yml +3 -6
  109. rasa/cli/project_templates/telco/endpoints.yml +1 -1
  110. rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +1 -1
  111. rasa/cli/project_templates/telco/tests/e2e_test_cases/billing/understand_bill.yml +67 -0
  112. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
  113. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +46 -0
  114. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/goodbye.yml +9 -0
  115. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +8 -0
  116. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +35 -0
  117. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +23 -0
  118. rasa/cli/project_templates/telco/tests/e2e_test_cases/network/solve_internet_issue.yml +57 -0
  119. rasa/core/brokers/broker.py +1 -1
  120. rasa/core/brokers/kafka.py +52 -8
  121. rasa/core/channels/development_inspector.py +1 -21
  122. rasa/core/channels/hangouts.py +2 -2
  123. rasa/core/channels/inspector/dist/assets/{arc-c24d8d79.js → arc-35222594.js} +1 -1
  124. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-1b6b9f26.js → blockDiagram-38ab4fdb-a0efbfd3.js} +1 -1
  125. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-da91d0f9.js → c4Diagram-3d4e48cf-0584c0f2.js} +1 -1
  126. rasa/core/channels/inspector/dist/assets/channel-8e08bed9.js +1 -0
  127. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-6067f302.js → classDiagram-70f12bd4-39f40dbe.js} +1 -1
  128. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-705d024a.js → classDiagram-v2-f2320105-1ad755f3.js} +1 -1
  129. rasa/core/channels/inspector/dist/assets/clone-78c82dea.js +1 -0
  130. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-3751dffe.js → createText-2e5e7dd3-b0f4f0fe.js} +1 -1
  131. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-7b25b4af.js → edges-e0da2a9e-9039bff9.js} +1 -1
  132. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-eb7deea8.js → erDiagram-9861fffd-65c9b127.js} +1 -1
  133. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-67235ff6.js → flowDb-956e92f1-4f08b38e.js} +1 -1
  134. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-34c3a16a.js → flowDiagram-66a62f08-e95c362a.js} +1 -1
  135. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b08f601.js +1 -0
  136. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-f1a93631.js → flowchart-elk-definition-4a651766-703c3015.js} +1 -1
  137. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-a68cbad1.js → ganttDiagram-c361ad54-699328ea.js} +1 -1
  138. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-0b1e4a1d.js → gitGraphDiagram-72cf32ee-04cf4b05.js} +1 -1
  139. rasa/core/channels/inspector/dist/assets/{graph-f3c1d212.js → graph-ee94449e.js} +1 -1
  140. rasa/core/channels/inspector/dist/assets/{index-3862675e-34cbca30.js → index-3862675e-940162b4.js} +1 -1
  141. rasa/core/channels/inspector/dist/assets/{index-051c5a6e.js → index-c941dcb3.js} +41 -40
  142. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-e69960a1.js → infoDiagram-f8f76790-c79c2866.js} +1 -1
  143. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-8dd3296a.js → journeyDiagram-49397b02-84489d30.js} +1 -1
  144. rasa/core/channels/inspector/dist/assets/{layout-e93126bc.js → layout-a9aa9858.js} +1 -1
  145. rasa/core/channels/inspector/dist/assets/{line-15eb1e26.js → line-eb73cf26.js} +1 -1
  146. rasa/core/channels/inspector/dist/assets/{linear-fec95d33.js → linear-b3399f9a.js} +1 -1
  147. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-2557813e.js → mindmap-definition-fc14e90a-b095bf1a.js} +1 -1
  148. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-40d756b1.js → pieDiagram-8a3498a8-07644b66.js} +1 -1
  149. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-a48cbdcd.js → quadrantDiagram-120e2f19-573a3f9c.js} +1 -1
  150. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-dc778150.js → requirementDiagram-deff3bca-d457e1e1.js} +1 -1
  151. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-10026b94.js → sankeyDiagram-04a897e0-9d26e1a2.js} +1 -1
  152. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-3b2ed10a.js → sequenceDiagram-704730f1-3a9cde10.js} +1 -1
  153. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-c5f3b3fb.js → stateDiagram-587899a1-4f3e8cec.js} +1 -1
  154. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-e503656b.js → stateDiagram-v2-d93cdb3a-e617e5bf.js} +1 -1
  155. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-a683ce56.js → styles-6aaf32cf-eab30d2f.js} +1 -1
  156. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-02bcdcee.js → styles-9a916d00-09994be2.js} +1 -1
  157. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-8e90dbb9.js → styles-c10674c1-b7110364.js} +1 -1
  158. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-7c23fc1e.js → svgDrawCommon-08f97a94-3ebc92ad.js} +1 -1
  159. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-c42faec8.js → timeline-definition-85554ec2-7d13d2f2.js} +1 -1
  160. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-5e3bb0ea.js → xychartDiagram-e933f94c-488385e1.js} +1 -1
  161. rasa/core/channels/inspector/dist/index.html +1 -1
  162. rasa/core/channels/inspector/src/App.tsx +0 -7
  163. rasa/core/channels/inspector/src/components/DialogueInformation.tsx +9 -1
  164. rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +63 -35
  165. rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +14 -0
  166. rasa/core/channels/inspector/src/types.ts +32 -7
  167. rasa/core/channels/studio_chat.py +21 -40
  168. rasa/core/channels/voice_stream/asr/asr_event.py +1 -1
  169. rasa/core/channels/voice_stream/asr/azure.py +6 -3
  170. rasa/core/channels/voice_stream/asr/deepgram.py +1 -1
  171. rasa/core/channels/voice_stream/audiocodes.py +3 -0
  172. rasa/core/channels/voice_stream/browser_audio.py +53 -3
  173. rasa/core/channels/voice_stream/genesys.py +2 -1
  174. rasa/core/channels/voice_stream/jambonz.py +9 -1
  175. rasa/core/channels/voice_stream/twilio_media_streams.py +16 -0
  176. rasa/core/channels/voice_stream/voice_channel.py +61 -0
  177. rasa/core/constants.py +6 -0
  178. rasa/core/iam_credentials_providers/__init__.py +0 -0
  179. rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +141 -0
  180. rasa/core/iam_credentials_providers/credentials_provider_protocol.py +89 -0
  181. rasa/core/lock_store.py +41 -7
  182. rasa/core/processor.py +32 -0
  183. rasa/core/redis_connection_factory.py +411 -0
  184. rasa/core/tracker_stores/redis_tracker_store.py +32 -14
  185. rasa/core/tracker_stores/sql_tracker_store.py +57 -1
  186. rasa/model_manager/socket_bridge.py +1 -2
  187. rasa/shared/core/constants.py +1 -0
  188. rasa/shared/core/events.py +2 -0
  189. rasa/shared/nlu/training_data/schemas/responses.yml +3 -0
  190. rasa/version.py +1 -1
  191. {rasa_pro-3.14.0a15.dist-info → rasa_pro-3.14.0a17.dist-info}/METADATA +14 -14
  192. {rasa_pro-3.14.0a15.dist-info → rasa_pro-3.14.0a17.dist-info}/RECORD +200 -249
  193. rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +0 -47
  194. rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +0 -40
  195. rasa/cli/project_templates/finance/actions/action_session_start.py +0 -74
  196. rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +0 -48
  197. rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +0 -36
  198. rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +0 -54
  199. rasa/cli/project_templates/finance/actions/database.py +0 -277
  200. rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +0 -52
  201. rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +0 -51
  202. rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +0 -40
  203. rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +0 -40
  204. rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +0 -46
  205. rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +0 -49
  206. rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +0 -19
  207. rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +0 -36
  208. rasa/cli/project_templates/finance/csvs/accounts.csv +0 -8
  209. rasa/cli/project_templates/finance/csvs/advisors.csv +0 -7
  210. rasa/cli/project_templates/finance/csvs/appointments.csv +0 -211
  211. rasa/cli/project_templates/finance/csvs/branches.csv +0 -10
  212. rasa/cli/project_templates/finance/csvs/cards.csv +0 -11
  213. rasa/cli/project_templates/finance/csvs/payees.csv +0 -11
  214. rasa/cli/project_templates/finance/csvs/transactions.csv +0 -71
  215. rasa/cli/project_templates/finance/csvs/users.csv +0 -4
  216. rasa/cli/project_templates/finance/data/cards/select_card.yml +0 -12
  217. rasa/cli/project_templates/finance/data/general/bot_identity.yml +0 -6
  218. rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +0 -5
  219. rasa/cli/project_templates/finance/data/system/source/accounts.json +0 -51
  220. rasa/cli/project_templates/finance/data/system/source/advisors.json +0 -44
  221. rasa/cli/project_templates/finance/data/system/source/appointments.json +0 -1474
  222. rasa/cli/project_templates/finance/data/system/source/branches.json +0 -47
  223. rasa/cli/project_templates/finance/data/system/source/cards.json +0 -72
  224. rasa/cli/project_templates/finance/data/system/source/payees.json +0 -74
  225. rasa/cli/project_templates/finance/data/system/source/transactions.json +0 -492
  226. rasa/cli/project_templates/finance/data/system/source/users.json +0 -29
  227. rasa/cli/project_templates/finance/data/transfers/add_payee.yml +0 -29
  228. rasa/cli/project_templates/finance/data/transfers/list_payees.yml +0 -5
  229. rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +0 -21
  230. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +0 -8
  231. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +0 -8
  232. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +0 -8
  233. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +0 -8
  234. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +0 -8
  235. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +0 -7
  236. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +0 -8
  237. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +0 -8
  238. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +0 -8
  239. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +0 -8
  240. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +0 -8
  241. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +0 -8
  242. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +0 -8
  243. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +0 -8
  244. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +0 -8
  245. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +0 -8
  246. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +0 -8
  247. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +0 -8
  248. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +0 -8
  249. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +0 -8
  250. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +0 -50
  251. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +0 -50
  252. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +0 -48
  253. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +0 -50
  254. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +0 -50
  255. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +0 -47
  256. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +0 -50
  257. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +0 -50
  258. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +0 -47
  259. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +0 -50
  260. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +0 -50
  261. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +0 -50
  262. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +0 -47
  263. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +0 -50
  264. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +0 -50
  265. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +0 -47
  266. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +0 -50
  267. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +0 -50
  268. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +0 -47
  269. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +0 -50
  270. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +0 -50
  271. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +0 -47
  272. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +0 -47
  273. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +0 -50
  274. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +0 -50
  275. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +0 -47
  276. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +0 -50
  277. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +0 -50
  278. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +0 -47
  279. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +0 -50
  280. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +0 -50
  281. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +0 -47
  282. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +0 -50
  283. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +0 -50
  284. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +0 -50
  285. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +0 -47
  286. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +0 -50
  287. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +0 -50
  288. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +0 -47
  289. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +0 -50
  290. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +0 -50
  291. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +0 -47
  292. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +0 -50
  293. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +0 -50
  294. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +0 -50
  295. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +0 -47
  296. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +0 -50
  297. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +0 -50
  298. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +0 -47
  299. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +0 -50
  300. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +0 -50
  301. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +0 -47
  302. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +0 -50
  303. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +0 -50
  304. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +0 -47
  305. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +0 -47
  306. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +0 -50
  307. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +0 -50
  308. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +0 -50
  309. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +0 -50
  310. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +0 -47
  311. rasa/cli/project_templates/finance/domain/cards/select_card.yml +0 -12
  312. rasa/cli/project_templates/finance/domain/general/assistant_details.yml +0 -12
  313. rasa/cli/project_templates/finance/domain/general/bot_identity.yml +0 -5
  314. rasa/cli/project_templates/finance/domain/general/defaults.yml +0 -24
  315. rasa/cli/project_templates/finance/domain/general/goodbye.yml +0 -7
  316. rasa/cli/project_templates/finance/domain/general/help.yml +0 -5
  317. rasa/cli/project_templates/finance/domain/general/utils.yml +0 -13
  318. rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +0 -47
  319. rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +0 -4
  320. rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +0 -16
  321. rasa/core/channels/inspector/dist/assets/channel-d2444dfd.js +0 -1
  322. rasa/core/channels/inspector/dist/assets/clone-281a0990.js +0 -1
  323. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-aa4cca3b.js +0 -1
  324. /rasa/cli/project_templates/telco/domain/billing/{domain_undertand_bill.yml → understand_bill.yml} +0 -0
  325. /rasa/cli/project_templates/telco/domain/network/{domain_reboot_router.yml → reboot_router.yml} +0 -0
  326. /rasa/cli/project_templates/telco/domain/network/{domain_reset_router.yml → reset_router.yml} +0 -0
  327. /rasa/cli/project_templates/telco/domain/network/{domain_run_speed_test.yml → run_speed_test.yml} +0 -0
  328. /rasa/cli/project_templates/telco/domain/network/{domain_solve_internet_issue.yml → solve_internet_issue.yml} +0 -0
  329. {rasa_pro-3.14.0a15.dist-info → rasa_pro-3.14.0a17.dist-info}/NOTICE +0 -0
  330. {rasa_pro-3.14.0a15.dist-info → rasa_pro-3.14.0a17.dist-info}/WHEEL +0 -0
  331. {rasa_pro-3.14.0a15.dist-info → rasa_pro-3.14.0a17.dist-info}/entry_points.txt +0 -0
@@ -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")
@@ -506,7 +487,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
506
487
 
507
488
  # start a voice session if requested
508
489
  if data and data.get("is_voice", False):
509
- self._start_voice_session(data["session_id"], sid, proxied_on_message)
490
+ self._start_voice_session(data["session_id"], sid, on_new_message)
510
491
 
511
492
  @self.sio_server.on(self.user_message_evt, namespace=self.namespace)
512
493
  async def handle_message(sid: Text, data: Dict) -> None:
@@ -521,7 +502,7 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
521
502
 
522
503
  try:
523
504
  # Handle text messages
524
- await self.handle_user_message(sid, data, proxied_on_message)
505
+ await self.handle_user_message(sid, data, on_new_message)
525
506
  except Exception as e:
526
507
  structlogger.exception(
527
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
@@ -70,10 +72,45 @@ class BrowserAudioOutputChannel(VoiceOutputChannel):
70
72
 
71
73
  class BrowserAudioInputChannel(VoiceInputChannel):
72
74
  def __init__(
73
- self, server_url: str, asr_config: Dict[str, Any], tts_config: Dict[str, Any]
75
+ self,
76
+ server_url: str,
77
+ asr_config: Dict[str, Any],
78
+ tts_config: Dict[str, Any],
79
+ recording: bool = False,
80
+ interruptions: Optional[Dict[str, int]] = None,
74
81
  ) -> None:
75
82
  """Initializes the browser audio input channel."""
76
- super().__init__(server_url, asr_config, tts_config)
83
+ super().__init__(server_url, asr_config, tts_config, interruptions)
84
+
85
+ # For debugging, recording of user audio might be useful
86
+ # to identify audio quality issues or transcription errors
87
+ self._recording_enabled = recording
88
+ self._wav_file: Optional[wave.Wave_write] = None
89
+
90
+ def _start_recording(self, call_id: str, user_id: str) -> None:
91
+ os.makedirs("recordings", exist_ok=True)
92
+ filename = f"{user_id}_{call_id}.wav"
93
+ file_path = os.path.join("recordings", filename)
94
+
95
+ if not self._recording_enabled:
96
+ return
97
+
98
+ self._wav_file = wave.open(file_path, "wb")
99
+ self._wav_file.setnchannels(1) # Mono audio
100
+ self._wav_file.setsampwidth(4) # 32-bit audio (4 bytes)
101
+ self._wav_file.setframerate(8000) # 8kHz sample rate
102
+ logger.info("voice_channel.user_audio_recording.started", file_path=file_path)
103
+
104
+ def _append_audio_to_recording(self, audio_bytes: bytes) -> None:
105
+ if self._wav_file and self._recording_enabled:
106
+ self._wav_file.writeframes(audio_bytes)
107
+
108
+ def _stop_recording(self) -> None:
109
+ """Close the recording file if it's open."""
110
+ if self._wav_file:
111
+ self._wav_file.close()
112
+ self._wav_file = None
113
+ logger.debug("voice_channel.user_audio_recording.stopped")
77
114
 
78
115
  @classmethod
79
116
  def name(cls) -> str:
@@ -94,7 +131,7 @@ class BrowserAudioInputChannel(VoiceInputChannel):
94
131
  credentials: Optional[Dict[str, Any]],
95
132
  ) -> BrowserAudioInputChannel:
96
133
  cls.validate_basic_credentials(credentials)
97
- new_creds = repack_voice_credentials(credentials)
134
+ new_creds = repack_voice_credentials(credentials or {})
98
135
  return cls(**new_creds)
99
136
 
100
137
  def map_input_message(
@@ -105,6 +142,7 @@ class BrowserAudioInputChannel(VoiceInputChannel):
105
142
  data = json.loads(message)
106
143
  if "audio" in data:
107
144
  channel_bytes = base64.b64decode(data["audio"])
145
+ self._append_audio_to_recording(channel_bytes)
108
146
  audio_bytes = self.channel_bytes_to_rasa_audio_bytes(channel_bytes)
109
147
  return NewAudioAction(audio_bytes)
110
148
  elif "marker" in data:
@@ -120,6 +158,13 @@ class BrowserAudioInputChannel(VoiceInputChannel):
120
158
  call_state.is_bot_speaking = True
121
159
  return ContinueConversationAction()
122
160
 
161
+ async def interrupt_playback(
162
+ self, ws: Websocket, call_parameters: CallParameters
163
+ ) -> None:
164
+ """Interrupt the current playback of audio."""
165
+ logger.debug("browser_audio.interrupt_playback")
166
+ await ws.send(json.dumps({"interruptPlayback": True}))
167
+
123
168
  def create_output_channel(
124
169
  self, voice_websocket: Websocket, tts_engine: TTSEngine
125
170
  ) -> VoiceOutputChannel:
@@ -142,8 +187,13 @@ class BrowserAudioInputChannel(VoiceInputChannel):
142
187
  @blueprint.websocket("/websocket") # type: ignore
143
188
  async def handle_message(request: Request, ws: Websocket) -> None:
144
189
  try:
190
+ call_parameters = await self.collect_call_parameters(ws)
191
+ if call_parameters and call_parameters.call_id:
192
+ self._start_recording(call_parameters.call_id, "local")
145
193
  await self.run_audio_streaming(on_new_message, ws)
146
194
  except Exception as e:
147
195
  logger.error("browser_audio.handle_message.error", error=e)
196
+ finally:
197
+ self._stop_recording()
148
198
 
149
199
  return blueprint
@@ -99,10 +99,11 @@ class GenesysInputChannel(VoiceInputChannel):
99
99
  server_url: str,
100
100
  asr_config: Dict,
101
101
  tts_config: Dict,
102
+ interruptions: Optional[Dict[str, int]] = None,
102
103
  api_key: Optional[Text] = None,
103
104
  client_secret: Optional[Text] = None,
104
105
  ) -> None:
105
- super().__init__(server_url, asr_config, tts_config)
106
+ super().__init__(server_url, asr_config, tts_config, interruptions)
106
107
  self.api_key = api_key
107
108
  self.client_secret = client_secret
108
109
 
@@ -81,6 +81,7 @@ class JambonzStreamInputChannel(VoiceInputChannel):
81
81
  server_url: str,
82
82
  asr_config: Dict,
83
83
  tts_config: Dict,
84
+ interruptions: Optional[Dict[str, int]] = None,
84
85
  username: Optional[Text] = None,
85
86
  password: Optional[Text] = None,
86
87
  ) -> None:
@@ -90,7 +91,7 @@ class JambonzStreamInputChannel(VoiceInputChannel):
90
91
  username: Optional username for basic auth
91
92
  password: Optional password for basic auth
92
93
  """
93
- super().__init__(server_url, asr_config, tts_config)
94
+ super().__init__(server_url, asr_config, tts_config, interruptions)
94
95
  self.username = username
95
96
  self.password = password
96
97
 
@@ -185,6 +186,13 @@ class JambonzStreamInputChannel(VoiceInputChannel):
185
186
  self.tts_cache,
186
187
  )
187
188
 
189
+ async def interrupt_playback(
190
+ self, ws: Websocket, call_parameters: CallParameters
191
+ ) -> None:
192
+ """Interrupt the current playback of audio."""
193
+ logger.debug("jambonz.interrupt_playback")
194
+ await ws.send(json.dumps({"type": "killAudio"}))
195
+
188
196
  def blueprint(
189
197
  self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
190
198
  ) -> Blueprint: