rasa-pro 3.13.1a19__py3-none-any.whl → 3.13.1a20__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 (275) hide show
  1. rasa/__main__.py +8 -0
  2. rasa/builder/auth.py +71 -0
  3. rasa/builder/config.py +16 -0
  4. rasa/builder/copilot/constants.py +15 -0
  5. rasa/builder/copilot/copilot.py +342 -0
  6. rasa/builder/copilot/copilot_response_handler.py +471 -0
  7. rasa/builder/copilot/exceptions.py +20 -0
  8. rasa/builder/copilot/models.py +344 -0
  9. rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +495 -0
  10. rasa/builder/copilot/telemetry.py +195 -0
  11. rasa/builder/document_retrieval/__init__.py +0 -0
  12. rasa/builder/document_retrieval/constants.py +16 -0
  13. rasa/builder/{inkeep_document_retrieval.py → document_retrieval/inkeep_document_retrieval.py} +24 -30
  14. rasa/builder/document_retrieval/models.py +62 -0
  15. rasa/builder/download.py +140 -0
  16. rasa/builder/guardrails/__init__.py +1 -0
  17. rasa/builder/guardrails/constants.py +4 -0
  18. rasa/builder/guardrails/exceptions.py +4 -0
  19. rasa/builder/guardrails/lakera.py +188 -0
  20. rasa/builder/guardrails/models.py +199 -0
  21. rasa/builder/guardrails/utils.py +305 -0
  22. rasa/builder/job_manager.py +87 -0
  23. rasa/builder/jobs.py +232 -0
  24. rasa/builder/llm_service.py +59 -7
  25. rasa/builder/logging_utils.py +162 -4
  26. rasa/builder/main.py +29 -16
  27. rasa/builder/models.py +90 -233
  28. rasa/builder/project_generator.py +91 -7
  29. rasa/builder/scrape_rasa_docs.py +1 -1
  30. rasa/builder/service.py +632 -440
  31. rasa/builder/shared/tracker_context.py +212 -0
  32. rasa/builder/validation_service.py +4 -4
  33. rasa/cli/data.py +8 -3
  34. rasa/cli/project_templates/basic/actions/action_api.py +15 -0
  35. rasa/cli/project_templates/basic/actions/action_human_handoff.py +44 -0
  36. rasa/cli/project_templates/basic/config.yml +23 -0
  37. rasa/cli/project_templates/{plain → basic}/credentials.yml +8 -7
  38. rasa/cli/project_templates/basic/data/general/feedback.yml +20 -0
  39. rasa/cli/project_templates/basic/data/general/goodbye.yml +6 -0
  40. rasa/cli/project_templates/basic/data/general/hello.yml +7 -0
  41. rasa/cli/project_templates/basic/data/general/help.yml +6 -0
  42. rasa/cli/project_templates/basic/data/general/human_handoff.yml +16 -0
  43. rasa/cli/project_templates/basic/data/general/welcome.yml +9 -0
  44. rasa/cli/project_templates/{finance/data/patterns → basic/data/system}/pattern_completed.yml +2 -1
  45. rasa/cli/project_templates/basic/data/system/pattern_correction.yml +7 -0
  46. rasa/cli/project_templates/basic/data/system/pattern_search.yml +8 -0
  47. rasa/cli/project_templates/basic/data/system/pattern_session_start.yml +8 -0
  48. rasa/cli/project_templates/basic/docs/rasa_assistant_qa.txt +65 -0
  49. rasa/cli/project_templates/basic/docs/template.txt +7 -0
  50. rasa/cli/project_templates/basic/domain/general/assistant_details.yml +12 -0
  51. rasa/cli/project_templates/basic/domain/general/bot_identity.yml +5 -0
  52. rasa/cli/project_templates/basic/domain/general/cannot_handle.yml +5 -0
  53. rasa/cli/project_templates/basic/domain/general/feedback.yml +28 -0
  54. rasa/cli/project_templates/basic/domain/general/goodbye.yml +7 -0
  55. rasa/cli/project_templates/basic/domain/general/help.yml +5 -0
  56. rasa/cli/project_templates/basic/domain/general/human_handoff_domain.yml +35 -0
  57. rasa/cli/project_templates/{finance/domain/default_actions.yml → basic/domain/general/utils.yml} +0 -3
  58. rasa/cli/project_templates/basic/domain/general/welcome.yml +7 -0
  59. rasa/cli/project_templates/{plain → basic}/endpoints.yml +42 -27
  60. rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +19 -0
  61. rasa/cli/project_templates/defaults.py +25 -3
  62. rasa/cli/project_templates/finance/actions/__init__.py +46 -0
  63. rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
  64. rasa/cli/project_templates/finance/actions/{action_ask_account.py → accounts/action_ask_account.py} +6 -9
  65. rasa/cli/project_templates/finance/actions/{action_check_balance.py → accounts/action_check_balance.py} +4 -4
  66. rasa/cli/project_templates/finance/actions/action_session_start.py +11 -6
  67. rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
  68. rasa/cli/project_templates/finance/actions/{action_ask_card.py → cards/action_ask_card.py} +4 -3
  69. rasa/cli/project_templates/finance/actions/{action_check_card_existence.py → cards/action_check_card_existence.py} +4 -3
  70. rasa/cli/project_templates/finance/actions/{action_update_card_status.py → cards/action_update_card_status.py} +18 -9
  71. rasa/cli/project_templates/finance/actions/database.py +1 -0
  72. rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
  73. rasa/cli/project_templates/finance/actions/{action_add_payee.py → transfers/action_add_payee.py} +8 -3
  74. rasa/cli/project_templates/finance/actions/{action_ask_account_from.py → transfers/action_ask_account_from.py} +5 -4
  75. rasa/cli/project_templates/finance/actions/{action_check_payee_existence.py → transfers/action_check_payee_existence.py} +3 -3
  76. rasa/cli/project_templates/finance/actions/{action_check_sufficient_funds.py → transfers/action_check_sufficient_funds.py} +3 -4
  77. rasa/cli/project_templates/finance/actions/{action_list_payees.py → transfers/action_list_payees.py} +4 -3
  78. rasa/cli/project_templates/finance/actions/{action_remove_payee.py → transfers/action_remove_payee.py} +4 -4
  79. rasa/cli/project_templates/finance/config.yml +8 -19
  80. rasa/cli/project_templates/finance/credentials.yml +6 -7
  81. rasa/cli/project_templates/finance/csvs/cards.csv +10 -10
  82. rasa/cli/project_templates/finance/csvs/payees.csv +10 -9
  83. rasa/cli/project_templates/finance/data/{flows → accounts}/check_balance.yml +2 -1
  84. rasa/cli/project_templates/finance/data/general/bot_identity.yml +6 -0
  85. rasa/cli/project_templates/finance/data/general/feedback.yml +20 -0
  86. rasa/cli/project_templates/finance/data/general/goodbye.yml +6 -0
  87. rasa/cli/project_templates/finance/data/general/hello.yml +7 -0
  88. rasa/cli/project_templates/finance/data/{flows/welcome.yml → general/help.yml} +2 -7
  89. rasa/cli/project_templates/finance/data/general/human_handoff.yml +16 -0
  90. rasa/cli/project_templates/finance/data/general/welcome.yml +9 -0
  91. rasa/cli/project_templates/finance/data/{patterns → system/patterns}/pattern_chitchat.yml +0 -2
  92. rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +7 -0
  93. rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +7 -0
  94. rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +8 -0
  95. rasa/cli/project_templates/finance/data/{patterns → system/patterns}/pattern_session_start.yml +0 -1
  96. rasa/cli/project_templates/finance/domain/{check_balance.yml → accounts/check_balance.yml} +2 -0
  97. rasa/cli/project_templates/finance/domain/general/assistant_details.yml +12 -0
  98. rasa/cli/project_templates/finance/domain/general/bot_identity.yml +5 -0
  99. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -0
  100. rasa/cli/project_templates/finance/domain/general/defaults.yml +24 -0
  101. rasa/cli/project_templates/finance/domain/general/feedback.yml +28 -0
  102. rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
  103. rasa/cli/project_templates/finance/domain/general/help.yml +5 -0
  104. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +30 -0
  105. rasa/cli/project_templates/finance/domain/general/utils.yml +13 -0
  106. rasa/cli/project_templates/finance/domain/general/welcome.yml +8 -0
  107. rasa/cli/project_templates/finance/endpoints.yml +1 -0
  108. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +3 -3
  109. rasa/cli/project_templates/telco/actions/actions_billing.py +24 -17
  110. rasa/cli/project_templates/telco/actions/actions_get_data_from_db.py +6 -1
  111. rasa/cli/project_templates/telco/actions/actions_run_diagnostics.py +6 -1
  112. rasa/cli/project_templates/telco/actions/actions_session_start.py +6 -1
  113. rasa/cli/project_templates/tutorial/config.yml +2 -1
  114. rasa/cli/scaffold.py +27 -2
  115. rasa/cli/train.py +8 -0
  116. rasa/cli/utils.py +31 -15
  117. rasa/core/actions/action.py +28 -41
  118. rasa/core/actions/action_run_slot_rejections.py +1 -1
  119. rasa/core/channels/development_inspector.py +47 -14
  120. rasa/core/channels/inspector/dist/assets/{arc-371401b1.js → arc-1ddec37b.js} +1 -1
  121. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-3f126156.js → blockDiagram-38ab4fdb-18af387c.js} +1 -1
  122. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-12f22eb7.js → c4Diagram-3d4e48cf-250127a3.js} +1 -1
  123. rasa/core/channels/inspector/dist/assets/channel-59f6d54b.js +1 -0
  124. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-03b1d386.js → classDiagram-70f12bd4-c3388b34.js} +1 -1
  125. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-84f69d63.js → classDiagram-v2-f2320105-9c893a82.js} +1 -1
  126. rasa/core/channels/inspector/dist/assets/clone-26177ddb.js +1 -0
  127. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-ca47fd38.js → createText-2e5e7dd3-c111213b.js} +1 -1
  128. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-f837ca8a.js → edges-e0da2a9e-812a729d.js} +1 -1
  129. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-8717ac54.js → erDiagram-9861fffd-fd5051bc.js} +1 -1
  130. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-94f38b83.js → flowDb-956e92f1-3287ac02.js} +1 -1
  131. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-b616f9fb.js → flowDiagram-66a62f08-692fb0b2.js} +1 -1
  132. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-29c03f5a.js +1 -0
  133. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-f5d24bb8.js → flowchart-elk-definition-4a651766-008376f1.js} +1 -1
  134. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-b43ba8d9.js → ganttDiagram-c361ad54-df330a69.js} +1 -1
  135. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-c3aafaa5.js → gitGraphDiagram-72cf32ee-e03676fb.js} +1 -1
  136. rasa/core/channels/inspector/dist/assets/{graph-0d0a2c10.js → graph-46fad2ba.js} +1 -1
  137. rasa/core/channels/inspector/dist/assets/{index-3862675e-58ea0305.js → index-3862675e-a484ac55.js} +1 -1
  138. rasa/core/channels/inspector/dist/assets/{index-cce6f8a1.js → index-a003633f.js} +179 -179
  139. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-b8f60461.js → infoDiagram-f8f76790-3f9e6ec2.js} +1 -1
  140. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-95be5545.js → journeyDiagram-49397b02-79f72383.js} +1 -1
  141. rasa/core/channels/inspector/dist/assets/{layout-da885b9b.js → layout-aad098e5.js} +1 -1
  142. rasa/core/channels/inspector/dist/assets/{line-f1c817d3.js → line-219ab7ae.js} +1 -1
  143. rasa/core/channels/inspector/dist/assets/{linear-d42801e6.js → linear-2cddbe62.js} +1 -1
  144. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-a38923a6.js → mindmap-definition-fc14e90a-1d41ed99.js} +1 -1
  145. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-ca6e71e9.js → pieDiagram-8a3498a8-cc496ee8.js} +1 -1
  146. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-b290dae9.js → quadrantDiagram-120e2f19-84d32884.js} +1 -1
  147. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-03f02ceb.js → requirementDiagram-deff3bca-c0deb984.js} +1 -1
  148. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-c49eee40.js → sankeyDiagram-04a897e0-b9d7fd62.js} +1 -1
  149. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-b2cd6a3d.js → sequenceDiagram-704730f1-7d517565.js} +1 -1
  150. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-e53a2028.js → stateDiagram-587899a1-98ef9b27.js} +1 -1
  151. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-e1982a03.js → stateDiagram-v2-d93cdb3a-cee70748.js} +1 -1
  152. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-d0226ca5.js → styles-6aaf32cf-3f9d1c96.js} +1 -1
  153. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-0e21dc00.js → styles-9a916d00-67471923.js} +1 -1
  154. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-9588494e.js → styles-c10674c1-bd093fb7.js} +1 -1
  155. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-be478d4f.js → svgDrawCommon-08f97a94-675794e8.js} +1 -1
  156. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-74631749.js → timeline-definition-85554ec2-0ac67617.js} +1 -1
  157. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-a043552f.js → xychartDiagram-e933f94c-c018dc37.js} +1 -1
  158. rasa/core/channels/inspector/dist/index.html +2 -2
  159. rasa/core/channels/inspector/index.html +1 -1
  160. rasa/core/channels/inspector/package.json +4 -3
  161. rasa/core/channels/inspector/src/App.tsx +53 -7
  162. rasa/core/channels/inspector/src/components/Chat.tsx +3 -2
  163. rasa/core/channels/inspector/src/components/DiagramFlow.tsx +1 -1
  164. rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +268 -0
  165. rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +6 -2
  166. rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +8 -3
  167. rasa/core/channels/inspector/src/types.ts +8 -0
  168. rasa/core/channels/inspector/yarn.lock +12 -12
  169. rasa/core/channels/studio_chat.py +119 -34
  170. rasa/core/channels/voice_ready/twilio_voice.py +1 -1
  171. rasa/core/channels/voice_stream/asr/asr_engine.py +5 -1
  172. rasa/core/channels/voice_stream/asr/deepgram.py +5 -0
  173. rasa/core/channels/voice_stream/audiocodes.py +16 -8
  174. rasa/core/channels/voice_stream/browser_audio.py +39 -4
  175. rasa/core/channels/voice_stream/call_state.py +13 -2
  176. rasa/core/channels/voice_stream/genesys.py +16 -13
  177. rasa/core/channels/voice_stream/jambonz.py +14 -12
  178. rasa/core/channels/voice_stream/twilio_media_streams.py +14 -13
  179. rasa/core/channels/voice_stream/util.py +11 -1
  180. rasa/core/channels/voice_stream/voice_channel.py +108 -29
  181. rasa/core/nlg/callback.py +1 -1
  182. rasa/core/nlg/contextual_response_rephraser.py +19 -9
  183. rasa/core/nlg/generator.py +21 -5
  184. rasa/core/nlg/response.py +43 -6
  185. rasa/core/nlg/translate.py +8 -0
  186. rasa/core/policies/enterprise_search_policy.py +16 -21
  187. rasa/dialogue_understanding/commands/correct_slots_command.py +38 -10
  188. rasa/dialogue_understanding/generator/command_generator.py +5 -5
  189. rasa/dialogue_understanding/generator/command_parser.py +9 -13
  190. rasa/dialogue_understanding/processor/command_processor.py +149 -55
  191. rasa/dialogue_understanding/stack/utils.py +13 -3
  192. rasa/dialogue_understanding_test/du_test_schema.yml +3 -3
  193. rasa/dialogue_understanding_test/validation.py +9 -10
  194. rasa/e2e_test/e2e_config.py +18 -11
  195. rasa/e2e_test/e2e_test_schema.yml +3 -3
  196. rasa/e2e_test/utils/validation.py +17 -19
  197. rasa/engine/validation.py +86 -91
  198. rasa/exceptions.py +26 -1
  199. rasa/model_manager/model_api.py +2 -2
  200. rasa/model_manager/socket_bridge.py +8 -2
  201. rasa/shared/providers/_configs/default_litellm_client_config.py +3 -7
  202. rasa/shared/utils/cli.py +2 -0
  203. rasa/shared/utils/common.py +2 -1
  204. rasa/shared/utils/health_check/health_check.py +10 -14
  205. rasa/studio/upload.py +6 -2
  206. rasa/studio/utils.py +33 -22
  207. rasa/telemetry.py +95 -22
  208. rasa/utils/licensing.py +21 -10
  209. rasa/utils/log_utils.py +1 -1
  210. rasa/utils/tensorflow/transformer.py +3 -3
  211. rasa/validator.py +7 -5
  212. rasa/version.py +1 -1
  213. {rasa_pro-3.13.1a19.dist-info → rasa_pro-3.13.1a20.dist-info}/METADATA +7 -7
  214. {rasa_pro-3.13.1a19.dist-info → rasa_pro-3.13.1a20.dist-info}/RECORD +242 -205
  215. rasa/builder/constants.py +0 -4
  216. rasa/builder/copilot-llm-structured-output-response-schema.json +0 -69
  217. rasa/builder/copilot.py +0 -233
  218. rasa/builder/copilot_system_prompt.jinja2 +0 -245
  219. rasa/builder/create_openai_vector_store.py +0 -228
  220. rasa/builder/llm_context.py +0 -81
  221. rasa/cli/project_templates/finance/data/nlu.yml +0 -29
  222. rasa/cli/project_templates/finance/data/patterns/pattern_search.yml +0 -5
  223. rasa/cli/project_templates/finance/domain/default_flows.yml +0 -33
  224. rasa/cli/project_templates/finance/prompts/command-generator.jinja2 +0 -57
  225. rasa/cli/project_templates/finance/tests/conversation_repair/cancellations.yml +0 -12
  226. rasa/cli/project_templates/finance/tests/conversation_repair/cannot_handle.yml +0 -7
  227. rasa/cli/project_templates/finance/tests/conversation_repair/chitchat.yml +0 -7
  228. rasa/cli/project_templates/finance/tests/conversation_repair/clarification.yml +0 -9
  229. rasa/cli/project_templates/finance/tests/conversation_repair/completion.yml +0 -18
  230. rasa/cli/project_templates/finance/tests/conversation_repair/corrections.yml +0 -17
  231. rasa/cli/project_templates/finance/tests/conversation_repair/digressions.yml +0 -32
  232. rasa/cli/project_templates/finance/tests/conversation_repair/human_handoff.yml +0 -21
  233. rasa/cli/project_templates/finance/tests/conversation_repair/skipping_collect_steps.yml +0 -16
  234. rasa/cli/project_templates/finance/tests/demo_scripts/main.yml +0 -16
  235. rasa/cli/project_templates/finance/tests/happy_paths/balance_verification.yml +0 -15
  236. rasa/cli/project_templates/finance/tests/happy_paths/banking_questions.yml +0 -12
  237. rasa/cli/project_templates/finance/tests/happy_paths/card_blocking.yml +0 -52
  238. rasa/cli/project_templates/finance/tests/happy_paths/money_transfer.yml +0 -136
  239. rasa/cli/project_templates/finance/tests/happy_paths/payee_management.yml +0 -27
  240. rasa/cli/project_templates/finance/tests/happy_paths/user_greeted.yml +0 -5
  241. rasa/cli/project_templates/plain/config.yml +0 -17
  242. rasa/cli/project_templates/plain/data/patterns/pattern_session_start.yml +0 -7
  243. rasa/cli/project_templates/plain/domain.yml +0 -5
  244. rasa/core/channels/inspector/dist/assets/channel-f1efda17.js +0 -1
  245. rasa/core/channels/inspector/dist/assets/clone-fdf164e2.js +0 -1
  246. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-7d7a1629.js +0 -1
  247. rasa/shared/importers/static.py +0 -63
  248. /rasa/{cli/project_templates/plain/actions → builder/copilot}/__init__.py +0 -0
  249. /rasa/builder/{inkeep-rag-response-schema.json → document_retrieval/inkeep-rag-response-schema.json} +0 -0
  250. /rasa/cli/project_templates/finance/actions/{action_process_immediate_payment.py → transfers/action_process_immediate_payment.py} +0 -0
  251. /rasa/cli/project_templates/finance/actions/{action_schedule_payment.py → transfers/action_schedule_payment.py} +0 -0
  252. /rasa/cli/project_templates/finance/actions/{action_validate_payment_date.py → transfers/action_validate_payment_date.py} +0 -0
  253. /rasa/cli/project_templates/finance/data/{flows → cards}/block_card.yml +0 -0
  254. /rasa/cli/project_templates/finance/data/{flows → cards}/select_card.yml +0 -0
  255. /rasa/cli/project_templates/finance/data/{source → system/source}/accounts.json +0 -0
  256. /rasa/cli/project_templates/finance/data/{source → system/source}/advisors.json +0 -0
  257. /rasa/cli/project_templates/finance/data/{source → system/source}/appointments.json +0 -0
  258. /rasa/cli/project_templates/finance/data/{source → system/source}/branches.json +0 -0
  259. /rasa/cli/project_templates/finance/data/{source → system/source}/cards.json +0 -0
  260. /rasa/cli/project_templates/finance/data/{source → system/source}/payees.json +0 -0
  261. /rasa/cli/project_templates/finance/data/{source → system/source}/transactions.json +0 -0
  262. /rasa/cli/project_templates/finance/data/{source → system/source}/users.json +0 -0
  263. /rasa/cli/project_templates/finance/data/{flows → transfers}/add_payee.yml +0 -0
  264. /rasa/cli/project_templates/finance/data/{flows → transfers}/list_payees.yml +0 -0
  265. /rasa/cli/project_templates/finance/data/{flows → transfers}/remove_payee.yml +0 -0
  266. /rasa/cli/project_templates/finance/data/{flows → transfers}/transfer_money.yml +0 -0
  267. /rasa/cli/project_templates/finance/domain/{block_card.yml → cards/block_card.yml} +0 -0
  268. /rasa/cli/project_templates/finance/domain/{select_card.yml → cards/select_card.yml} +0 -0
  269. /rasa/cli/project_templates/finance/domain/{add_payee.yml → transfers/add_payee.yml} +0 -0
  270. /rasa/cli/project_templates/finance/domain/{list_payees.yml → transfers/list_payees.yml} +0 -0
  271. /rasa/cli/project_templates/finance/domain/{remove_payee.yml → transfers/remove_payee.yml} +0 -0
  272. /rasa/cli/project_templates/finance/domain/{transfer_money.yml → transfers/transfer_money.yml} +0 -0
  273. {rasa_pro-3.13.1a19.dist-info → rasa_pro-3.13.1a20.dist-info}/NOTICE +0 -0
  274. {rasa_pro-3.13.1a19.dist-info → rasa_pro-3.13.1a20.dist-info}/WHEEL +0 -0
  275. {rasa_pro-3.13.1a19.dist-info → rasa_pro-3.13.1a20.dist-info}/entry_points.txt +0 -0
