rasa-pro 3.13.1a17__py3-none-any.whl → 3.13.1.dev1__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 (267) hide show
  1. rasa/__init__.py +6 -0
  2. rasa/cli/scaffold.py +3 -22
  3. rasa/core/actions/action.py +3 -5
  4. rasa/core/actions/direct_custom_actions_executor.py +8 -15
  5. rasa/core/channels/studio_chat.py +10 -34
  6. rasa/core/policies/enterprise_search_policy.py +8 -7
  7. rasa/core/policies/flows/flow_executor.py +1 -8
  8. rasa/dialogue_understanding/generator/flow_retrieval.py +9 -10
  9. rasa/dialogue_understanding/generator/llm_based_command_generator.py +15 -4
  10. rasa/dialogue_understanding/generator/llm_command_generator.py +3 -1
  11. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +48 -3
  12. rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +15 -1
  13. rasa/hooks.py +55 -0
  14. rasa/llm_fine_tuning/utils.py +4 -2
  15. rasa/model_manager/model_api.py +3 -2
  16. rasa/model_manager/runner_service.py +1 -1
  17. rasa/model_manager/trainer_service.py +9 -12
  18. rasa/model_manager/utils.py +29 -1
  19. rasa/monkey_patches.py +91 -0
  20. rasa/shared/constants.py +6 -0
  21. rasa/shared/core/domain.py +15 -62
  22. rasa/shared/core/flows/flow_step.py +1 -7
  23. rasa/shared/core/flows/yaml_flows_io.py +8 -16
  24. rasa/shared/core/slots.py +0 -4
  25. rasa/shared/importers/importer.py +0 -6
  26. rasa/shared/importers/utils.py +1 -77
  27. rasa/shared/providers/constants.py +10 -0
  28. rasa/shared/providers/llm/_base_litellm_client.py +14 -4
  29. rasa/shared/providers/llm/litellm_router_llm_client.py +23 -12
  30. rasa/shared/providers/llm/llm_client.py +19 -15
  31. rasa/shared/providers/llm/self_hosted_llm_client.py +23 -18
  32. rasa/studio/upload.py +45 -10
  33. rasa/telemetry.py +1 -2
  34. rasa/tracing/instrumentation/attribute_extractors.py +1 -0
  35. rasa/utils/io.py +9 -27
  36. rasa/utils/json_utils.py +1 -6
  37. rasa/utils/log_utils.py +1 -5
  38. rasa/utils/plotting.py +1 -1
  39. rasa/validator.py +3 -7
  40. rasa/version.py +1 -1
  41. {rasa_pro-3.13.1a17.dist-info → rasa_pro-3.13.1.dev1.dist-info}/METADATA +9 -9
  42. {rasa_pro-3.13.1a17.dist-info → rasa_pro-3.13.1.dev1.dist-info}/RECORD +45 -266
  43. rasa/builder/README.md +0 -120
  44. rasa/builder/__init__.py +0 -0
  45. rasa/builder/config.py +0 -79
  46. rasa/builder/create_openai_vector_store.py +0 -228
  47. rasa/builder/exceptions.py +0 -55
  48. rasa/builder/inkeep-rag-response-schema.json +0 -64
  49. rasa/builder/inkeep_document_retrieval.py +0 -212
  50. rasa/builder/llm-helper-schema.json +0 -69
  51. rasa/builder/llm_context.py +0 -81
  52. rasa/builder/llm_helper_prompt.jinja2 +0 -245
  53. rasa/builder/llm_service.py +0 -317
  54. rasa/builder/logging_utils.py +0 -51
  55. rasa/builder/main.py +0 -147
  56. rasa/builder/models.py +0 -225
  57. rasa/builder/project_generator.py +0 -282
  58. rasa/builder/scrape_rasa_docs.py +0 -97
  59. rasa/builder/service.py +0 -742
  60. rasa/builder/skill_to_bot_prompt.jinja2 +0 -164
  61. rasa/builder/training_service.py +0 -132
  62. rasa/builder/validation_service.py +0 -93
  63. rasa/cli/project_templates/finance/actions/__init__.py +0 -0
  64. rasa/cli/project_templates/finance/actions/action_add_payee.py +0 -47
  65. rasa/cli/project_templates/finance/actions/action_ask_account.py +0 -50
  66. rasa/cli/project_templates/finance/actions/action_ask_account_from.py +0 -50
  67. rasa/cli/project_templates/finance/actions/action_ask_card.py +0 -47
  68. rasa/cli/project_templates/finance/actions/action_check_balance.py +0 -40
  69. rasa/cli/project_templates/finance/actions/action_check_card_existence.py +0 -35
  70. rasa/cli/project_templates/finance/actions/action_check_payee_existence.py +0 -40
  71. rasa/cli/project_templates/finance/actions/action_check_sufficient_funds.py +0 -41
  72. rasa/cli/project_templates/finance/actions/action_list_payees.py +0 -45
  73. rasa/cli/project_templates/finance/actions/action_process_immediate_payment.py +0 -18
  74. rasa/cli/project_templates/finance/actions/action_remove_payee.py +0 -49
  75. rasa/cli/project_templates/finance/actions/action_schedule_payment.py +0 -19
  76. rasa/cli/project_templates/finance/actions/action_session_start.py +0 -69
  77. rasa/cli/project_templates/finance/actions/action_update_card_status.py +0 -45
  78. rasa/cli/project_templates/finance/actions/action_validate_payment_date.py +0 -36
  79. rasa/cli/project_templates/finance/actions/database.py +0 -276
  80. rasa/cli/project_templates/finance/config.yml +0 -32
  81. rasa/cli/project_templates/finance/credentials.yml +0 -33
  82. rasa/cli/project_templates/finance/csvs/accounts.csv +0 -8
  83. rasa/cli/project_templates/finance/csvs/advisors.csv +0 -7
  84. rasa/cli/project_templates/finance/csvs/appointments.csv +0 -211
  85. rasa/cli/project_templates/finance/csvs/branches.csv +0 -10
  86. rasa/cli/project_templates/finance/csvs/cards.csv +0 -11
  87. rasa/cli/project_templates/finance/csvs/payees.csv +0 -10
  88. rasa/cli/project_templates/finance/csvs/transactions.csv +0 -71
  89. rasa/cli/project_templates/finance/csvs/users.csv +0 -4
  90. rasa/cli/project_templates/finance/data/flows/add_payee.yml +0 -29
  91. rasa/cli/project_templates/finance/data/flows/block_card.yml +0 -66
  92. rasa/cli/project_templates/finance/data/flows/check_balance.yml +0 -9
  93. rasa/cli/project_templates/finance/data/flows/list_payees.yml +0 -5
  94. rasa/cli/project_templates/finance/data/flows/remove_payee.yml +0 -21
  95. rasa/cli/project_templates/finance/data/flows/select_card.yml +0 -12
  96. rasa/cli/project_templates/finance/data/flows/transfer_money.yml +0 -67
  97. rasa/cli/project_templates/finance/data/flows/welcome.yml +0 -14
  98. rasa/cli/project_templates/finance/data/nlu.yml +0 -29
  99. rasa/cli/project_templates/finance/data/patterns/pattern_chitchat.yml +0 -7
  100. rasa/cli/project_templates/finance/data/patterns/pattern_completed.yml +0 -6
  101. rasa/cli/project_templates/finance/data/patterns/pattern_search.yml +0 -5
  102. rasa/cli/project_templates/finance/data/patterns/pattern_session_start.yml +0 -9
  103. rasa/cli/project_templates/finance/data/source/accounts.json +0 -51
  104. rasa/cli/project_templates/finance/data/source/advisors.json +0 -44
  105. rasa/cli/project_templates/finance/data/source/appointments.json +0 -1474
  106. rasa/cli/project_templates/finance/data/source/branches.json +0 -47
  107. rasa/cli/project_templates/finance/data/source/cards.json +0 -72
  108. rasa/cli/project_templates/finance/data/source/payees.json +0 -74
  109. rasa/cli/project_templates/finance/data/source/transactions.json +0 -492
  110. rasa/cli/project_templates/finance/data/source/users.json +0 -29
  111. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +0 -8
  112. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +0 -8
  113. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +0 -8
  114. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +0 -8
  115. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +0 -8
  116. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +0 -7
  117. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +0 -8
  118. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +0 -8
  119. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +0 -8
  120. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +0 -8
  121. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +0 -8
  122. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +0 -8
  123. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +0 -8
  124. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +0 -8
  125. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +0 -8
  126. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +0 -8
  127. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +0 -8
  128. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +0 -8
  129. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +0 -8
  130. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +0 -8
  131. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +0 -50
  132. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +0 -50
  133. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +0 -48
  134. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +0 -50
  135. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +0 -50
  136. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +0 -47
  137. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +0 -50
  138. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +0 -50
  139. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +0 -47
  140. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +0 -50
  141. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +0 -50
  142. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +0 -50
  143. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +0 -47
  144. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +0 -50
  145. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +0 -50
  146. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +0 -47
  147. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +0 -50
  148. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +0 -50
  149. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +0 -47
  150. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +0 -50
  151. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +0 -50
  152. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +0 -47
  153. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +0 -47
  154. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +0 -50
  155. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +0 -50
  156. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +0 -47
  157. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +0 -50
  158. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +0 -50
  159. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +0 -47
  160. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +0 -50
  161. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +0 -50
  162. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +0 -47
  163. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +0 -50
  164. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +0 -50
  165. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +0 -50
  166. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +0 -47
  167. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +0 -50
  168. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +0 -50
  169. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +0 -47
  170. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +0 -50
  171. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +0 -50
  172. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +0 -47
  173. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +0 -50
  174. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +0 -50
  175. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +0 -50
  176. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +0 -47
  177. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +0 -50
  178. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +0 -50
  179. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +0 -47
  180. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +0 -50
  181. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +0 -50
  182. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +0 -47
  183. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +0 -50
  184. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +0 -50
  185. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +0 -47
  186. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +0 -47
  187. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +0 -50
  188. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +0 -50
  189. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +0 -50
  190. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +0 -50
  191. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +0 -47
  192. rasa/cli/project_templates/finance/domain/add_payee.yml +0 -47
  193. rasa/cli/project_templates/finance/domain/block_card.yml +0 -101
  194. rasa/cli/project_templates/finance/domain/check_balance.yml +0 -9
  195. rasa/cli/project_templates/finance/domain/default_actions.yml +0 -16
  196. rasa/cli/project_templates/finance/domain/default_flows.yml +0 -33
  197. rasa/cli/project_templates/finance/domain/list_payees.yml +0 -4
  198. rasa/cli/project_templates/finance/domain/remove_payee.yml +0 -16
  199. rasa/cli/project_templates/finance/domain/select_card.yml +0 -12
  200. rasa/cli/project_templates/finance/domain/transfer_money.yml +0 -79
  201. rasa/cli/project_templates/finance/endpoints.yml +0 -62
  202. rasa/cli/project_templates/finance/prompts/command-generator.jinja2 +0 -57
  203. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +0 -19
  204. rasa/cli/project_templates/finance/tests/conversation_repair/cancellations.yml +0 -12
  205. rasa/cli/project_templates/finance/tests/conversation_repair/cannot_handle.yml +0 -7
  206. rasa/cli/project_templates/finance/tests/conversation_repair/chitchat.yml +0 -7
  207. rasa/cli/project_templates/finance/tests/conversation_repair/clarification.yml +0 -9
  208. rasa/cli/project_templates/finance/tests/conversation_repair/completion.yml +0 -18
  209. rasa/cli/project_templates/finance/tests/conversation_repair/corrections.yml +0 -17
  210. rasa/cli/project_templates/finance/tests/conversation_repair/digressions.yml +0 -32
  211. rasa/cli/project_templates/finance/tests/conversation_repair/human_handoff.yml +0 -21
  212. rasa/cli/project_templates/finance/tests/conversation_repair/skipping_collect_steps.yml +0 -16
  213. rasa/cli/project_templates/finance/tests/demo_scripts/main.yml +0 -16
  214. rasa/cli/project_templates/finance/tests/happy_paths/balance_verification.yml +0 -15
  215. rasa/cli/project_templates/finance/tests/happy_paths/banking_questions.yml +0 -12
  216. rasa/cli/project_templates/finance/tests/happy_paths/card_blocking.yml +0 -52
  217. rasa/cli/project_templates/finance/tests/happy_paths/money_transfer.yml +0 -136
  218. rasa/cli/project_templates/finance/tests/happy_paths/payee_management.yml +0 -27
  219. rasa/cli/project_templates/finance/tests/happy_paths/user_greeted.yml +0 -5
  220. rasa/cli/project_templates/plain/actions/__init__.py +0 -0
  221. rasa/cli/project_templates/plain/config.yml +0 -17
  222. rasa/cli/project_templates/plain/credentials.yml +0 -33
  223. rasa/cli/project_templates/plain/data/patterns/pattern_session_start.yml +0 -7
  224. rasa/cli/project_templates/plain/domain.yml +0 -5
  225. rasa/cli/project_templates/plain/endpoints.yml +0 -58
  226. rasa/cli/project_templates/telco/actions/__init__.py +0 -0
  227. rasa/cli/project_templates/telco/actions/actions_billing.py +0 -197
  228. rasa/cli/project_templates/telco/actions/actions_get_data_from_db.py +0 -43
  229. rasa/cli/project_templates/telco/actions/actions_run_diagnostics.py +0 -23
  230. rasa/cli/project_templates/telco/actions/actions_session_start.py +0 -13
  231. rasa/cli/project_templates/telco/config.yml +0 -25
  232. rasa/cli/project_templates/telco/credentials.yml +0 -33
  233. rasa/cli/project_templates/telco/csvs/billing.csv +0 -10
  234. rasa/cli/project_templates/telco/csvs/customers.csv +0 -5
  235. rasa/cli/project_templates/telco/data/flows/flow_global.yml +0 -5
  236. rasa/cli/project_templates/telco/data/flows/flow_reboot_router.yml +0 -8
  237. rasa/cli/project_templates/telco/data/flows/flow_reset_router.yml +0 -7
  238. rasa/cli/project_templates/telco/data/flows/flow_solve_internet_issue.yml +0 -73
  239. rasa/cli/project_templates/telco/data/flows/flow_undertand_bill.yml +0 -45
  240. rasa/cli/project_templates/telco/data/patterns/pattern_completed.yml +0 -7
  241. rasa/cli/project_templates/telco/data/patterns/pattern_human_handoff.yml +0 -6
  242. rasa/cli/project_templates/telco/data/patterns/pattern_search.yml +0 -7
  243. rasa/cli/project_templates/telco/data/patterns/pattern_session_start.yml +0 -9
  244. rasa/cli/project_templates/telco/docs/reset_vs_rboot_router.txt +0 -1
  245. rasa/cli/project_templates/telco/docs/restart_router.txt +0 -6
  246. rasa/cli/project_templates/telco/docs/run_speed_test.txt +0 -6
  247. rasa/cli/project_templates/telco/domain/domain_global.yml +0 -29
  248. rasa/cli/project_templates/telco/domain/domain_patterns.yml +0 -17
  249. rasa/cli/project_templates/telco/domain/domain_reboot_router.yml +0 -20
  250. rasa/cli/project_templates/telco/domain/domain_reset_router.yml +0 -11
  251. rasa/cli/project_templates/telco/domain/domain_run_speed_test.yml +0 -24
  252. rasa/cli/project_templates/telco/domain/domain_solve_internet_issue.yml +0 -74
  253. rasa/cli/project_templates/telco/domain/domain_undertand_bill.yml +0 -102
  254. rasa/cli/project_templates/telco/endpoints.yml +0 -60
  255. rasa/cli/project_templates/telco/prompts/command-generator.jinja2 +0 -57
  256. rasa/cli/project_templates/telco/tests/e2e_results_failed.yml +0 -62
  257. rasa/cli/project_templates/telco/tests/e2e_results_passed.yml +0 -130
  258. rasa/cli/project_templates/telco/tests/e2e_test_cases/billing_test_cases.yml +0 -68
  259. rasa/cli/project_templates/telco/tests/e2e_test_cases/global_test_cases.yml +0 -13
  260. rasa/cli/project_templates/telco/tests/e2e_test_cases/internet_slow_test_case.yml +0 -47
  261. rasa/cli/project_templates/telco/tests/e2e_test_cases/out_of_scope_test_case.yml +0 -21
  262. rasa/cli/project_templates/telco/tests/e2e_test_cases/patterns_test_cases.yml +0 -15
  263. rasa/shared/importers/static.py +0 -63
  264. rasa/utils/openapi.py +0 -144
  265. {rasa_pro-3.13.1a17.dist-info → rasa_pro-3.13.1.dev1.dist-info}/NOTICE +0 -0
  266. {rasa_pro-3.13.1a17.dist-info → rasa_pro-3.13.1.dev1.dist-info}/WHEEL +0 -0
  267. {rasa_pro-3.13.1a17.dist-info → rasa_pro-3.13.1.dev1.dist-info}/entry_points.txt +0 -0
