rasa-pro 3.14.0.dev20250825__py3-none-any.whl → 3.14.0.dev20250922__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rasa-pro might be problematic. Click here for more details.

Files changed (351) hide show
  1. rasa/builder/README.md +120 -0
  2. rasa/builder/__init__.py +0 -0
  3. rasa/builder/auth.py +176 -0
  4. rasa/builder/config.py +92 -0
  5. rasa/builder/copilot/__init__.py +0 -0
  6. rasa/builder/copilot/constants.py +31 -0
  7. rasa/builder/copilot/copilot.py +450 -0
  8. rasa/builder/copilot/copilot_response_handler.py +522 -0
  9. rasa/builder/copilot/copilot_templated_message_provider.py +58 -0
  10. rasa/builder/copilot/exceptions.py +32 -0
  11. rasa/builder/copilot/models.py +500 -0
  12. rasa/builder/copilot/prompts/__init__.py +0 -0
  13. rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +766 -0
  14. rasa/builder/copilot/prompts/latest_user_message_context_prompt.jinja2 +61 -0
  15. rasa/builder/copilot/signing.py +305 -0
  16. rasa/builder/copilot/telemetry.py +226 -0
  17. rasa/builder/copilot/templated_messages/__init__.py +0 -0
  18. rasa/builder/copilot/templated_messages/copilot_internal_messages_templates.yml +16 -0
  19. rasa/builder/copilot/templated_messages/copilot_templated_responses.yml +38 -0
  20. rasa/builder/document_retrieval/__init__.py +0 -0
  21. rasa/builder/document_retrieval/constants.py +15 -0
  22. rasa/builder/document_retrieval/inkeep-rag-response-schema.json +64 -0
  23. rasa/builder/document_retrieval/inkeep_document_retrieval.py +238 -0
  24. rasa/builder/document_retrieval/models.py +62 -0
  25. rasa/builder/download.py +140 -0
  26. rasa/builder/exceptions.py +91 -0
  27. rasa/builder/guardrails/__init__.py +1 -0
  28. rasa/builder/guardrails/constants.py +9 -0
  29. rasa/builder/guardrails/exceptions.py +4 -0
  30. rasa/builder/guardrails/lakera.py +206 -0
  31. rasa/builder/guardrails/models.py +231 -0
  32. rasa/builder/guardrails/store.py +238 -0
  33. rasa/builder/guardrails/utils.py +328 -0
  34. rasa/builder/job_manager.py +87 -0
  35. rasa/builder/jobs.py +282 -0
  36. rasa/builder/llm_service.py +246 -0
  37. rasa/builder/logging_utils.py +265 -0
  38. rasa/builder/main.py +234 -0
  39. rasa/builder/models.py +216 -0
  40. rasa/builder/project_generator.py +458 -0
  41. rasa/builder/project_info.py +72 -0
  42. rasa/builder/scrape_rasa_docs.py +97 -0
  43. rasa/builder/service.py +1350 -0
  44. rasa/builder/shared/tracker_context.py +212 -0
  45. rasa/builder/skill_to_bot_prompt.jinja2 +164 -0
  46. rasa/builder/template_cache.py +69 -0
  47. rasa/builder/training_service.py +194 -0
  48. rasa/builder/validation_service.py +97 -0
  49. rasa/cli/project_templates/basic/README.md +23 -0
  50. rasa/cli/project_templates/basic/actions/__init__ +0 -0
  51. rasa/cli/project_templates/basic/actions/action_human_handoff.py +40 -0
  52. rasa/cli/project_templates/basic/actions/actions.md +10 -0
  53. rasa/cli/project_templates/basic/config.yml +29 -0
  54. rasa/cli/project_templates/basic/credentials.yml +33 -0
  55. rasa/cli/project_templates/basic/data/data.md +8 -0
  56. rasa/cli/project_templates/basic/data/general/feedback.yml +21 -0
  57. rasa/cli/project_templates/basic/data/general/goodbye.yml +6 -0
  58. rasa/cli/project_templates/basic/data/general/hello.yml +6 -0
  59. rasa/cli/project_templates/basic/data/general/help.yml +6 -0
  60. rasa/cli/project_templates/basic/data/general/human_handoff.yml +16 -0
  61. rasa/cli/project_templates/basic/data/general/show_faqs.yml +6 -0
  62. rasa/cli/project_templates/basic/data/system/patterns/pattern_cannot_handle.yml +7 -0
  63. rasa/cli/project_templates/basic/data/system/patterns/pattern_completed.yml +7 -0
  64. rasa/cli/project_templates/basic/data/system/patterns/pattern_correction.yml +7 -0
  65. rasa/cli/project_templates/basic/data/system/patterns/pattern_search.yml +8 -0
  66. rasa/cli/project_templates/basic/data/system/patterns/pattern_session_start.yml +8 -0
  67. rasa/cli/project_templates/basic/docs/docs.md +5 -0
  68. rasa/cli/project_templates/basic/docs/template.txt +28 -0
  69. rasa/cli/project_templates/basic/domain/domain.md +11 -0
  70. rasa/cli/project_templates/basic/domain/general/feedback.yml +25 -0
  71. rasa/cli/project_templates/basic/domain/general/goodbye.yml +9 -0
  72. rasa/cli/project_templates/basic/domain/general/hello.yml +7 -0
  73. rasa/cli/project_templates/basic/domain/general/help.yml +21 -0
  74. rasa/cli/project_templates/basic/domain/general/human_handoff.yml +32 -0
  75. rasa/cli/project_templates/basic/domain/general/show_faqs.yml +14 -0
  76. rasa/cli/project_templates/basic/domain/system/patterns/pattern_cannot_handle.yml +5 -0
  77. rasa/cli/project_templates/basic/domain/system/patterns/pattern_session_start.yml +19 -0
  78. rasa/cli/project_templates/basic/endpoints.yml +67 -0
  79. rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
  80. rasa/cli/project_templates/default/config.yml +4 -0
  81. rasa/cli/project_templates/default/endpoints.yml +4 -0
  82. rasa/cli/project_templates/finance/README.md +26 -0
  83. rasa/cli/project_templates/finance/actions/__init__.py +0 -0
  84. rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
  85. rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
  86. rasa/cli/project_templates/finance/actions/actions.md +15 -0
  87. rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
  88. rasa/cli/project_templates/finance/actions/cards/check_that_card_exists.py +21 -0
  89. rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
  90. rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
  91. rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
  92. rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
  93. rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
  94. rasa/cli/project_templates/finance/actions/db.py +117 -0
  95. rasa/cli/project_templates/finance/actions/general/__init__.py +0 -0
  96. rasa/cli/project_templates/finance/actions/general/action_human_handoff.py +49 -0
  97. rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
  98. rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
  99. rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
  100. rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
  101. rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
  102. rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
  103. rasa/cli/project_templates/finance/config.yml +29 -0
  104. rasa/cli/project_templates/finance/credentials.yml +33 -0
  105. rasa/cli/project_templates/finance/data/accounts/check_balance.yml +9 -0
  106. rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
  107. rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
  108. rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
  109. rasa/cli/project_templates/finance/data/cards/block_card.yml +45 -0
  110. rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
  111. rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
  112. rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
  113. rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
  114. rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
  115. rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
  116. rasa/cli/project_templates/finance/data/data.md +14 -0
  117. rasa/cli/project_templates/finance/data/general/bot_challenge.yml +6 -0
  118. rasa/cli/project_templates/finance/data/general/feedback.yml +20 -0
  119. rasa/cli/project_templates/finance/data/general/goodbye.yml +6 -0
  120. rasa/cli/project_templates/finance/data/general/hello.yml +6 -0
  121. rasa/cli/project_templates/finance/data/general/help.yml +9 -0
  122. rasa/cli/project_templates/finance/data/general/human_handoff.yml +16 -0
  123. rasa/cli/project_templates/finance/data/general/welcome.yml +9 -0
  124. rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +7 -0
  125. rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +7 -0
  126. rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +8 -0
  127. rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +8 -0
  128. rasa/cli/project_templates/finance/data/transfers/check_transfer_limit.yml +18 -0
  129. rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
  130. rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
  131. rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +34 -0
  132. rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
  133. rasa/cli/project_templates/finance/db/cards.json +18 -0
  134. rasa/cli/project_templates/finance/db/contacts.json +10 -0
  135. rasa/cli/project_templates/finance/db/my_account.json +6 -0
  136. rasa/cli/project_templates/finance/db/transactions.json +22 -0
  137. rasa/cli/project_templates/finance/docs/docs.md +8 -0
  138. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
  139. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
  140. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
  141. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
  142. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
  143. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
  144. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
  145. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
  146. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
  147. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
  148. rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +15 -0
  149. rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
  150. rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
  151. rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
  152. rasa/cli/project_templates/finance/domain/cards/block_card.yml +44 -0
  153. rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
  154. rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
  155. rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
  156. rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
  157. rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
  158. rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
  159. rasa/cli/project_templates/finance/domain/domain.md +18 -0
  160. rasa/cli/project_templates/finance/domain/general/_shared.yml +39 -0
  161. rasa/cli/project_templates/finance/domain/general/bot_challenge.yml +4 -0
  162. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +8 -0
  163. rasa/cli/project_templates/finance/domain/general/feedback.yml +25 -0
  164. rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
  165. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +31 -0
  166. rasa/cli/project_templates/finance/domain/general/welcome.yml +39 -0
  167. rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
  168. rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
  169. rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
  170. rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +221 -0
  171. rasa/cli/project_templates/finance/endpoints.yml +67 -0
  172. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
  173. rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/check_balance.yml +9 -0
  174. rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/download_statements.yml +43 -0
  175. rasa/cli/project_templates/finance/tests/e2e_test_cases/cards/block_card.yml +55 -0
  176. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
  177. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/feedback.yml +46 -0
  178. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/goodbye.yml +9 -0
  179. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/hello.yml +8 -0
  180. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/human_handoff.yml +35 -0
  181. rasa/cli/project_templates/finance/tests/e2e_test_cases/general/patterns.yml +22 -0
  182. rasa/cli/project_templates/finance/tests/e2e_test_cases/transfers/transfer_money.yml +56 -0
  183. rasa/cli/project_templates/telco/README.md +25 -0
  184. rasa/cli/project_templates/telco/actions/__init__.py +0 -0
  185. rasa/cli/project_templates/telco/actions/actions.md +12 -0
  186. rasa/cli/project_templates/telco/actions/billing/__init__.py +0 -0
  187. rasa/cli/project_templates/telco/actions/billing/actions_billing.py +204 -0
  188. rasa/cli/project_templates/telco/actions/general/__init__.py +0 -0
  189. rasa/cli/project_templates/telco/actions/general/action_human_handoff.py +49 -0
  190. rasa/cli/project_templates/telco/actions/network/__init__.py +0 -0
  191. rasa/cli/project_templates/telco/actions/network/actions_get_data_from_db.py +48 -0
  192. rasa/cli/project_templates/telco/actions/network/actions_run_diagnostics.py +28 -0
  193. rasa/cli/project_templates/telco/actions/network/actions_session_start.py +18 -0
  194. rasa/cli/project_templates/telco/config.yml +29 -0
  195. rasa/cli/project_templates/telco/credentials.yml +33 -0
  196. rasa/cli/project_templates/telco/csvs/billing.csv +19 -0
  197. rasa/cli/project_templates/telco/csvs/customers.csv +5 -0
  198. rasa/cli/project_templates/telco/data/billing/flow_understand_bill.yml +45 -0
  199. rasa/cli/project_templates/telco/data/data.md +11 -0
  200. rasa/cli/project_templates/telco/data/general/bot_challenge.yml +6 -0
  201. rasa/cli/project_templates/telco/data/general/feedback.yml +20 -0
  202. rasa/cli/project_templates/telco/data/general/goodbye.yml +6 -0
  203. rasa/cli/project_templates/telco/data/general/hello.yml +6 -0
  204. rasa/cli/project_templates/telco/data/general/human_handoff.yml +16 -0
  205. rasa/cli/project_templates/telco/data/general/patterns.yml +30 -0
  206. rasa/cli/project_templates/telco/data/network/flow_reboot_router.yml +8 -0
  207. rasa/cli/project_templates/telco/data/network/flow_reset_router.yml +7 -0
  208. rasa/cli/project_templates/telco/data/network/flow_solve_internet_issue.yml +73 -0
  209. rasa/cli/project_templates/telco/docs/docs.md +8 -0
  210. rasa/cli/project_templates/telco/docs/network/reset_vs_rboot_router.txt +1 -0
  211. rasa/cli/project_templates/telco/docs/network/restart_router.txt +6 -0
  212. rasa/cli/project_templates/telco/docs/network/run_speed_test.txt +6 -0
  213. rasa/cli/project_templates/telco/domain/billing/understand_bill.yml +102 -0
  214. rasa/cli/project_templates/telco/domain/domain.md +13 -0
  215. rasa/cli/project_templates/telco/domain/general/bot_challenge.yml +4 -0
  216. rasa/cli/project_templates/telco/domain/general/feedback.yml +25 -0
  217. rasa/cli/project_templates/telco/domain/general/goodbye.yml +7 -0
  218. rasa/cli/project_templates/telco/domain/general/hello.yml +5 -0
  219. rasa/cli/project_templates/telco/domain/general/human_handoff.yml +26 -0
  220. rasa/cli/project_templates/telco/domain/general/patterns.yml +33 -0
  221. rasa/cli/project_templates/telco/domain/network/reboot_router.yml +21 -0
  222. rasa/cli/project_templates/telco/domain/network/reset_router.yml +12 -0
  223. rasa/cli/project_templates/telco/domain/network/run_speed_test.yml +25 -0
  224. rasa/cli/project_templates/telco/domain/network/solve_internet_issue.yml +75 -0
  225. rasa/cli/project_templates/telco/domain/shared.yml +129 -0
  226. rasa/cli/project_templates/telco/endpoints.yml +67 -0
  227. rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +40 -0
  228. rasa/cli/project_templates/telco/tests/e2e_test_cases/billing/understand_bill.yml +67 -0
  229. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
  230. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +46 -0
  231. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/goodbye.yml +9 -0
  232. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +8 -0
  233. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +35 -0
  234. rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +23 -0
  235. rasa/cli/project_templates/telco/tests/e2e_test_cases/network/solve_internet_issue.yml +57 -0
  236. rasa/cli/project_templates/tutorial/config.yml +2 -1
  237. rasa/cli/scaffold.py +46 -2
  238. rasa/core/actions/action.py +0 -1
  239. rasa/core/actions/action_run_slot_rejections.py +1 -1
  240. rasa/core/actions/direct_custom_actions_executor.py +9 -2
  241. rasa/core/brokers/broker.py +1 -1
  242. rasa/core/brokers/kafka.py +52 -8
  243. rasa/core/channels/development_inspector.py +1 -21
  244. rasa/core/channels/hangouts.py +2 -2
  245. rasa/core/channels/inspector/dist/assets/{arc-1ddec37b.js → arc-35222594.js} +1 -1
  246. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-18af387c.js → blockDiagram-38ab4fdb-a0efbfd3.js} +1 -1
  247. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-250127a3.js → c4Diagram-3d4e48cf-0584c0f2.js} +1 -1
  248. rasa/core/channels/inspector/dist/assets/channel-8e08bed9.js +1 -0
  249. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-c3388b34.js → classDiagram-70f12bd4-39f40dbe.js} +1 -1
  250. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-9c893a82.js → classDiagram-v2-f2320105-1ad755f3.js} +1 -1
  251. rasa/core/channels/inspector/dist/assets/clone-78c82dea.js +1 -0
  252. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-c111213b.js → createText-2e5e7dd3-b0f4f0fe.js} +1 -1
  253. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-812a729d.js → edges-e0da2a9e-9039bff9.js} +1 -1
  254. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-fd5051bc.js → erDiagram-9861fffd-65c9b127.js} +1 -1
  255. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-3287ac02.js → flowDb-956e92f1-4f08b38e.js} +1 -1
  256. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-692fb0b2.js → flowDiagram-66a62f08-e95c362a.js} +1 -1
  257. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b08f601.js +1 -0
  258. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-008376f1.js → flowchart-elk-definition-4a651766-703c3015.js} +1 -1
  259. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-df330a69.js → ganttDiagram-c361ad54-699328ea.js} +1 -1
  260. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-e03676fb.js → gitGraphDiagram-72cf32ee-04cf4b05.js} +1 -1
  261. rasa/core/channels/inspector/dist/assets/{graph-46fad2ba.js → graph-ee94449e.js} +1 -1
  262. rasa/core/channels/inspector/dist/assets/{index-3862675e-a484ac55.js → index-3862675e-940162b4.js} +1 -1
  263. rasa/core/channels/inspector/dist/assets/{index-a003633f.js → index-c941dcb3.js} +239 -238
  264. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-3f9e6ec2.js → infoDiagram-f8f76790-c79c2866.js} +1 -1
  265. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-79f72383.js → journeyDiagram-49397b02-84489d30.js} +1 -1
  266. rasa/core/channels/inspector/dist/assets/{layout-aad098e5.js → layout-a9aa9858.js} +1 -1
  267. rasa/core/channels/inspector/dist/assets/{line-219ab7ae.js → line-eb73cf26.js} +1 -1
  268. rasa/core/channels/inspector/dist/assets/{linear-2cddbe62.js → linear-b3399f9a.js} +1 -1
  269. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-1d41ed99.js → mindmap-definition-fc14e90a-b095bf1a.js} +1 -1
  270. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-cc496ee8.js → pieDiagram-8a3498a8-07644b66.js} +1 -1
  271. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-84d32884.js → quadrantDiagram-120e2f19-573a3f9c.js} +1 -1
  272. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-c0deb984.js → requirementDiagram-deff3bca-d457e1e1.js} +1 -1
  273. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-b9d7fd62.js → sankeyDiagram-04a897e0-9d26e1a2.js} +1 -1
  274. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-7d517565.js → sequenceDiagram-704730f1-3a9cde10.js} +1 -1
  275. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-98ef9b27.js → stateDiagram-587899a1-4f3e8cec.js} +1 -1
  276. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-cee70748.js → stateDiagram-v2-d93cdb3a-e617e5bf.js} +1 -1
  277. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-3f9d1c96.js → styles-6aaf32cf-eab30d2f.js} +1 -1
  278. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-67471923.js → styles-9a916d00-09994be2.js} +1 -1
  279. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-bd093fb7.js → styles-c10674c1-b7110364.js} +1 -1
  280. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-675794e8.js → svgDrawCommon-08f97a94-3ebc92ad.js} +1 -1
  281. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-0ac67617.js → timeline-definition-85554ec2-7d13d2f2.js} +1 -1
  282. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-c018dc37.js → xychartDiagram-e933f94c-488385e1.js} +1 -1
  283. rasa/core/channels/inspector/dist/index.html +2 -2
  284. rasa/core/channels/inspector/index.html +1 -1
  285. rasa/core/channels/inspector/src/App.tsx +15 -42
  286. rasa/core/channels/inspector/src/components/Chat.tsx +2 -3
  287. rasa/core/channels/inspector/src/components/DialogueInformation.tsx +20 -3
  288. rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +63 -35
  289. rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +14 -0
  290. rasa/core/channels/inspector/src/types.ts +32 -7
  291. rasa/core/channels/studio_chat.py +43 -43
  292. rasa/core/channels/voice_stream/asr/asr_event.py +1 -1
  293. rasa/core/channels/voice_stream/asr/azure.py +6 -3
  294. rasa/core/channels/voice_stream/asr/deepgram.py +1 -1
  295. rasa/core/channels/voice_stream/audiocodes.py +3 -0
  296. rasa/core/channels/voice_stream/browser_audio.py +55 -3
  297. rasa/core/channels/voice_stream/genesys.py +2 -1
  298. rasa/core/channels/voice_stream/jambonz.py +9 -1
  299. rasa/core/channels/voice_stream/twilio_media_streams.py +16 -0
  300. rasa/core/channels/voice_stream/voice_channel.py +61 -0
  301. rasa/core/concurrent_lock_store.py +66 -16
  302. rasa/core/constants.py +7 -0
  303. rasa/core/iam_credentials_providers/__init__.py +0 -0
  304. rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +226 -0
  305. rasa/core/iam_credentials_providers/credentials_provider_protocol.py +90 -0
  306. rasa/core/lock_store.py +46 -10
  307. rasa/core/nlg/generator.py +1 -1
  308. rasa/core/policies/enterprise_search_policy.py +4 -7
  309. rasa/core/policies/flows/flow_executor.py +9 -2
  310. rasa/core/processor.py +32 -0
  311. rasa/core/redis_connection_factory.py +469 -0
  312. rasa/core/tracker_stores/redis_tracker_store.py +32 -14
  313. rasa/core/tracker_stores/sql_tracker_store.py +57 -1
  314. rasa/dialogue_understanding/generator/flow_retrieval.py +10 -9
  315. rasa/engine/graph.py +5 -1
  316. rasa/engine/loader.py +12 -0
  317. rasa/engine/storage/local_model_storage.py +83 -3
  318. rasa/model_manager/model_api.py +1 -2
  319. rasa/model_manager/runner_service.py +1 -1
  320. rasa/model_manager/socket_bridge.py +1 -2
  321. rasa/model_manager/trainer_service.py +12 -9
  322. rasa/model_manager/utils.py +1 -29
  323. rasa/model_manager/warm_rasa_process.py +13 -3
  324. rasa/shared/core/constants.py +1 -0
  325. rasa/shared/core/domain.py +62 -15
  326. rasa/shared/core/events.py +2 -0
  327. rasa/shared/core/flows/flow.py +1 -1
  328. rasa/shared/core/flows/flow_step.py +7 -1
  329. rasa/shared/core/flows/steps/call.py +8 -1
  330. rasa/shared/core/flows/yaml_flows_io.py +16 -8
  331. rasa/shared/core/slots.py +4 -0
  332. rasa/shared/importers/importer.py +6 -0
  333. rasa/shared/importers/utils.py +77 -1
  334. rasa/shared/nlu/training_data/schemas/responses.yml +3 -0
  335. rasa/studio/upload.py +12 -46
  336. rasa/telemetry.py +97 -23
  337. rasa/utils/io.py +27 -9
  338. rasa/utils/json_utils.py +6 -1
  339. rasa/utils/log_utils.py +5 -1
  340. rasa/utils/openapi.py +144 -0
  341. rasa/utils/pypred.py +38 -0
  342. rasa/validator.py +19 -11
  343. rasa/version.py +1 -1
  344. {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/METADATA +27 -25
  345. {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/RECORD +348 -109
  346. rasa/core/channels/inspector/dist/assets/channel-59f6d54b.js +0 -1
  347. rasa/core/channels/inspector/dist/assets/clone-26177ddb.js +0 -1
  348. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-29c03f5a.js +0 -1
  349. {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/NOTICE +0 -0
  350. {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/WHEEL +0 -0
  351. {rasa_pro-3.14.0.dev20250825.dist-info → rasa_pro-3.14.0.dev20250922.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,226 @@
1
+ import os
2
+ import threading
3
+ import time
4
+ from typing import Optional, Tuple
5
+ from urllib.parse import ParseResult, urlencode, urlunparse
6
+
7
+ import boto3
8
+ import redis
9
+ import structlog
10
+ from aws_msk_iam_sasl_signer import MSKAuthTokenProvider
11
+ from botocore.exceptions import BotoCoreError
12
+ from botocore.model import ServiceId
13
+ from botocore.session import get_session
14
+ from botocore.signers import RequestSigner
15
+ from cachetools import TTLCache, cached
16
+
17
+ from rasa.core.iam_credentials_providers.credentials_provider_protocol import (
18
+ IAMCredentialsProvider,
19
+ IAMCredentialsProviderInput,
20
+ SupportedServiceType,
21
+ TemporaryCredentials,
22
+ )
23
+ from rasa.shared.exceptions import ConnectionException
24
+
25
+ structlogger = structlog.get_logger(__name__)
26
+
27
+
28
+ class AWSRDSIAMCredentialsProvider(IAMCredentialsProvider):
29
+ """Generates temporary credentials for AWS RDS using IAM roles."""
30
+
31
+ def __init__(self, username: str, host: str, port: int) -> None:
32
+ """Initializes the provider."""
33
+ self.username = username
34
+ self.host = host
35
+ self.port = port
36
+
37
+ def get_temporary_credentials(self) -> TemporaryCredentials:
38
+ """Generates temporary credentials for AWS RDS."""
39
+ structlogger.debug(
40
+ "rasa.core.aws_rds_iam_credentials_provider.get_credentials",
41
+ event_info="IAM authentication for AWS RDS enabled. "
42
+ "Generating temporary auth token...",
43
+ )
44
+
45
+ try:
46
+ client = boto3.client("rds")
47
+ auth_token = client.generate_db_auth_token(
48
+ DBHostname=self.host,
49
+ Port=self.port,
50
+ DBUsername=self.username,
51
+ )
52
+ structlogger.info(
53
+ "rasa.core.aws_rds_iam_credentials_provider.generated_credentials",
54
+ event_info="Successfully generated temporary auth token for AWS RDS.",
55
+ )
56
+ return TemporaryCredentials(auth_token=auth_token)
57
+ except (BotoCoreError, ValueError) as exc:
58
+ structlogger.error(
59
+ "rasa.core.aws_rds_iam_credentials_provider.error_generating_credentials",
60
+ event_info="Failed to generate temporary auth token for AWS RDS.",
61
+ error=str(exc),
62
+ )
63
+ return TemporaryCredentials(auth_token=None)
64
+
65
+
66
+ class AWSMSKafkaIAMCredentialsProvider(IAMCredentialsProvider):
67
+ """Generates temporary credentials for AWS MSK using IAM roles."""
68
+
69
+ def __init__(self) -> None:
70
+ self.region = os.getenv("AWS_DEFAULT_REGION", os.getenv("AWS_REGION"))
71
+ self._token: Optional[str] = None
72
+ self._expires_at: float = 0
73
+ self.refresh_margin_seconds = 60 # Refresh 60 seconds before expiry
74
+ # ensure thread safety when refreshing token because the
75
+ # kafka client library we use (confluent-kafka) is multithreaded
76
+ self.lock = threading.Lock()
77
+
78
+ @property
79
+ def token(self) -> Optional[str]:
80
+ return self._token
81
+
82
+ @token.setter
83
+ def token(self, value: str) -> None:
84
+ self._token = value
85
+
86
+ @property
87
+ def expires_at(self) -> float:
88
+ return self._expires_at
89
+
90
+ @expires_at.setter
91
+ def expires_at(self, value: float) -> None:
92
+ self._expires_at = value
93
+
94
+ def get_temporary_credentials(self) -> TemporaryCredentials:
95
+ """Generates temporary credentials for AWS MSK."""
96
+ with self.lock:
97
+ current_time = time.time() # Current time in seconds
98
+ if (
99
+ not self.token
100
+ or current_time >= self.expires_at - self.refresh_margin_seconds
101
+ ):
102
+ try:
103
+ auth_token, expiry_ms = MSKAuthTokenProvider.generate_auth_token(
104
+ self.region
105
+ )
106
+ structlogger.debug(
107
+ "rasa.core.aws_msk_iam_credentials_provider.get_credentials",
108
+ event_info="Successfully generated AWS IAM token for "
109
+ "Kafka authentication.",
110
+ )
111
+ self.token = auth_token
112
+ self.expires_at = int(expiry_ms) / 1000 # Convert ms to seconds
113
+ return TemporaryCredentials(
114
+ auth_token=auth_token,
115
+ expiration=self.expires_at,
116
+ )
117
+ except Exception as exc:
118
+ raise ConnectionException(
119
+ f"Failed to generate AWS IAM token "
120
+ f"for MSK authentication. Original exception: {exc}"
121
+ ) from exc
122
+ else:
123
+ structlogger.debug(
124
+ "rasa.core.aws_msk_iam_credentials_provider.get_credentials",
125
+ event_info="Using cached AWS IAM token for Kafka authentication.",
126
+ )
127
+ return TemporaryCredentials(
128
+ auth_token=self.token,
129
+ expiration=self.expires_at,
130
+ )
131
+
132
+
133
+ class AWSElasticacheRedisIAMCredentialsProvider(redis.CredentialProvider):
134
+ """Generates temporary credentials for AWS ElastiCache Redis using IAM roles."""
135
+
136
+ def __init__(self, username: str, cluster_name: Optional[str] = None) -> None:
137
+ """Initializes the provider."""
138
+ self.username = username
139
+ self.cluster_name = cluster_name
140
+ self.region = os.getenv("AWS_DEFAULT_REGION", os.getenv("AWS_REGION"))
141
+ self.session = get_session()
142
+ self.request_signer = RequestSigner(
143
+ ServiceId("elasticache"),
144
+ self.region,
145
+ "elasticache",
146
+ "v4",
147
+ self.session.get_credentials(),
148
+ self.session.get_component("event_emitter"),
149
+ )
150
+
151
+ # Generated IAM tokens are valid for 15 minutes
152
+ @cached(cache=TTLCache(maxsize=128, ttl=900))
153
+ def get_credentials(self) -> Tuple[str, str]:
154
+ """Generates temporary credentials for AWS ElastiCache Redis.
155
+
156
+ Required method implementation by redis-py CredentialProvider parent class.
157
+ Used internally by redis-py when connecting to Redis.
158
+ """
159
+ query_params = {"Action": "connect", "User": self.username}
160
+ url = urlunparse(
161
+ ParseResult(
162
+ scheme="https",
163
+ netloc=self.cluster_name,
164
+ path="/",
165
+ query=urlencode(query_params),
166
+ params="",
167
+ fragment="",
168
+ )
169
+ )
170
+ signed_url = self.request_signer.generate_presigned_url(
171
+ {"method": "GET", "url": url, "body": {}, "headers": {}, "context": {}},
172
+ operation_name="connect",
173
+ expires_in=900,
174
+ region_name=self.region,
175
+ )
176
+
177
+ # RequestSigner only seems to work if the URL has a protocol, but
178
+ # Elasticache only accepts the URL without a protocol
179
+ # So strip it off the signed URL before returning
180
+ return self.username, signed_url.removeprefix("https://")
181
+
182
+ def get_temporary_credentials(self) -> TemporaryCredentials:
183
+ """Generates temporary credentials for AWS ElastiCache Redis.
184
+
185
+ Implemented to comply with the IAMCredentialsProvider rasa-pro interface.
186
+ Calls the get_credentials method which is used internally by redis-py.
187
+ """
188
+ try:
189
+ username, signed_url = self.get_credentials()
190
+ structlogger.info(
191
+ "rasa.core.aws_elasticache_redis_iam_credentials_provider.generated_credentials",
192
+ event_info="Successfully generated temporary credentials for "
193
+ "AWS ElastiCache Redis.",
194
+ )
195
+ return TemporaryCredentials(username=username, presigned_url=signed_url)
196
+ except Exception as exc:
197
+ structlogger.error(
198
+ "rasa.core.aws_elasticache_redis_iam_credentials_provider.error_generating_credentials",
199
+ event_info="Failed to generate temporary credentials for "
200
+ "AWS ElastiCache Redis.",
201
+ error=str(exc),
202
+ )
203
+ return TemporaryCredentials()
204
+
205
+
206
+ def create_aws_iam_credentials_provider(
207
+ provider_input: "IAMCredentialsProviderInput",
208
+ ) -> Optional["IAMCredentialsProvider"]:
209
+ """Factory function to create an AWS IAM credentials provider."""
210
+ if provider_input.service_name == SupportedServiceType.TRACKER_STORE:
211
+ return AWSRDSIAMCredentialsProvider(
212
+ username=provider_input.username,
213
+ host=provider_input.host,
214
+ port=provider_input.port,
215
+ )
216
+
217
+ if provider_input.service_name == SupportedServiceType.EVENT_BROKER:
218
+ return AWSMSKafkaIAMCredentialsProvider()
219
+
220
+ if provider_input.service_name == SupportedServiceType.LOCK_STORE:
221
+ return AWSElasticacheRedisIAMCredentialsProvider(
222
+ username=provider_input.username,
223
+ cluster_name=provider_input.cluster_name,
224
+ )
225
+
226
+ return None
@@ -0,0 +1,90 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ from enum import Enum
5
+ from typing import Optional, Protocol, runtime_checkable
6
+
7
+ import structlog
8
+ from pydantic import BaseModel
9
+
10
+ from rasa.core.constants import IAM_CLOUD_PROVIDER_ENV_VAR_NAME
11
+
12
+ structlogger = structlog.get_logger(__name__)
13
+
14
+
15
+ class TemporaryCredentials(BaseModel):
16
+ """Dataclass storing temporary credentials."""
17
+
18
+ auth_token: Optional[str] = None
19
+ expiration: Optional[float] = None
20
+ username: Optional[str] = None
21
+ presigned_url: Optional[str] = None
22
+
23
+
24
+ @runtime_checkable
25
+ class IAMCredentialsProvider(Protocol):
26
+ """Interface for generating temporary credentials using IAM roles."""
27
+
28
+ def get_temporary_credentials(self) -> TemporaryCredentials:
29
+ """Generates temporary credentials using IAM roles."""
30
+ ...
31
+
32
+
33
+ class IAMCredentialsProviderType(Enum):
34
+ """Enum for supported IAM credentials provider types."""
35
+
36
+ AWS = "aws"
37
+
38
+
39
+ class SupportedServiceType(Enum):
40
+ """Enum for supported services using IAM credentials providers."""
41
+
42
+ TRACKER_STORE = "tracker_store"
43
+ EVENT_BROKER = "event_broker"
44
+ LOCK_STORE = "lock_store"
45
+
46
+
47
+ class IAMCredentialsProviderInput(BaseModel):
48
+ """Input data for creating an IAM credentials provider."""
49
+
50
+ service_name: SupportedServiceType
51
+ username: Optional[str] = None
52
+ host: Optional[str] = None
53
+ port: Optional[int] = None
54
+ cluster_name: Optional[str] = None
55
+
56
+
57
+ def create_iam_credentials_provider(
58
+ provider_input: IAMCredentialsProviderInput,
59
+ ) -> Optional[IAMCredentialsProvider]:
60
+ """Factory function to create an IAM credentials provider.
61
+
62
+ Args:
63
+ provider_input: Input data for creating an IAM credentials provider.
64
+
65
+ Returns:
66
+ An instance of the specified IAM credentials provider or
67
+ None if the type is unsupported.
68
+ """
69
+ iam_cloud_provider = os.getenv(IAM_CLOUD_PROVIDER_ENV_VAR_NAME)
70
+
71
+ if iam_cloud_provider is None:
72
+ return None
73
+
74
+ try:
75
+ provider_type = IAMCredentialsProviderType(iam_cloud_provider.lower())
76
+ except ValueError:
77
+ structlogger.warning(
78
+ "rasa.core.iam_credentials_provider.create_iam_credentials_provider.unsupported_provider",
79
+ event_info=f"Unsupported IAM cloud provider: {iam_cloud_provider}",
80
+ )
81
+ return None
82
+
83
+ if provider_type == IAMCredentialsProviderType.AWS:
84
+ from rasa.core.iam_credentials_providers.aws_iam_credentials_providers import (
85
+ create_aws_iam_credentials_provider,
86
+ )
87
+
88
+ return create_aws_iam_credentials_provider(provider_input)
89
+
90
+ return None
rasa/core/lock_store.py CHANGED
@@ -4,7 +4,7 @@ import asyncio
4
4
  import json
5
5
  import os
6
6
  from contextlib import asynccontextmanager
7
- from typing import Any, AsyncGenerator, Dict, Literal, Optional, Text, Union
7
+ from typing import Any, AsyncGenerator, Dict, List, Literal, Optional, Text, Union
8
8
 
9
9
  import structlog
10
10
  from pydantic import (
@@ -12,12 +12,18 @@ from pydantic import (
12
12
  BaseModel,
13
13
  Field,
14
14
  NonNegativeInt,
15
+ ValidationError,
15
16
  model_validator,
16
17
  )
17
18
 
18
19
  import rasa.shared.utils.common
19
- from rasa.core.constants import DEFAULT_LOCK_LIFETIME
20
+ from rasa.core.constants import DEFAULT_LOCK_LIFETIME, IAM_CLOUD_PROVIDER_ENV_VAR_NAME
20
21
  from rasa.core.lock import TicketLock
22
+ from rasa.core.redis_connection_factory import (
23
+ DeploymentMode,
24
+ RedisConfig,
25
+ RedisConnectionFactory,
26
+ )
21
27
  from rasa.shared.exceptions import ConnectionException, RasaException
22
28
  from rasa.shared.utils.io import raise_deprecation_warning
23
29
  from rasa.utils.endpoints import EndpointConfig
@@ -221,7 +227,7 @@ class LockStore:
221
227
 
222
228
 
223
229
  class RedisLockStoreConfig(BaseModel):
224
- host: Union[AnyUrl, Literal["localhost"]] = Field(
230
+ host: Union[AnyUrl, Literal["localhost"], str] = Field(
225
231
  default="localhost", description="The host of the redis server."
226
232
  )
227
233
  port: NonNegativeInt = Field(
@@ -269,6 +275,18 @@ class RedisLockStoreConfig(BaseModel):
269
275
  "will be raised in case Redis doesn't respond "
270
276
  "within `socket_timeout` seconds.",
271
277
  )
278
+ deployment_mode: DeploymentMode = Field(
279
+ default=DeploymentMode.STANDARD,
280
+ description="Redis deployment mode: 'standard', 'cluster', or 'sentinel'",
281
+ )
282
+ endpoints: Optional[List[str]] = Field(
283
+ default=None,
284
+ description="List of endpoints for cluster/sentinel mode in 'host:port' format",
285
+ )
286
+ sentinel_service: Optional[str] = Field(
287
+ default=None,
288
+ description="Sentinel service name",
289
+ )
272
290
 
273
291
  @model_validator(mode="before")
274
292
  @classmethod
@@ -290,7 +308,9 @@ class RedisLockStoreConfig(BaseModel):
290
308
 
291
309
  @model_validator(mode="after")
292
310
  def verify_username_password(self) -> RedisLockStoreConfig:
293
- if bool(self.username) ^ bool(self.password):
311
+ if os.getenv(IAM_CLOUD_PROVIDER_ENV_VAR_NAME) is None and (
312
+ bool(self.username) ^ bool(self.password)
313
+ ):
294
314
  raise ValueError(
295
315
  f"Expected username and password. "
296
316
  f"Found: username: {'<has value>' if self.username else '<N/A>'}, "
@@ -298,9 +318,6 @@ class RedisLockStoreConfig(BaseModel):
298
318
  )
299
319
  return self
300
320
 
301
- def to_strict_redis(self) -> Dict[str, Any]:
302
- return self.model_dump(by_alias=True, exclude={"key_prefix"})
303
-
304
321
 
305
322
  class RedisLockStore(LockStore):
306
323
  """Redis store for ticket locks."""
@@ -314,10 +331,26 @@ class RedisLockStore(LockStore):
314
331
  Args:
315
332
  config: Redis lock store configuration.
316
333
  """
317
- import redis
318
-
319
334
  self.config = config
320
- self.red = redis.StrictRedis(**self.config.to_strict_redis())
335
+ try:
336
+ redis_config = RedisConfig(
337
+ host=str(self.config.host),
338
+ port=self.config.port,
339
+ db=self.config.db,
340
+ username=self.config.username,
341
+ password=self.config.password,
342
+ use_ssl=self.config.use_ssl,
343
+ ssl_keyfile=self.config.ssl_keyfile,
344
+ ssl_certfile=self.config.ssl_certfile,
345
+ ssl_ca_certs=self.config.ssl_ca_certs,
346
+ deployment_mode=self.config.deployment_mode.value,
347
+ endpoints=self.config.endpoints,
348
+ sentinel_service=self.config.sentinel_service,
349
+ socket_timeout=self.config.socket_timeout,
350
+ )
351
+ self.red = RedisConnectionFactory.create_connection(redis_config)
352
+ except ValidationError as e:
353
+ raise RasaException(f"Invalid Redis configuration: {e}")
321
354
 
322
355
  self.key_prefix = DEFAULT_REDIS_LOCK_STORE_KEY_PREFIX
323
356
  if self.config.key_prefix:
@@ -349,6 +382,9 @@ class RedisLockStore(LockStore):
349
382
  """Retrieves lock (see parent docstring for more information)."""
350
383
  serialised_lock = self.red.get(self.key_prefix + conversation_id)
351
384
  if serialised_lock:
385
+ # Handle bytes to string conversion for JSON parsing
386
+ if isinstance(serialised_lock, bytes):
387
+ serialised_lock = serialised_lock.decode("utf-8")
352
388
  return TicketLock.from_dict(json.loads(serialised_lock))
353
389
 
354
390
  return None
@@ -2,7 +2,6 @@ from typing import Any, Dict, List, Optional, Text, Union
2
2
 
3
3
  import structlog
4
4
  from jinja2 import Template
5
- from pypred import Predicate
6
5
 
7
6
  import rasa.shared.utils.common
8
7
  import rasa.shared.utils.io
@@ -12,6 +11,7 @@ from rasa.shared.constants import CHANNEL, RESPONSE_CONDITION
12
11
  from rasa.shared.core.domain import Domain
13
12
  from rasa.shared.core.trackers import DialogueStateTracker
14
13
  from rasa.utils.endpoints import EndpointConfig
14
+ from rasa.utils.pypred import Predicate
15
15
 
16
16
  structlogger = structlog.get_logger()
17
17
 
@@ -781,7 +781,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
781
781
  if not os.path.exists(docs_folder) or not os.path.isdir(docs_folder):
782
782
  error_message = (
783
783
  f"Document source directory does not exist or is not a "
784
- f"directory: '{docs_folder}'. "
784
+ f"directory: '{os.path.abspath(docs_folder)}'. "
785
785
  "Please specify a valid path to the documents source directory in the "
786
786
  "vector_store configuration."
787
787
  )
@@ -1130,8 +1130,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1130
1130
  embeddings_config: Dict[Text, Any],
1131
1131
  log_source_method: str,
1132
1132
  ) -> None:
1133
- """
1134
- Perform the health checks using resolved LLM and embeddings configurations.
1133
+ """Perform the health checks using resolved LLM and embeddings configurations.
1135
1134
  Resolved means the configuration is either:
1136
1135
  - A reference to a model group that has already been expanded into
1137
1136
  its corresponding configuration using the information from
@@ -1160,8 +1159,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1160
1159
 
1161
1160
  @classmethod
1162
1161
  def get_system_default_prompt_based_on_config(cls, config: Dict[str, Any]) -> str:
1163
- """
1164
- Resolves the default prompt template for Enterprise Search Policy based on
1162
+ """Resolves the default prompt template for Enterprise Search Policy based on
1165
1163
  the component's configuration.
1166
1164
 
1167
1165
  - The old prompt is selected when both citation and relevancy check are either
@@ -1192,8 +1190,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1192
1190
  relevancy_check_enabled: bool,
1193
1191
  citation_enabled: bool,
1194
1192
  ) -> str:
1195
- """
1196
- Returns the appropriate default prompt template based on the feature flags.
1193
+ """Returns the appropriate default prompt template based on the feature flags.
1197
1194
 
1198
1195
  The selection follows this priority:
1199
1196
  1. If relevancy check is enabled, return the prompt that includes both relevancy
@@ -4,7 +4,6 @@ from typing import Any, Dict, List, Optional, Text
4
4
 
5
5
  import structlog
6
6
  from jinja2 import Template
7
- from pypred import Predicate
8
7
  from structlog.contextvars import (
9
8
  bound_contextvars,
10
9
  )
@@ -92,6 +91,7 @@ from rasa.shared.core.slots import Slot, SlotRejection
92
91
  from rasa.shared.core.trackers import (
93
92
  DialogueStateTracker,
94
93
  )
94
+ from rasa.utils.pypred import Predicate
95
95
 
96
96
  structlogger = structlog.get_logger()
97
97
 
@@ -740,7 +740,14 @@ def _run_action_step(
740
740
  # do not log about non-existing validation actions of collect steps
741
741
  utter_action_name = render_template_variables("{{context.utter}}", context)
742
742
  if utter_action_name not in available_actions:
743
- structlogger.warning("flow.step.run.action.unknown", action=action_name)
743
+ structlogger.warning(
744
+ "flow.step.run.action.unknown",
745
+ action=action_name,
746
+ event_info=(
747
+ f"The action '{action_name}' is not defined in the domain but "
748
+ f"getting triggered by the flow '{step.flow_id}'."
749
+ ),
750
+ )
744
751
  return ContinueFlowWithNextStep(events=initial_events)
745
752
 
746
753
 
rasa/core/processor.py CHANGED
@@ -72,6 +72,7 @@ from rasa.shared.core.constants import (
72
72
  ACTION_CORRECT_FLOW_SLOT,
73
73
  ACTION_EXTRACT_SLOTS,
74
74
  ACTION_LISTEN_NAME,
75
+ ACTION_METADATA_EXECUTION_TIME,
75
76
  ACTION_SESSION_START_NAME,
76
77
  FOLLOWUP_ACTION,
77
78
  SESSION_START_METADATA_SLOT,
@@ -207,6 +208,7 @@ class MessageProcessor:
207
208
  ) -> Optional[List[Dict[Text, Any]]]:
208
209
  """Handle a single message with this processor."""
209
210
  # preprocess message if necessary
211
+ self.time_turn_start = time.time()
210
212
  tracker = await self.log_message(message, should_save_tracker=False)
211
213
 
212
214
  if self.model_metadata.training_type == TrainingType.NLU:
@@ -1154,6 +1156,7 @@ class MessageProcessor:
1154
1156
  should_predict_another_action = True
1155
1157
 
1156
1158
  tracker = await self.run_command_processor(tracker)
1159
+ self.time_command_processor = time.time()
1157
1160
 
1158
1161
  # action loop. predicts actions until we hit action listen
1159
1162
  while should_predict_another_action and self._should_handle_message(tracker):
@@ -1403,6 +1406,34 @@ class MessageProcessor:
1403
1406
  plugin_manager().hook.after_action_executed(tracker=tracker)
1404
1407
  return self.should_predict_another_action(action.name())
1405
1408
 
1409
+ def _add_metadata_if_action_listen(
1410
+ self, action: Action, prediction: PolicyPrediction
1411
+ ) -> None:
1412
+ """Adds execution times to the ActionExecuted event metadata."""
1413
+ if not hasattr(self, "time_turn_start"):
1414
+ return
1415
+
1416
+ if not hasattr(self, "time_command_processor"):
1417
+ return
1418
+
1419
+ if not action.name() == ACTION_LISTEN_NAME:
1420
+ return
1421
+
1422
+ if prediction.action_metadata is None:
1423
+ prediction.action_metadata = {}
1424
+
1425
+ # calculate execution times
1426
+ execution_time_prediction_loop = (
1427
+ time.time() - self.time_command_processor
1428
+ ) * 1000
1429
+ execution_time_command_processor = (
1430
+ self.time_command_processor - self.time_turn_start
1431
+ ) * 1000
1432
+ prediction.action_metadata[ACTION_METADATA_EXECUTION_TIME] = {
1433
+ "command_processor": execution_time_command_processor,
1434
+ "prediction_loop": execution_time_prediction_loop,
1435
+ }
1436
+
1406
1437
  def _log_action_and_events_on_tracker(
1407
1438
  self,
1408
1439
  tracker: DialogueStateTracker,
@@ -1448,6 +1479,7 @@ class MessageProcessor:
1448
1479
  tracker.update_with_events(prediction.events)
1449
1480
 
1450
1481
  # log the action and its produced events
1482
+ self._add_metadata_if_action_listen(action, prediction)
1451
1483
  tracker.update(
1452
1484
  action.event_for_successful_execution(
1453
1485
  prediction, was_successful, error_message