rasa/builder/constants.py DELETED
@@ -1,4 +0,0 @@
1
- ROLE_SYSTEM = "system"
2
- ROLE_USER = "user"
3
- ROLE_ASSISTANT = "assistant"
4
- ROLE_RASA_COPILOT = "copilot"
@@ -1,69 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "content_blocks": {
6
- "type": "array",
7
- "items": {
8
- "oneOf": [
9
- {
10
- "type": "object",
11
- "required": ["type", "text"],
12
- "properties": {
13
- "type": {
14
- "type": "string",
15
- "enum": ["text"]
16
- },
17
- "text": {
18
- "type": "string"
19
- }
20
- }
21
- },
22
- {
23
- "type": "object",
24
- "required": ["type", "text"],
25
- "properties": {
26
- "type": {
27
- "type": "string",
28
- "enum": ["link"]
29
- },
30
- "text": {
31
- "type": "string",
32
- "format": "uri"
33
- }
34
- }
35
- },
36
- {
37
- "type": "object",
38
- "required": ["type", "file_path", "file_content"],
39
- "properties": {
40
- "type": {
41
- "type": "string",
42
- "enum": ["file"]
43
- },
44
- "file_path": {
45
- "type": "string"
46
- },
47
- "file_content": {
48
- "type": "string"
49
- }
50
- }
51
- },
52
- {
53
- "type": "object",
54
- "required": ["type", "text"],
55
- "properties": {
56
- "type": {
57
- "type": "string",
58
- "enum": ["code"]
59
- },
60
- "text": {
61
- "type": "string"
62
- }
63
- }
64
- }
65
- ]
66
- }
67
- }
68
- }
69
- }
rasa/builder/copilot.py DELETED
@@ -1,233 +0,0 @@
1
- import asyncio
2
- import importlib
3
- import json
4
- from contextlib import asynccontextmanager
5
- from typing import Any, Dict, List
6
-
7
- import importlib_resources
8
- import openai
9
- import structlog
10
- from jinja2 import Template
11
- from pydantic import ValidationError
12
- from typing_extensions import AsyncGenerator
13
-
14
- from rasa.builder import config
15
- from rasa.builder.constants import ROLE_SYSTEM, ROLE_USER
16
- from rasa.builder.exceptions import DocumentRetrievalError, LLMGenerationError
17
- from rasa.builder.inkeep_document_retrieval import InKeepDocumentRetrieval
18
- from rasa.builder.llm_context import tracker_as_llm_context
19
- from rasa.builder.models import CopilotChatMessage, CopilotContext, Document
20
- from rasa.shared.constants import PACKAGE_NAME
21
- from rasa.shared.utils.io import read_json_file
22
-
23
- COPILOT_LLM_STRUCTURED_OUTPUT_SCHEMA_PATH = str(
24
- importlib_resources.files(PACKAGE_NAME).joinpath(
25
- "builder/copilot-llm-structured-output-response-schema.json"
26
- )
27
- )
28
-
29
- structlogger = structlog.get_logger()
30
-
31
-
32
- class Copilot:
33
- def __init__(self):
34
- self._client = None
35
- self._copilot_response_schema = read_json_file(
36
- COPILOT_LLM_STRUCTURED_OUTPUT_SCHEMA_PATH
37
- )
38
- self._inkeep_document_retrieval = InKeepDocumentRetrieval()
39
- self._system_message_prompt_template = Template(
40
- importlib.resources.read_text(
41
- "rasa.builder",
42
- "copilot_system_prompt.jinja2",
43
- )
44
- )
45
-
46
- @asynccontextmanager
47
- async def _get_client(self) -> AsyncGenerator[openai.AsyncOpenAI, None]:
48
- """Get or lazy create OpenAI client with proper resource management."""
49
- if self._client is None:
50
- self._client = openai.AsyncOpenAI(timeout=config.OPENAI_TIMEOUT)
51
-
52
- try:
53
- yield self._client
54
- except Exception as e:
55
- structlogger.error("copilot.llm_client_error", error=str(e))
56
- raise
57
-
58
- async def generate_response(self, context: CopilotContext) -> CopilotChatMessage:
59
- """Generate copilot response using OpenAI."""
60
- try:
61
- async with self._get_client() as client:
62
- response_format = {
63
- "type": "json_schema",
64
- "json_schema": {
65
- "name": "copilot_response",
66
- "schema": self._copilot_response_schema,
67
- },
68
- } # type: ignore[arg-type]
69
- messages = await self._create_llm_request_messages(context)
70
-
71
- response = await client.chat.completions.create(
72
- model=config.OPENAI_MODEL,
73
- messages=messages,
74
- response_format=response_format,
75
- )
76
-
77
- content = response.choices[0].message.content
78
- if not content:
79
- structlogger.error(
80
- "copilot.generate_response.empty_llm_response",
81
- event_info="Copilot: Empty response from LLM",
82
- messages=messages,
83
- response=response,
84
- )
85
- raise LLMGenerationError("Copilot: Empty response from LLM")
86
-
87
- try:
88
- # Parse the JSON response and create a CopilotChatMessage
89
- llm_response = json.loads(content)
90
- structlogger.debug(
91
- "copilot.generate_response.llm_response",
92
- event_info="Copilot: LLM response",
93
- llm_response=llm_response,
94
- )
95
- return CopilotChatMessage.from_llm_response(llm_response)
96
- except (json.JSONDecodeError, ValidationError) as e:
97
- structlogger.error(
98
- "copilot.generate_response.llm_response_invalid_json_format",
99
- content=content,
100
- event_info=f"Copilot: Invalid JSON from LLM: {e}",
101
- error=str(e),
102
- )
103
- raise LLMGenerationError(f"Copilot: Invalid JSON from LLM: {e}")
104
-
105
- except openai.OpenAIError as e:
106
- structlogger.error(
107
- "copilot.generate_response.openai_api_error",
108
- event_info="Copilot: OpenAI API error",
109
- messages=messages,
110
- error=str(e),
111
- )
112
- raise LLMGenerationError(f"Copilot: OpenAI API error: {e}")
113
- except asyncio.TimeoutError:
114
- structlogger.error(
115
- "copilot.generate_response.llm_request_timeout",
116
- event_info="Copilot: LLM request timed out.",
117
- messages=messages,
118
- )
119
- raise LLMGenerationError("Copilot: LLM request timed out.")
120
-
121
- async def _create_llm_request_messages(
122
- self, context: CopilotContext
123
- ) -> List[Dict[str, Any]]:
124
- """Constructs the full list of messages to send to the LLM.
125
-
126
- This includes:
127
- - System instructions that utilizes logs, relevant documentation bits, and
128
- the current tracker state of the Rasa assistant to generate a response.
129
- - Chat history between the user and the copilot.
130
-
131
- Args:
132
- context: Context object containing chat history, current tracker
133
- state, logs, and file references.
134
-
135
- Returns:
136
- A full list of messages to pass to the LLM (system + chronological message
137
- history).
138
- """
139
- system_message = await self._create_system_message(context)
140
- chat_history_messages = self._create_chat_history_messages(context)
141
- return [system_message, *chat_history_messages]
142
-
143
- async def _create_system_message(
144
- self,
145
- context: CopilotContext,
146
- ) -> Dict[str, Any]:
147
- """Create the system message with the instructions and context for the copilot.
148
-
149
- Args:
150
- context: The context of the copilot.
151
-
152
- Returns:
153
- The system message for the copilot.
154
- """
155
- # Retrieve relevant documents from Rasa documentation and format them
156
- documentation_results = await self._search_rasa_documentation(context)
157
- formatted_docs = self._format_documents(documentation_results)
158
-
159
- # Format the current conversation between the user and the Rasa assistant
160
- current_conversation_with_assistant = tracker_as_llm_context(context.tracker)
161
-
162
- # Render the system message prompt template
163
- rendered_prompt = self._system_message_prompt_template.render(
164
- current_conversation=current_conversation_with_assistant,
165
- assistant_logs=context.assistant_logs,
166
- assistant_files=context.assistant_files,
167
- documentation_results=formatted_docs,
168
- )
169
- return {"role": ROLE_SYSTEM, "content": rendered_prompt}
170
-
171
- def _create_chat_history_messages(
172
- self,
173
- context: CopilotContext,
174
- ) -> List[Dict[str, Any]]:
175
- """Create the chat history messages for the copilot."""
176
- return [message.to_openai_format() for message in context.copilot_chat_history]
177
-
178
- async def _search_rasa_documentation(
179
- self,
180
- context: CopilotContext,
181
- ) -> List[Document]:
182
- """Search Rasa documentation for relevant information.
183
-
184
- Args:
185
- context: The context of the copilot.
186
-
187
- Returns:
188
- A list of Document objects. Empty list is returned if the search fails.
189
- """
190
- try:
191
- query = self._create_documentation_search_query(context)
192
- return await self._inkeep_document_retrieval.retrieve_documents(query)
193
- except DocumentRetrievalError as e:
194
- structlogger.error(
195
- "copilot.search_rasa_documentation.error",
196
- event_info=(
197
- f"Copilot: Searching Rasa documentation for query '{query}' "
198
- f"failed with the following error: {e}. Returning empty list."
199
- ),
200
- query=query,
201
- error=str(e),
202
- )
203
- return []
204
-
205
- @staticmethod
206
- def _create_documentation_search_query(context: CopilotContext) -> str:
207
- """Format chat messages between user and copilot for documentation search."""
208
- result = ""
209
- user_prefix = "User"
210
- assistant_prefix = "Assistant"
211
- for message in context.copilot_chat_history:
212
- text = message.get_text_content().strip()
213
- if not text:
214
- continue
215
- if message.role == ROLE_USER:
216
- result += f"{user_prefix}: {text}\n"
217
- else:
218
- result += f"{assistant_prefix}: {text}\n"
219
- return result
220
-
221
- @staticmethod
222
- def _format_documents(results: List[Document]) -> str:
223
- """Format documentation search results."""
224
- if not results:
225
- return "<sources>No relevant documentation found.</sources>"
226
-
227
- formatted_results = ""
228
- for result in results:
229
- formatted_result = f"<result url='{result.url}'>"
230
- formatted_result += f"<content>{result.content}</content>"
231
- formatted_results += formatted_result + "</result>"
232
-
233
- return f"<sources>{formatted_results}</sources>"
@@ -1,245 +0,0 @@
1
- You are an expert Rasa chatbot development assistant. Your role is to help users build, debug, customize, and improve
2
- their Rasa chatbots through conversational guidance and practical code solutions.
3
-
4
- ## Your Capabilities
5
-
6
- You can help users with:
7
- - **Debugging & Explanation**: Analyze conversations and logs to explain bot behavior
8
- - **Customization & Branding**: Modify responses, styling, and bot personality
9
- - **Skill Development**: Create new intents, entities, actions, and conversation flows
10
- - **Knowledge Integration**: Connect external documents and knowledge bases
11
- - **Code Generation**: Provide specific YAML configs, Python actions, and file modifications
12
- - **Flow Design**: Design complex multi-turn conversations and business logic
13
- - **Error Resolution**: Diagnose and fix training issues, deployment problems, and runtime errors
14
-
15
- ## Context Available to You
16
-
17
- You have access to:
18
- {% if current_conversation %}
19
- **Current Bot Conversation:**
20
- ```
21
- {{ current_conversation }}
22
- ```
23
- {% endif %}
24
-
25
- {% if assistant_logs %}
26
- **Bot Logs:**
27
- ```
28
- {{ assistant_logs }}
29
- ```
30
- {% endif %}
31
-
32
- {% if assistant_files %}
33
- **Bot Configuration Files:**
34
- {% for file_name, file_content in assistant_files.items() %}
35
- **{{ file_name }}:**
36
- ```
37
- {{ file_content }}
38
- ```
39
- {% endfor %}
40
- {% endif %}
41
-
42
- {% if documentation_results %}
43
- **Relevant Documentation:**
44
- ```
45
- {{documentation_results}}
46
- ```
47
- {% endif %}
48
-
49
- ## Response Guidelines
50
-
51
- ### When Explaining Bot Behavior ("Why did the assistant say that?")
52
- 1. **Identify the trigger**: Point to the specific intent, entity, or context that caused the response
53
- 2. **Trace the flow**: Show the path through flows that led to this response
54
- 3. **Provide code references**: Show exact lines in domain.yml, flows.yml, or actions.py
55
- 4. **Suggest improvements**: Offer specific ways to modify the behavior if needed
56
-
57
- Example response format:
58
- ```
59
- The assistant said that because:
60
-
61
- 1. **Intent triggered**: `ask_balance` (confidence: 0.95)
62
- 2. **Flow matched**: Line 23 in flows.yml - "balance inquiry flow"
63
- 3. **Response used**: `utter_ask_for_account_details` from domain.yml line 45
64
-
65
- The response is defined in your domain.yml:
66
- ```yaml
67
- responses:
68
- utter_ask_for_account_details:
69
- - text: "I'll help you check your balance. Could you please provide your account number?"
70
- ```
71
-
72
- To customize this, you can modify the text in domain.yml or create a custom action.
73
- ```
74
-
75
- ### When Helping with Customization ("Make it branded")
76
- 1. **Identify customization points**: Show specific files and sections to modify
77
- 2. **Provide exact code**: Give complete, ready-to-use YAML or Python code
78
- 3. **Explain the impact**: Describe how changes affect user experience
79
- 4. **Suggest best practices**: Recommend consistent branding approaches
80
-
81
- ### When Generating New Skills
82
- 1. **Gather requirements**: Ask clarifying questions about the skill's purpose
83
- 2. **Design the flow**: Outline the conversation structure
84
- 3. **Provide complete implementation**: Include intents, entities, flows, responses, and actions
85
- 4. **Test scenarios**: Suggest test cases to validate the skill
86
- 5. **Handle edge cases**: Include error handling and fallback responses
87
-
88
- ### When Integrating Knowledge
89
- 1. **Assess integration options**: Vector databases, retrieval actions, custom connectors
90
- 2. **Provide implementation steps**: Complete setup instructions with code
91
- 3. **Show preview changes**: Demonstrate how responses will change
92
- 4. **Optimize for performance**: Suggest caching and efficiency improvements
93
-
94
- ### Code Quality Standards
95
- - **Always provide complete, runnable code**
96
- - **Follow Rasa best practices** (proper intent naming, entity extraction, etc.)
97
- - **Include error handling** in custom actions
98
- - **Add inline comments** for complex logic
99
- - **Validate YAML syntax** before suggesting changes
100
- - **Consider conversation context** and maintain flow continuity
101
- - **Do not use stories, rules or forms** These are deprecated Rasa concepts.
102
- - **Do not refer to Rasa Studio**, the bot you are building is build with Rasa Pro.
103
-
104
- ### Using Documentation Context
105
- When documentation context is provided:
106
- 1. **Reference relevant sections**: Quote or paraphrase documentation that directly answers the user's question
107
- 2. **Provide source links**: Always include links to the full documentation page when available
108
- 3. **Combine with bot context**: Merge documentation guidance with the user's specific bot configuration
109
- 4. **Clarify concepts**: Use documentation to explain Rasa concepts the user might not understand
110
- 5. **Stay current**: Prioritize documentation context over general knowledge when there are conflicts
111
-
112
- ### When You Need More Information
113
- Ask specific questions like:
114
- - "Could you share the exact error message you're seeing?"
115
- - "What should happen when the user says [specific phrase]?"
116
- - "Do you want this to work for all users or specific user types?"
117
- - "Should this integrate with any external systems?"
118
-
119
- ### File Modification Format
120
- When suggesting file changes, use this format:
121
-
122
- **File: domain.yml**
123
- ```yaml
124
- # Add this to your responses section:
125
- responses:
126
- utter_welcome_branded:
127
- - text: "Welcome to [Your Company Name]! I'm here to help with your banking needs."
128
- - text: "Hi there! I'm [Bot Name], your personal banking assistant."
129
- ```
130
-
131
- **File: actions.py**
132
- ```python
133
- # Add this new action:
134
- class ActionCustomBalance(Action):
135
- def name(self) -> Text:
136
- return "action_get_balance"
137
-
138
- def run(self, dispatcher, tracker, domain):
139
- # Your implementation here
140
- return []
141
- ```
142
-
143
- ### Error Handling
144
- When users encounter errors:
145
- 1. **Reproduce the issue**: Show understanding of the problem
146
- 2. **Identify root cause**: Point to specific configuration issues
147
- 3. **Provide step-by-step fix**: Clear instructions with code examples
148
- 4. **Prevent future issues**: Suggest validation steps and best practices
149
-
150
- ### Conversation Flow
151
- - **Stay in character** as a helpful Rasa expert
152
- - **Be conversational** but precise
153
- - **Anticipate next steps** and offer proactive suggestions
154
- - **Reference specific files and line numbers** when possible
155
- - **Offer multiple solutions** when appropriate (simple vs. advanced)
156
-
157
- ## Response Format
158
-
159
- You must return your response as a JSON array of content blocks. Each content block should follow this structure:
160
-
161
- ### Text Blocks
162
- Use for explanations, instructions, and general content. Supports markdown formatting:
163
- ```json
164
- {
165
- "type": "text",
166
- "text": "Great question! The assistant said that because it triggered the `ask_balance` intent. Here's what happened:\n\n1. **Intent Recognition**: Your message matched the `ask_balance` intent\n2. **Flow Flow**: This triggered the flow defined in your `flows.yml`\n3. **Response**: The bot used `utter_ask_for_account_details` from your domain"
167
- }
168
- ```
169
-
170
- ### Code Blocks
171
- Use for generic code examples and snippets:
172
- ```json
173
- {
174
- "type": "code",
175
- "text": "responses:\n utter_greet:\n - text: \"Hello! How can I help you today?\"\n - text: \"Hi there! I'm here to assist you.\"",
176
- "language": "yaml"
177
- }
178
- ```
179
-
180
- ### File Blocks
181
- **Use whenever possible** to provide specific changes that apply to the user's bot:
182
- ```json
183
- {
184
- "type": "file",
185
- "file_path": "domain.yml",
186
- "file_content": "responses:\n utter_welcome_branded:\n - text: \"Welcome to [Your Company Name]! I'm here to help.\"\n - text: \"Hi! I'm [Bot Name], your personal assistant.\""
187
- }
188
- ```
189
-
190
- ### Link Blocks
191
- Use to reference Rasa documentation:
192
- ```json
193
- {
194
- "type": "link",
195
- "text": "https://rasa.com/docs/rasa/domain"
196
- }
197
- ```
198
-
199
- ### Response Guidelines:
200
- - **Always return a JSON array** of content blocks
201
- - **Prefer file blocks** over code blocks when providing bot-specific changes
202
- - **Use multiple content blocks** as needed to fully answer the question
203
- - **Include relevant documentation links** from https://rasa.com/docs
204
- - **Format text blocks with markdown** for better readability
205
-
206
- ### Example Multi-Block Response:
207
- ```json
208
- [
209
- {
210
- "type": "text",
211
- "text": "I can help you create a new skill for handling KYC verification. According to the Rasa documentation, flows provide a structured way to define conversation patterns. This will require several components:"
212
- },
213
- {
214
- "type": "file",
215
- "file_path": "domain.yml",
216
- "file_content": "intents:\n - request_kyc\n - provide_document\n\nentities:\n - document_type\n\nresponses:\n utter_request_documents:\n - text: \"To verify your identity, please provide a government-issued ID.\""
217
- },
218
- {
219
- "type": "file",
220
- "file_path": "flows.yml",
221
- "file_content": "flows:\n kyc_verification:\n description: Handle KYC document verification\n start_conditions:\n - intent: request_kyc\n steps:\n - action: utter_request_documents\n - intent: provide_document\n - action: action_process_kyc_document"
222
- },
223
- {
224
- "type": "file",
225
- "file_path": "data/nlu.yml",
226
- "file_content": "- intent: request_kyc\n examples: |\n - I need to verify my identity\n - How do I complete KYC\n - What documents do you need"
227
- },
228
- {
229
- "type": "text",
230
- "text": "For more detailed information about flows and custom actions, check out these documentation pages:"
231
- },
232
- {
233
- "type": "link",
234
- "text": "https://rasa.com/docs/rasa/flows"
235
- },
236
- {
237
- "type": "link",
238
- "text": "https://rasa.com/docs/rasa/custom-actions"
239
- }
240
- ]
241
- ```
242
-
243
- Remember: Your goal is to make Rasa development accessible and efficient. Always
244
- provide actionable, specific guidance that users can immediately implement in the
245
- structured content block format. Keep your response short and concise.