rasa-pro 3.8.17__py3-none-any.whl → 3.9.14__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 (272) hide show
  1. README.md +5 -5
  2. rasa/__main__.py +14 -9
  3. rasa/anonymization/anonymization_pipeline.py +0 -1
  4. rasa/anonymization/anonymization_rule_executor.py +3 -3
  5. rasa/anonymization/utils.py +4 -3
  6. rasa/api.py +2 -2
  7. rasa/cli/arguments/default_arguments.py +1 -1
  8. rasa/cli/arguments/run.py +2 -2
  9. rasa/cli/arguments/test.py +1 -1
  10. rasa/cli/arguments/train.py +10 -10
  11. rasa/cli/e2e_test.py +27 -7
  12. rasa/cli/export.py +0 -1
  13. rasa/cli/license.py +3 -3
  14. rasa/cli/project_templates/calm/actions/action_template.py +1 -1
  15. rasa/cli/project_templates/calm/config.yml +1 -1
  16. rasa/cli/project_templates/calm/credentials.yml +1 -1
  17. rasa/cli/project_templates/calm/data/flows/add_contact.yml +1 -1
  18. rasa/cli/project_templates/calm/data/flows/remove_contact.yml +1 -1
  19. rasa/cli/project_templates/calm/domain/add_contact.yml +8 -2
  20. rasa/cli/project_templates/calm/domain/list_contacts.yml +3 -0
  21. rasa/cli/project_templates/calm/domain/remove_contact.yml +9 -2
  22. rasa/cli/project_templates/calm/domain/shared.yml +5 -0
  23. rasa/cli/project_templates/calm/endpoints.yml +4 -4
  24. rasa/cli/project_templates/default/actions/actions.py +1 -1
  25. rasa/cli/project_templates/default/config.yml +5 -5
  26. rasa/cli/project_templates/default/credentials.yml +1 -1
  27. rasa/cli/project_templates/default/endpoints.yml +4 -4
  28. rasa/cli/project_templates/default/tests/test_stories.yml +1 -1
  29. rasa/cli/project_templates/tutorial/config.yml +1 -1
  30. rasa/cli/project_templates/tutorial/credentials.yml +1 -1
  31. rasa/cli/project_templates/tutorial/data/patterns.yml +6 -0
  32. rasa/cli/project_templates/tutorial/domain.yml +4 -0
  33. rasa/cli/project_templates/tutorial/endpoints.yml +6 -6
  34. rasa/cli/run.py +0 -1
  35. rasa/cli/scaffold.py +3 -2
  36. rasa/cli/studio/download.py +11 -0
  37. rasa/cli/studio/studio.py +180 -24
  38. rasa/cli/studio/upload.py +0 -8
  39. rasa/cli/telemetry.py +18 -6
  40. rasa/cli/utils.py +21 -10
  41. rasa/cli/x.py +3 -2
  42. rasa/core/actions/action.py +90 -315
  43. rasa/core/actions/action_exceptions.py +24 -0
  44. rasa/core/actions/constants.py +3 -0
  45. rasa/core/actions/custom_action_executor.py +188 -0
  46. rasa/core/actions/forms.py +11 -7
  47. rasa/core/actions/grpc_custom_action_executor.py +251 -0
  48. rasa/core/actions/http_custom_action_executor.py +140 -0
  49. rasa/core/actions/loops.py +3 -0
  50. rasa/core/actions/two_stage_fallback.py +1 -1
  51. rasa/core/agent.py +2 -4
  52. rasa/core/brokers/pika.py +1 -2
  53. rasa/core/channels/audiocodes.py +1 -1
  54. rasa/core/channels/botframework.py +0 -1
  55. rasa/core/channels/callback.py +0 -1
  56. rasa/core/channels/console.py +6 -8
  57. rasa/core/channels/development_inspector.py +1 -1
  58. rasa/core/channels/facebook.py +0 -3
  59. rasa/core/channels/hangouts.py +0 -6
  60. rasa/core/channels/inspector/dist/assets/{arc-5623b6dc.js → arc-b6e548fe.js} +1 -1
  61. rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-685c106a.js → c4Diagram-d0fbc5ce-fa03ac9e.js} +1 -1
  62. rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-8cbed007.js → classDiagram-936ed81e-ee67392a.js} +1 -1
  63. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-5889cf12.js → classDiagram-v2-c3cb15f1-9b283fae.js} +1 -1
  64. rasa/core/channels/inspector/dist/assets/{createText-62fc7601-24c249d7.js → createText-62fc7601-8b6fcc2a.js} +1 -1
  65. rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-7dd06a75.js → edges-f2ad444c-22e77f4f.js} +1 -1
  66. rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-62c1e54c.js → erDiagram-9d236eb7-60ffc87f.js} +1 -1
  67. rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-ce49b86f.js → flowDb-1972c806-9dd802e4.js} +1 -1
  68. rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-4067e48f.js → flowDiagram-7ea5b25a-5fa1912f.js} +1 -1
  69. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-1844e5a5.js +1 -0
  70. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-59fe4051.js → flowchart-elk-definition-abe16c3d-622a1fd2.js} +1 -1
  71. rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-47e3a43b.js → ganttDiagram-9b5ea136-e285a63a.js} +1 -1
  72. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-5a2ac0d9.js → gitGraphDiagram-99d0ae7c-f237bdca.js} +1 -1
  73. rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-dfb8efc4.js → index-2c4b9a3b-4b03d70e.js} +1 -1
  74. rasa/core/channels/inspector/dist/assets/{index-268a75c0.js → index-a5d3e69d.js} +4 -4
  75. rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-b0c470f2.js → infoDiagram-736b4530-72a0fa5f.js} +1 -1
  76. rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-2edb829a.js → journeyDiagram-df861f2b-82218c41.js} +1 -1
  77. rasa/core/channels/inspector/dist/assets/{layout-b6873d69.js → layout-78cff630.js} +1 -1
  78. rasa/core/channels/inspector/dist/assets/{line-1efc5781.js → line-5038b469.js} +1 -1
  79. rasa/core/channels/inspector/dist/assets/{linear-661e9b94.js → linear-c4fc4098.js} +1 -1
  80. rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-2d2e727f.js → mindmap-definition-beec6740-c33c8ea6.js} +1 -1
  81. rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-9d3ea93d.js → pieDiagram-dbbf0591-a8d03059.js} +1 -1
  82. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-06a178a2.js → quadrantDiagram-4d7f4fd6-6a0e56b2.js} +1 -1
  83. rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-0bfedffc.js → requirementDiagram-6fc4c22a-2dc7c7bd.js} +1 -1
  84. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-d76d0a04.js → sankeyDiagram-8f13d901-2360fe39.js} +1 -1
  85. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-37bb4341.js → sequenceDiagram-b655622a-41b9f9ad.js} +1 -1
  86. rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-f52f7f57.js → stateDiagram-59f0c015-0aad326f.js} +1 -1
  87. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-4a986a20.js → stateDiagram-v2-2b26beab-9847d984.js} +1 -1
  88. rasa/core/channels/inspector/dist/assets/{styles-080da4f6-7dd9ae12.js → styles-080da4f6-564d890e.js} +1 -1
  89. rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-46e1ca14.js → styles-3dcbcfbf-38957613.js} +1 -1
  90. rasa/core/channels/inspector/dist/assets/{styles-9c745c82-4a97439a.js → styles-9c745c82-f0fc6921.js} +1 -1
  91. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-823917a3.js → svgDrawCommon-4835440b-ef3c5a77.js} +1 -1
  92. rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-9ea72896.js → timeline-definition-5b62e21b-bf3e91c1.js} +1 -1
  93. rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-b631a8b6.js → xychartDiagram-2b33534f-4d4026c0.js} +1 -1
  94. rasa/core/channels/inspector/dist/index.html +1 -1
  95. rasa/core/channels/inspector/src/components/DiagramFlow.tsx +10 -0
  96. rasa/core/channels/inspector/src/helpers/formatters.test.ts +4 -7
  97. rasa/core/channels/inspector/src/helpers/formatters.ts +3 -2
  98. rasa/core/channels/rest.py +36 -21
  99. rasa/core/channels/rocketchat.py +0 -1
  100. rasa/core/channels/socketio.py +1 -1
  101. rasa/core/channels/telegram.py +3 -3
  102. rasa/core/channels/webexteams.py +0 -1
  103. rasa/core/concurrent_lock_store.py +1 -1
  104. rasa/core/evaluation/marker_base.py +1 -3
  105. rasa/core/evaluation/marker_stats.py +1 -2
  106. rasa/core/featurizers/single_state_featurizer.py +2 -4
  107. rasa/core/featurizers/tracker_featurizers.py +0 -7
  108. rasa/core/information_retrieval/__init__.py +7 -0
  109. rasa/core/information_retrieval/faiss.py +9 -4
  110. rasa/core/information_retrieval/information_retrieval.py +64 -7
  111. rasa/core/information_retrieval/milvus.py +7 -14
  112. rasa/core/information_retrieval/qdrant.py +8 -15
  113. rasa/core/lock_store.py +0 -1
  114. rasa/core/migrate.py +1 -2
  115. rasa/core/nlg/callback.py +3 -4
  116. rasa/core/policies/enterprise_search_policy.py +86 -22
  117. rasa/core/policies/enterprise_search_prompt_template.jinja2 +4 -41
  118. rasa/core/policies/enterprise_search_prompt_with_citation_template.jinja2 +60 -0
  119. rasa/core/policies/flows/flow_executor.py +104 -2
  120. rasa/core/policies/intentless_policy.py +7 -9
  121. rasa/core/policies/memoization.py +3 -3
  122. rasa/core/policies/policy.py +18 -9
  123. rasa/core/policies/rule_policy.py +8 -11
  124. rasa/core/policies/ted_policy.py +28 -30
  125. rasa/core/policies/unexpected_intent_policy.py +1 -2
  126. rasa/core/processor.py +136 -47
  127. rasa/core/run.py +41 -25
  128. rasa/core/secrets_manager/endpoints.py +2 -2
  129. rasa/core/secrets_manager/vault.py +6 -8
  130. rasa/core/test.py +3 -5
  131. rasa/core/tracker_store.py +49 -14
  132. rasa/core/train.py +1 -3
  133. rasa/core/training/interactive.py +9 -6
  134. rasa/core/utils.py +5 -10
  135. rasa/dialogue_understanding/coexistence/intent_based_router.py +11 -4
  136. rasa/dialogue_understanding/coexistence/llm_based_router.py +2 -3
  137. rasa/dialogue_understanding/commands/__init__.py +4 -0
  138. rasa/dialogue_understanding/commands/can_not_handle_command.py +9 -0
  139. rasa/dialogue_understanding/commands/cancel_flow_command.py +9 -0
  140. rasa/dialogue_understanding/commands/change_flow_command.py +38 -0
  141. rasa/dialogue_understanding/commands/chit_chat_answer_command.py +9 -0
  142. rasa/dialogue_understanding/commands/clarify_command.py +9 -0
  143. rasa/dialogue_understanding/commands/correct_slots_command.py +9 -0
  144. rasa/dialogue_understanding/commands/error_command.py +12 -0
  145. rasa/dialogue_understanding/commands/handle_code_change_command.py +9 -0
  146. rasa/dialogue_understanding/commands/human_handoff_command.py +9 -0
  147. rasa/dialogue_understanding/commands/knowledge_answer_command.py +9 -0
  148. rasa/dialogue_understanding/commands/noop_command.py +9 -0
  149. rasa/dialogue_understanding/commands/set_slot_command.py +34 -3
  150. rasa/dialogue_understanding/commands/skip_question_command.py +9 -0
  151. rasa/dialogue_understanding/commands/start_flow_command.py +9 -0
  152. rasa/dialogue_understanding/generator/__init__.py +16 -1
  153. rasa/dialogue_understanding/generator/command_generator.py +92 -6
  154. rasa/dialogue_understanding/generator/constants.py +18 -0
  155. rasa/dialogue_understanding/generator/flow_retrieval.py +7 -5
  156. rasa/dialogue_understanding/generator/llm_based_command_generator.py +467 -0
  157. rasa/dialogue_understanding/generator/llm_command_generator.py +39 -609
  158. rasa/dialogue_understanding/generator/multi_step/__init__.py +0 -0
  159. rasa/dialogue_understanding/generator/multi_step/fill_slots_prompt.jinja2 +62 -0
  160. rasa/dialogue_understanding/generator/multi_step/handle_flows_prompt.jinja2 +38 -0
  161. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +827 -0
  162. rasa/dialogue_understanding/generator/nlu_command_adapter.py +69 -8
  163. rasa/dialogue_understanding/generator/single_step/__init__.py +0 -0
  164. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +345 -0
  165. rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +44 -39
  166. rasa/dialogue_understanding/processor/command_processor.py +111 -3
  167. rasa/e2e_test/constants.py +1 -0
  168. rasa/e2e_test/e2e_test_case.py +44 -0
  169. rasa/e2e_test/e2e_test_runner.py +114 -11
  170. rasa/e2e_test/e2e_test_schema.yml +18 -0
  171. rasa/engine/caching.py +0 -1
  172. rasa/engine/graph.py +18 -6
  173. rasa/engine/recipes/config_files/default_config.yml +3 -3
  174. rasa/engine/recipes/default_components.py +1 -1
  175. rasa/engine/recipes/default_recipe.py +4 -5
  176. rasa/engine/recipes/recipe.py +1 -1
  177. rasa/engine/runner/dask.py +3 -9
  178. rasa/engine/storage/local_model_storage.py +0 -2
  179. rasa/engine/validation.py +179 -145
  180. rasa/exceptions.py +2 -2
  181. rasa/graph_components/validators/default_recipe_validator.py +3 -5
  182. rasa/hooks.py +0 -1
  183. rasa/model.py +1 -1
  184. rasa/model_training.py +1 -0
  185. rasa/nlu/classifiers/diet_classifier.py +8 -14
  186. rasa/nlu/extractors/crf_entity_extractor.py +4 -4
  187. rasa/nlu/extractors/duckling_entity_extractor.py +1 -1
  188. rasa/nlu/featurizers/dense_featurizer/convert_featurizer.py +1 -5
  189. rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py +0 -4
  190. rasa/nlu/featurizers/featurizer.py +1 -1
  191. rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +2 -4
  192. rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +9 -12
  193. rasa/nlu/persistor.py +68 -26
  194. rasa/nlu/selectors/response_selector.py +7 -10
  195. rasa/nlu/test.py +0 -3
  196. rasa/nlu/utils/hugging_face/registry.py +1 -1
  197. rasa/nlu/utils/spacy_utils.py +1 -3
  198. rasa/server.py +22 -7
  199. rasa/shared/constants.py +12 -1
  200. rasa/shared/core/command_payload_reader.py +109 -0
  201. rasa/shared/core/constants.py +4 -5
  202. rasa/shared/core/domain.py +57 -56
  203. rasa/shared/core/events.py +4 -7
  204. rasa/shared/core/flows/flow.py +9 -0
  205. rasa/shared/core/flows/flows_list.py +12 -0
  206. rasa/shared/core/flows/steps/action.py +7 -2
  207. rasa/shared/core/generator.py +12 -11
  208. rasa/shared/core/slot_mappings.py +315 -24
  209. rasa/shared/core/slots.py +4 -2
  210. rasa/shared/core/trackers.py +32 -14
  211. rasa/shared/core/training_data/loading.py +0 -1
  212. rasa/shared/core/training_data/story_reader/story_reader.py +3 -3
  213. rasa/shared/core/training_data/story_reader/yaml_story_reader.py +11 -11
  214. rasa/shared/core/training_data/story_writer/yaml_story_writer.py +5 -3
  215. rasa/shared/core/training_data/structures.py +1 -1
  216. rasa/shared/core/training_data/visualization.py +1 -1
  217. rasa/shared/data.py +58 -1
  218. rasa/shared/exceptions.py +36 -2
  219. rasa/shared/importers/importer.py +1 -2
  220. rasa/shared/importers/rasa.py +0 -1
  221. rasa/shared/nlu/constants.py +2 -0
  222. rasa/shared/nlu/training_data/entities_parser.py +1 -2
  223. rasa/shared/nlu/training_data/formats/dialogflow.py +3 -2
  224. rasa/shared/nlu/training_data/formats/rasa_yaml.py +3 -5
  225. rasa/shared/nlu/training_data/formats/readerwriter.py +0 -1
  226. rasa/shared/nlu/training_data/message.py +13 -0
  227. rasa/shared/nlu/training_data/training_data.py +0 -2
  228. rasa/shared/providers/openai/session_handler.py +2 -2
  229. rasa/shared/utils/constants.py +3 -0
  230. rasa/shared/utils/io.py +11 -0
  231. rasa/shared/utils/llm.py +1 -2
  232. rasa/shared/utils/pykwalify_extensions.py +1 -0
  233. rasa/shared/utils/schemas/domain.yml +3 -0
  234. rasa/shared/utils/yaml.py +44 -35
  235. rasa/studio/auth.py +26 -10
  236. rasa/studio/constants.py +2 -0
  237. rasa/studio/data_handler.py +114 -107
  238. rasa/studio/download.py +160 -27
  239. rasa/studio/results_logger.py +137 -0
  240. rasa/studio/train.py +6 -7
  241. rasa/studio/upload.py +159 -134
  242. rasa/telemetry.py +188 -34
  243. rasa/tracing/config.py +18 -3
  244. rasa/tracing/constants.py +26 -2
  245. rasa/tracing/instrumentation/attribute_extractors.py +50 -41
  246. rasa/tracing/instrumentation/instrumentation.py +290 -44
  247. rasa/tracing/instrumentation/intentless_policy_instrumentation.py +7 -5
  248. rasa/tracing/instrumentation/metrics.py +109 -21
  249. rasa/tracing/metric_instrument_provider.py +83 -3
  250. rasa/utils/cli.py +2 -1
  251. rasa/utils/common.py +1 -1
  252. rasa/utils/endpoints.py +1 -2
  253. rasa/utils/io.py +6 -6
  254. rasa/utils/licensing.py +246 -31
  255. rasa/utils/ml_utils.py +1 -1
  256. rasa/utils/tensorflow/data_generator.py +1 -1
  257. rasa/utils/tensorflow/environment.py +1 -1
  258. rasa/utils/tensorflow/model_data.py +9 -11
  259. rasa/utils/tensorflow/model_data_utils.py +499 -500
  260. rasa/utils/tensorflow/models.py +5 -6
  261. rasa/utils/tensorflow/rasa_layers.py +15 -15
  262. rasa/utils/train_utils.py +1 -1
  263. rasa/utils/url_tools.py +53 -0
  264. rasa/validator.py +305 -3
  265. rasa/version.py +1 -1
  266. {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/METADATA +22 -22
  267. {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/RECORD +271 -253
  268. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-85583a23.js +0 -1
  269. /rasa/dialogue_understanding/generator/{command_prompt_template.jinja2 → single_step/command_prompt_template.jinja2} +0 -0
  270. {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/NOTICE +0 -0
  271. {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/WHEEL +0 -0
  272. {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  # This file contains the credentials for the voice & chat platforms
2
2
  # which your bot is using.
3
- # https://rasa.com/docs/rasa/messaging-and-voice-channels
3
+ # https://rasa.com/docs/rasa-pro/connectors/messaging-and-voice-channels/
4
4
 
5
5
  rest:
6
6
  # # you don't need to provide anything here - this channel doesn't
@@ -0,0 +1,6 @@
1
+ flows:
2
+ pattern_chitchat:
3
+ description: Conversation repair flow for off-topic interactions that won't disrupt the main conversation. should not respond to greetings or anything else for which there is a flow defined
4
+ name: pattern chitchat
5
+ steps:
6
+ - action: utter_free_chitchat_response
@@ -3,8 +3,12 @@ version: "3.1"
3
3
  slots:
4
4
  recipient:
5
5
  type: text
6
+ mappings:
7
+ - type: from_llm
6
8
  amount:
7
9
  type: float
10
+ mappings:
11
+ - type: from_llm
8
12
 
9
13
  responses:
10
14
  utter_ask_recipient:
@@ -1,21 +1,21 @@
1
1
  # This file contains the different endpoints your bot can use.
2
2
 
3
3
  # Server where the models are pulled from.
4
- # https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server
4
+ # https://rasa.com/docs/rasa-pro/production/model-storage#fetching-models-from-a-server
5
5
 
6
6
  #models:
7
7
  # url: http://my-server.com/models/default_core@latest
8
8
  # wait_time_between_pulls: 10 # [optional](default: 100)
9
9
 
10
10
  # Server which runs your custom actions.
11
- # https://rasa.com/docs/rasa/custom-actions
11
+ # https://rasa.com/docs/rasa-pro/concepts/custom-actions
12
12
 
13
13
  action_endpoint:
14
14
  url: "http://localhost:5055/webhook"
15
15
 
16
16
  # Tracker store which is used to store the conversations.
17
17
  # By default the conversations are stored in memory.
18
- # https://rasa.com/docs/rasa/tracker-stores
18
+ # https://rasa.com/docs/rasa-pro/production/tracker-stores
19
19
 
20
20
  #tracker_store:
21
21
  # type: redis
@@ -33,7 +33,7 @@ action_endpoint:
33
33
  # password: <password used for authentication>
34
34
 
35
35
  # Event broker which all conversation events should be streamed to.
36
- # https://rasa.com/docs/rasa/event-brokers
36
+ # https://rasa.com/docs/rasa-pro/production/event-brokers
37
37
 
38
38
  #event_broker:
39
39
  # url: localhost
@@ -41,5 +41,5 @@ action_endpoint:
41
41
  # password: password
42
42
  # queue: queue
43
43
 
44
- #nlg:
45
- # type: rephrase
44
+ nlg:
45
+ type: rephrase
rasa/cli/run.py CHANGED
@@ -58,7 +58,6 @@ def run_actions(args: argparse.Namespace) -> None:
58
58
 
59
59
 
60
60
  def _validate_model_path(model_path: Text, parameter: Text, default: Text) -> Text:
61
-
62
61
  if model_path is not None and not os.path.exists(model_path):
63
62
  reason_str = f"'{model_path}' not found."
64
63
  if model_path is None:
rasa/cli/scaffold.py CHANGED
@@ -213,8 +213,9 @@ def run(args: argparse.Namespace) -> None:
213
213
  print_success("Welcome to Rasa! 🤖\n")
214
214
  print(
215
215
  "By installing and using this software, you agree to be bound by the terms "
216
- "and conditions of the End-User License Agreement (EULA) available at "
217
- "https://rasa.com/eula. Please review the EULA carefully before proceeding.\n"
216
+ "and conditions of the Developer Terms available at "
217
+ "https://rasa.com/developer-terms. "
218
+ "Please review the Developer Terms carefully before proceeding.\n"
218
219
  )
219
220
  if args.no_prompt:
220
221
  print(
@@ -2,7 +2,12 @@ import argparse
2
2
  from typing import List
3
3
 
4
4
  from rasa.cli import SubParsersAction
5
+ from rasa.cli.arguments.default_arguments import (
6
+ add_config_param,
7
+ add_endpoint_param,
8
+ )
5
9
  from rasa.cli.arguments.train import add_data_param, add_domain_param
10
+ from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH, DEFAULT_CONFIG_PATH
6
11
 
7
12
  from rasa.studio.download import handle_download
8
13
 
@@ -35,6 +40,12 @@ def set_studio_download_arguments(parser: argparse.ArgumentParser) -> None:
35
40
  """Add arguments for running `rasa studio download`."""
36
41
  add_domain_param(parser)
37
42
  add_data_param(parser)
43
+ add_config_param(parser, default=DEFAULT_CONFIG_PATH)
44
+ add_endpoint_param(
45
+ parser,
46
+ "Configuration file for the model endpoints.",
47
+ default=DEFAULT_ENDPOINTS_PATH,
48
+ )
38
49
 
39
50
  parser.add_argument(
40
51
  "assistant_name",
rasa/cli/studio/studio.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import argparse
2
- from typing import List
2
+ from typing import List, Optional
3
+ from urllib.parse import ParseResult, urlparse
3
4
 
4
5
  import questionary
5
6
  from rasa.cli import SubParsersAction
@@ -11,6 +12,11 @@ from rasa.studio.auth import StudioAuth
11
12
  from rasa.studio.config import StudioConfig
12
13
 
13
14
 
15
+ DEFAULT_REALM_NAME = "rasa-studio"
16
+
17
+ DEFAULT_CLIENT_ID = "admin-cli"
18
+
19
+
14
20
  def add_subparser(
15
21
  subparsers: SubParsersAction, parents: List[argparse.ArgumentParser]
16
22
  ) -> None:
@@ -34,13 +40,24 @@ def add_subparser(
34
40
  def _add_config_subparser(
35
41
  studio_sub_parsers: SubParsersAction, parents: List[argparse.ArgumentParser]
36
42
  ) -> None:
37
- studio_sub_parsers.add_parser(
43
+ studio_config_parser = studio_sub_parsers.add_parser(
38
44
  "config",
39
45
  parents=parents,
40
46
  conflict_handler="resolve",
41
47
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
42
48
  help="Configure communication parameters for Rasa Studio",
43
- ).set_defaults(func=_create_studio_config)
49
+ )
50
+
51
+ studio_config_parser.set_defaults(func=create_and_store_studio_config)
52
+
53
+ # add advanced configuration flag to trigger
54
+ # advanced configuration setup for authentication settings
55
+ studio_config_parser.add_argument(
56
+ "--advanced",
57
+ action="store_true",
58
+ default=False,
59
+ help="Configure additional authentication parameters for Rasa Studio",
60
+ )
44
61
 
45
62
 
46
63
  def _add_login_subparser(
@@ -74,37 +91,176 @@ def _studio_login(args: argparse.Namespace) -> None:
74
91
  Args:
75
92
  args: Commandline arguments
76
93
  """
77
- username = args.username
78
- password = args.password
79
-
80
94
  studio_config = StudioConfig.read_config()
81
95
  studio_auth = StudioAuth(studio_config)
82
- studio_auth.login(username, password)
83
96
 
97
+ # show the user the studio url they are logging into
98
+ # urlparse will always return parseresult if a string is passed in as url
99
+ parsed_url: ParseResult = urlparse(studio_config.studio_url) # type: ignore[assignment]
100
+ studio_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
101
+
102
+ rasa.shared.utils.cli.print_info(
103
+ f"Trying to log in to Rasa Studio at {studio_url} ..."
104
+ )
105
+
106
+ try:
107
+ username = args.username
108
+ password = args.password
109
+
110
+ if not username:
111
+ username = questionary.text("Please enter your username").unsafe_ask()
112
+
113
+ if not password:
114
+ password = questionary.password("Please enter your password").unsafe_ask()
115
+
116
+ studio_auth.login(username, password)
117
+ except KeyboardInterrupt:
118
+ rasa.shared.utils.cli.print_error("Login to Rasa Studio aborted.")
119
+ except Exception as e:
120
+ rasa.shared.utils.cli.print_error(f"Failed to login to Rasa Studio. {e}")
84
121
 
85
- def _create_studio_config(_: argparse.Namespace) -> None:
86
- authentication_server_url = questionary.text(
87
- "Please enter an URL path to the Authentication Server",
88
- default="https://auth.rasa.com",
89
- ).ask()
90
122
 
123
+ def _configure_studio_url() -> Optional[str]:
124
+ """Configure the Rasa Studio URL.
125
+
126
+ Returns:
127
+ The configured Rasa Studio URL
128
+ """
91
129
  studio_url = questionary.text(
92
- "Please enter an URL path to the Studio",
93
- default="https://studio.rasa.com/graphql/",
94
- ).ask()
130
+ "Please provide the Rasa Studio URL",
131
+ ).unsafe_ask()
132
+
133
+ if not studio_url.endswith("/"):
134
+ studio_url += "/"
135
+
136
+ # prepend with https if no protocol is provided
137
+ if not studio_url.startswith("http"):
138
+ return "https://" + studio_url
139
+ return studio_url
95
140
 
96
- realm_name = questionary.text("Please enter Realm Name", default="Studio").ask()
141
+
142
+ def _get_advanced_config(studio_url: str) -> tuple:
143
+ """Get the advanced configuration values for Rasa Studio."""
144
+ keycloak_url = questionary.text(
145
+ "Please provide your Rasa Studio Keycloak URL",
146
+ default=studio_url + "auth/",
147
+ ).unsafe_ask()
148
+
149
+ realm_name = questionary.text(
150
+ "Please enter Realm Name", default=DEFAULT_REALM_NAME
151
+ ).unsafe_ask()
97
152
 
98
153
  client_id = questionary.text(
99
- "Please enter client ID",
100
- ).ask()
154
+ "Please enter client ID", default=DEFAULT_CLIENT_ID
155
+ ).unsafe_ask()
156
+
157
+ return keycloak_url, realm_name, client_id
101
158
 
102
- if not authentication_server_url.endswith("/"):
103
- authentication_server_url += "/"
104
159
 
105
- StudioConfig(
106
- authentication_server_url=authentication_server_url,
107
- studio_url=studio_url,
160
+ def _get_default_config(studio_url: str) -> tuple:
161
+ """Get the default configuration values for Rasa Studio."""
162
+ keycloak_url = studio_url + "auth/"
163
+ realm_name = DEFAULT_REALM_NAME
164
+ client_id = DEFAULT_CLIENT_ID
165
+
166
+ rasa.shared.utils.cli.print_info(
167
+ f"Using default values for "
168
+ f"Keycloak URL: {keycloak_url}, "
169
+ f"Realm Name: '{realm_name}', "
170
+ f"Client ID: '{client_id}'. "
171
+ f"You can use '--advanced' to configure these settings."
172
+ )
173
+
174
+ return keycloak_url, realm_name, client_id
175
+
176
+
177
+ def _create_studio_config(
178
+ studio_url: str, keycloak_url: str, realm_name: str, client_id: str
179
+ ) -> StudioConfig:
180
+ """Create a StudioConfig object with the provided parameters."""
181
+ return StudioConfig(
182
+ authentication_server_url=keycloak_url,
183
+ studio_url=studio_url + "api/graphql/",
108
184
  client_id=client_id,
109
185
  realm_name=realm_name,
110
- ).write_config()
186
+ )
187
+
188
+
189
+ def _check_studio_auth(studio_auth: StudioAuth) -> bool:
190
+ """Check if the Rasa Studio authentication server is reachable."""
191
+ if studio_auth.health_check():
192
+ rasa.shared.utils.cli.print_info(
193
+ "Tried configuration and successfully reached Rasa Studio."
194
+ )
195
+ return True
196
+ return False
197
+
198
+
199
+ def _prompt_store_config_anyways() -> bool:
200
+ """Prompt the user to store the configuration."""
201
+ should_store_config = questionary.confirm(
202
+ "Do you want to store the configuration anyway?"
203
+ ).unsafe_ask()
204
+
205
+ return should_store_config
206
+
207
+
208
+ def _configure_studio_config(args: argparse.Namespace) -> StudioConfig:
209
+ """Configure the Rasa Studio connection settings."""
210
+ studio_url = _configure_studio_url()
211
+
212
+ # check if the user wants to configure advanced authentication settings
213
+ if args.advanced:
214
+ keycloak_url, realm_name, client_id = _get_advanced_config(studio_url)
215
+ else:
216
+ keycloak_url, realm_name, client_id = _get_default_config(studio_url)
217
+
218
+ # create a configuration and auth object to try to reach the studio
219
+ studio_config = _create_studio_config(
220
+ studio_url, keycloak_url, realm_name, client_id
221
+ )
222
+ studio_auth = StudioAuth(studio_config)
223
+
224
+ if _check_studio_auth(studio_auth):
225
+ return studio_config
226
+
227
+ rasa.shared.utils.cli.print_error(
228
+ f"Failed to reach Rasa Studio authentication server at "
229
+ f"{studio_config.authentication_server_url}."
230
+ )
231
+
232
+ if _prompt_store_config_anyways():
233
+ return studio_config
234
+
235
+ rasa.shared.utils.cli.print_info(
236
+ "The config was not stored, you can change the values "
237
+ "again or abort with Ctrl-C."
238
+ )
239
+
240
+ return _configure_studio_config(args)
241
+
242
+
243
+ def create_and_store_studio_config(args: argparse.Namespace) -> None:
244
+ """Create and store the Rasa Studio configuration.
245
+
246
+ Args:
247
+ args: Commandline arguments
248
+ """
249
+ try:
250
+ rasa.shared.utils.cli.print_info(
251
+ "Configuring Rasa Studio connection settings ..."
252
+ )
253
+ studio_config = _configure_studio_config(args)
254
+
255
+ if studio_config:
256
+ studio_config.write_config()
257
+
258
+ rasa.shared.utils.cli.print_success(
259
+ "Successfully configured Rasa Pro to connect to Studio."
260
+ )
261
+ else:
262
+ rasa.shared.utils.cli.print_error(
263
+ "Failed to configure Rasa Pro to connect to Studio."
264
+ )
265
+ except KeyboardInterrupt:
266
+ rasa.shared.utils.cli.print_error("Configuration of Rasa Studio aborted.")
rasa/cli/studio/upload.py CHANGED
@@ -54,14 +54,6 @@ def set_upload_arguments(parser: argparse.ArgumentParser) -> None:
54
54
  add_config_param(parser)
55
55
  add_endpoint_param(parser, help_text="Path to the endpoints file.")
56
56
 
57
- parser.add_argument(
58
- "assistant_name",
59
- default=None,
60
- nargs=1,
61
- type=str,
62
- help="Name of the assistant on Rasa Studio",
63
- )
64
-
65
57
  parser.add_argument(
66
58
  "--entities",
67
59
  default=None,
rasa/cli/telemetry.py CHANGED
@@ -7,6 +7,7 @@ from rasa.cli import SubParsersAction
7
7
  import rasa.cli.utils
8
8
  from rasa.shared.constants import DOCS_URL_TELEMETRY
9
9
  import rasa.shared.utils.cli
10
+ from rasa.utils import licensing
10
11
 
11
12
 
12
13
  def add_subparser(
@@ -21,7 +22,7 @@ def add_subparser(
21
22
  telemetry_parser = subparsers.add_parser(
22
23
  "telemetry",
23
24
  parents=parents,
24
- help="Configuration of Rasa Open Source telemetry reporting.",
25
+ help="Configuration of Rasa Pro telemetry reporting.",
25
26
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
26
27
  )
27
28
 
@@ -30,7 +31,7 @@ def add_subparser(
30
31
  "disable",
31
32
  parents=parents,
32
33
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
33
- help="Disable Rasa Open Source Telemetry reporting.",
34
+ help="Disable Rasa Pro Telemetry reporting.",
34
35
  )
35
36
  telemetry_disable_parser.set_defaults(func=disable_telemetry)
36
37
 
@@ -38,7 +39,7 @@ def add_subparser(
38
39
  "enable",
39
40
  parents=parents,
40
41
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
41
- help="Enable Rasa Open Source Telemetry reporting.",
42
+ help="Enable Rasa Pro Telemetry reporting.",
42
43
  )
43
44
  telemetry_enable_parser.set_defaults(func=enable_telemetry)
44
45
  telemetry_parser.set_defaults(func=inform_about_telemetry)
@@ -60,11 +61,15 @@ def inform_about_telemetry(_: argparse.Namespace) -> None:
60
61
  textwrap.dedent(
61
62
  """
62
63
  Rasa uses telemetry to report anonymous usage information. This information
63
- is essential to help improve Rasa Open Source for all users."""
64
+ is essential to help improve Rasa Pro for all users."""
64
65
  )
65
66
  )
66
-
67
- if not is_enabled:
67
+ if licensing.is_champion_server_license():
68
+ print(
69
+ "\nYou are using a developer license, which requires telemetry "
70
+ "reporting to be enabled."
71
+ )
72
+ elif not is_enabled:
68
73
  print("\nYou can enable telemetry reporting using")
69
74
  rasa.shared.utils.cli.print_info("\n\trasa telemetry enable")
70
75
  else:
@@ -79,6 +84,13 @@ def inform_about_telemetry(_: argparse.Namespace) -> None:
79
84
 
80
85
  def disable_telemetry(_: argparse.Namespace) -> None:
81
86
  """Disable telemetry tracking."""
87
+ if licensing.is_champion_server_license():
88
+ rasa.shared.utils.cli.print_error(
89
+ "You are using a developer license, which requires telemetry "
90
+ "reporting to be enabled."
91
+ )
92
+ return
93
+
82
94
  telemetry.track_telemetry_disabled()
83
95
  telemetry.toggle_telemetry_reporting(is_enabled=False)
84
96
  rasa.shared.utils.cli.print_success("Disabled telemetry reporting.")
rasa/cli/utils.py CHANGED
@@ -23,7 +23,6 @@ from rasa.shared.utils.yaml import read_config_file
23
23
  from rasa.utils.io import write_yaml
24
24
 
25
25
  if TYPE_CHECKING:
26
-
27
26
  from questionary import Question
28
27
  from typing_extensions import Literal
29
28
  from rasa.validator import Validator
@@ -39,8 +38,7 @@ def get_validated_path(
39
38
  parameter: Text,
40
39
  default: Optional[Union[Path, Text, List[Text]]] = ...,
41
40
  none_is_valid: "Literal[False]" = ...,
42
- ) -> Union[Path, Text]:
43
- ...
41
+ ) -> Union[Path, Text]: ...
44
42
 
45
43
 
46
44
  @overload
@@ -49,8 +47,7 @@ def get_validated_path(
49
47
  parameter: Text,
50
48
  default: Optional[Union[Path, Text, List[Text]]] = ...,
51
49
  none_is_valid: "Literal[True]" = ...,
52
- ) -> Optional[Union[Path, Text]]:
53
- ...
50
+ ) -> Optional[Union[Path, Text]]: ...
54
51
 
55
52
 
56
53
  def get_validated_path(
@@ -158,9 +155,9 @@ def validate_assistant_id_in_config(config_file: Union["Path", Text]) -> None:
158
155
 
159
156
  # add random value for assistant id, overwrite config file
160
157
  time_format = "%Y%m%d-%H%M%S"
161
- config_data[
162
- ASSISTANT_ID_KEY
163
- ] = f"{time.strftime(time_format)}-{randomname.get_name()}"
158
+ config_data[ASSISTANT_ID_KEY] = (
159
+ f"{time.strftime(time_format)}-{randomname.get_name()}"
160
+ )
164
161
 
165
162
  write_yaml(data=config_data, target=config_file, should_preserve_key_order=True)
166
163
 
@@ -281,8 +278,15 @@ def validate_files(
281
278
  validator, max_history, fail_on_warnings
282
279
  )
283
280
  valid_flows = validator.verify_flows()
284
-
285
- all_good = valid_domain and valid_nlu and valid_stories and valid_flows
281
+ valid_CALM_slot_mappings = validator.validate_CALM_slot_mappings()
282
+
283
+ all_good = (
284
+ valid_domain
285
+ and valid_nlu
286
+ and valid_stories
287
+ and valid_flows
288
+ and valid_CALM_slot_mappings
289
+ )
286
290
 
287
291
  validator.warn_if_config_mandatory_keys_are_not_set()
288
292
 
@@ -302,6 +306,7 @@ def _validate_domain(validator: "Validator") -> bool:
302
306
  valid_form_slots = validator.verify_form_slots()
303
307
  valid_slot_mappings = validator.verify_slot_mappings()
304
308
  valid_responses = validator.check_for_no_empty_paranthesis_in_responses()
309
+ valid_buttons = validator.validate_button_payloads()
305
310
  return (
306
311
  valid_domain_validity
307
312
  and valid_actions_in_stories_rules
@@ -309,6 +314,7 @@ def _validate_domain(validator: "Validator") -> bool:
309
314
  and valid_form_slots
310
315
  and valid_slot_mappings
311
316
  and valid_responses
317
+ and valid_buttons
312
318
  )
313
319
 
314
320
 
@@ -451,3 +457,8 @@ def warn_if_rasa_plus_package_installed() -> None:
451
457
  f"for using Rasa Pro. Please uninstall it.",
452
458
  UserWarning,
453
459
  )
460
+
461
+
462
+ def check_if_studio_command() -> bool:
463
+ """Checks if the command is a Rasa Studio command."""
464
+ return len(sys.argv) >= 2 and sys.argv[1] == "studio"
rasa/cli/x.py CHANGED
@@ -166,8 +166,9 @@ async def _pull_runtime_config_from_server(
166
166
  attempts -= 1
167
167
 
168
168
  rasa.shared.utils.cli.print_error_and_exit(
169
- "Could not fetch runtime config from server at '{}'. "
170
- "Exiting.".format(config_endpoint)
169
+ "Could not fetch runtime config from server at '{}'. Exiting.".format(
170
+ config_endpoint
171
+ )
171
172
  )
172
173
 
173
174