@@ -1,212 +0,0 @@
1
- import asyncio
2
- import json
3
- import os
4
- from contextlib import asynccontextmanager
5
- from typing import List, Optional
6
-
7
- import importlib_resources
8
- import openai
9
- import structlog
10
- from openai.types.chat import ChatCompletion
11
-
12
- from rasa.builder.exceptions import DocumentRetrievalError
13
- from rasa.builder.models import Document
14
- from rasa.constants import PACKAGE_NAME
15
- from rasa.shared.utils.io import read_json_file
16
-
17
- INKEEP_API_KEY_ENV_VAR = "INKEEP_API_KEY"
18
- INKEEP_RAG_RESPONSE_SCHEMA_PATH = str(
19
- importlib_resources.files(PACKAGE_NAME).joinpath(
20
- "builder/inkeep-rag-response-schema.json"
21
- )
22
- )
23
-
24
- INKEEP_DOCUMENT_RETRIEVAL_MODEL = "inkeep-rag"
25
- INKEEP_BASE_URL = "https://api.inkeep.com/v1/"
26
-
27
- structlogger = structlog.get_logger()
28
-
29
-
30
- class InKeepDocumentRetrieval:
31
- """Handles the document retrieval from InKeep AI."""
32
-
33
- def __init__(
34
- self,
35
- api_key: Optional[str] = None,
36
- ):
37
- self._client: Optional[openai.AsyncOpenAI] = None
38
- self._rag_schema = read_json_file(INKEEP_RAG_RESPONSE_SCHEMA_PATH)
39
- self._api_key = api_key or os.getenv(INKEEP_API_KEY_ENV_VAR)
40
-
41
- async def retrieve_documents(
42
- self, query: str, temperature: float = 0.0, timeout: float = 30.0
43
- ) -> List[Document]:
44
- """Retrieve relevant documents using InKeep AI based on the given query.
45
-
46
- Args:
47
- query: The search query
48
- temperature: Controls randomness in generation (0.0 for deterministic)
49
- timeout: Timeout for the API call
50
-
51
- Returns:
52
- List of Document objects containing retrieved content
53
-
54
- Raises:
55
- LLMGenerationError: If the API call fails or returns invalid response
56
- """
57
- response = await self._call_inkeep_rag_api(
58
- query=query,
59
- temperature=temperature,
60
- timeout=timeout,
61
- )
62
- documents = self._parse_documents_from_response(response)
63
- return documents
64
-
65
- async def _call_inkeep_rag_api(
66
- self, query: str, temperature: float, timeout: float
67
- ) -> ChatCompletion:
68
- """Call InKeep AI RAG's API endpoint and return the response content.
69
-
70
- Args:
71
- query: The search query to send to InKeep
72
- temperature: Controls randomness in generation (0.0 for deterministic)
73
- timeout: Timeout for the API call
74
-
75
- Returns:
76
- The response content from InKeep AI. The response is made of the retrieved
77
- documents.
78
-
79
- Raises:
80
- LLMGenerationError: If the API call fails or returns invalid response
81
- """
82
- request_params = {
83
- "model": INKEEP_DOCUMENT_RETRIEVAL_MODEL,
84
- "messages": [{"role": "user", "content": query}],
85
- "temperature": temperature,
86
- "timeout": timeout,
87
- "response_format": {
88
- "type": "json_schema",
89
- "json_schema": self._rag_schema,
90
- },
91
- }
92
- try:
93
- async with self._get_client() as client:
94
- response = await client.chat.completions.create(**request_params)
95
-
96
- if not response.choices[0].message.content:
97
- structlogger.warning(
98
- "inkeep_document_retrieval.empty_response",
99
- event_info="InKeep AI returned an empty response. ",
100
- request_params=request_params,
101
- response_content=response.choices[0].message.content,
102
- )
103
- raise DocumentRetrievalError(
104
- "InKeep Document Retrieval: Empty response"
105
- )
106
-
107
- return response
108
-
109
- except openai.OpenAIError as e:
110
- structlogger.error(
111
- "inkeep_document_retrieval.api_error",
112
- event_info="InKeep Document Retrieval: API error",
113
- request_params=request_params,
114
- error=e,
115
- )
116
- raise DocumentRetrievalError(f"InKeep Document Retrieval: API error: {e}")
117
- except asyncio.TimeoutError as e:
118
- structlogger.error(
119
- "inkeep_document_retrieval.timeout_error",
120
- event_info="InKeep Document Retrieval: Timeout error",
121
- request_params=request_params,
122
- error=e,
123
- )
124
- raise DocumentRetrievalError(f"InKeep AI request timed out: {e}")
125
- except Exception as e:
126
- structlogger.error(
127
- "inkeep_document_retrieval.error",
128
- event_info="InKeep Document Retrieval: Error",
129
- request_params=request_params,
130
- error=e,
131
- )
132
- raise DocumentRetrievalError(
133
- f"InKeep Document Retrieval: Unexpected error: {e}"
134
- )
135
-
136
- @asynccontextmanager
137
- async def _get_client(self):
138
- """Get or create client that handles the API calls to InKeep AI."""
139
- if self._client is None:
140
- self._client = openai.AsyncOpenAI(
141
- api_key=self._api_key,
142
- base_url=INKEEP_BASE_URL,
143
- )
144
-
145
- try:
146
- yield self._client
147
- except Exception as e:
148
- structlogger.error(
149
- "inkeep_document_retrieval.client_error",
150
- event_info="InKeep Document Retrieval: Client error",
151
- error=str(e),
152
- )
153
- raise
154
-
155
- def _parse_documents_from_response(
156
- self, response: ChatCompletion
157
- ) -> List[Document]:
158
- """Parse the InKeep AI response into Document objects.
159
-
160
- Args:
161
- response: ChatCompletion response from InKeep AI's RAG model.
162
-
163
- Returns:
164
- List of Document objects
165
- """
166
- try:
167
- content = response.choices[0].message.content
168
- if not content:
169
- return []
170
-
171
- response_data = json.loads(content)
172
- documents = []
173
-
174
- for item in response_data.get("content", []):
175
- try:
176
- document = Document.from_inkeep_rag_response(item)
177
- documents.append(document)
178
- except Exception as e:
179
- structlogger.warning(
180
- "inkeep_document_retrieval.invalid_document_skipped",
181
- event_info=(
182
- "InKeep Document Retrieval: Invalid document structure "
183
- "skipped. Returning empty list for this item."
184
- ),
185
- error=str(e),
186
- item=item,
187
- )
188
- # Continue processing other items, skip this invalid one
189
- continue
190
-
191
- return documents
192
-
193
- except json.JSONDecodeError as e:
194
- structlogger.warning(
195
- "inkeep_document_retrieval.parse_response_failed",
196
- event_info=(
197
- "InKeep Document Retrieval: Parse response failed. "
198
- "Returning empty list.",
199
- ),
200
- error=str(e),
201
- )
202
- return []
203
- except Exception as e:
204
- structlogger.error(
205
- "inkeep_document_retrieval.parse_response_error",
206
- event_info=(
207
- "InKeep Document Retrieval: Parse response error. "
208
- "Returning empty list.",
209
- ),
210
- error=str(e),
211
- )
212
- return []
@@ -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", "content"],
39
- "properties": {
40
- "type": {
41
- "type": "string",
42
- "enum": ["file"]
43
- },
44
- "file": {
45
- "type": "string"
46
- },
47
- "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
- }
@@ -1,81 +0,0 @@
1
- import json
2
- from typing import Optional
3
-
4
- from rasa.shared.core.constants import DEFAULT_SLOT_NAMES
5
- from rasa.shared.core.events import (
6
- ActionExecuted,
7
- BotUttered,
8
- FlowCompleted,
9
- FlowStarted,
10
- SlotSet,
11
- UserUttered,
12
- )
13
- from rasa.shared.core.trackers import DialogueStateTracker
14
-
15
-
16
- def tracker_as_llm_context(tracker: Optional[DialogueStateTracker]) -> str:
17
- """Convert a tracker to a string that can be used as context for the LLM."""
18
- if not tracker or not tracker.events:
19
- return "No conversation history available."
20
-
21
- context_parts = []
22
- current_turn = []
23
-
24
- for event in tracker.events:
25
- if isinstance(event, UserUttered):
26
- if current_turn:
27
- context_parts.append(" | ".join(current_turn))
28
- current_turn = []
29
- current_turn.append(f"User: {event.text}")
30
- if event.intent:
31
- current_turn.append(f"Intent: {event.intent.get('name')}")
32
- if event.entities:
33
- current_turn.append(
34
- f"Entities: {[e.get('entity') for e in event.entities]}"
35
- )
36
- if event.commands:
37
- current_turn.append(
38
- f"Commands: {[cmd.get('name') for cmd in event.commands]}"
39
- )
40
-
41
- elif isinstance(event, BotUttered):
42
- if event.text:
43
- current_turn.append(f"Bot: {event.text}")
44
-
45
- elif isinstance(event, ActionExecuted):
46
- current_turn.append(f"Action: {event.action_name}")
47
- if event.confidence:
48
- current_turn.append(f"Confidence: {event.confidence:.2f}")
49
-
50
- elif isinstance(event, SlotSet) and event.key not in DEFAULT_SLOT_NAMES:
51
- current_turn.append(f"Slot Set: {event.key}={event.value}")
52
-
53
- elif isinstance(event, FlowStarted):
54
- current_turn.append(f"# Flow Started: {event.flow_id}")
55
-
56
- elif isinstance(event, FlowCompleted):
57
- current_turn.append(f"# Flow Completed: {event.flow_id}")
58
-
59
- if current_turn:
60
- context_parts.append(" | ".join(current_turn))
61
-
62
- # Add final state information
63
- context_parts.append("\nCurrent State:")
64
- context_parts.append(f"Latest Message: {tracker.latest_message.text or '-'}")
65
-
66
- # Add active flows from stack
67
- if tracker.active_flow:
68
- context_parts.append(f"Active Flow: {tracker.active_flow}")
69
- if tracker.stack:
70
- context_parts.append(f"Flow Stack: {json.dumps(tracker.stack.as_dict())}")
71
-
72
- # Add slot values that are not None
73
- non_empty_slots = {
74
- k: str(v.value)
75
- for k, v in tracker.slots.items()
76
- if v is not None and k not in DEFAULT_SLOT_NAMES
77
- }
78
- if non_empty_slots:
79
- context_parts.append(f"Slots: {json.dumps(non_empty_slots)}")
80
-
81
- return "\n".join(context_parts)
@@ -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 bot_logs %}
26
- **Bot Logs:**
27
- ```
28
- {{ bot_logs }}
29
- ```
30
- {% endif %}
31
-
32
- {% if chat_bot_files %}
33
- **Bot Configuration Files:**
34
- {% for file_name, file_content in chat_bot_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": "domain.yml",
186
- "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": "domain.yml",
216
- "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": "flows.yml",
221
- "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": "data/nlu.yml",
226
- "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.