rasa-pro 3.9.18__py3-none-any.whl → 3.10.16__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 (183) hide show
  1. README.md +0 -374
  2. rasa/__init__.py +1 -2
  3. rasa/__main__.py +5 -0
  4. rasa/anonymization/anonymization_rule_executor.py +2 -2
  5. rasa/api.py +27 -23
  6. rasa/cli/arguments/data.py +27 -2
  7. rasa/cli/arguments/default_arguments.py +25 -3
  8. rasa/cli/arguments/run.py +9 -9
  9. rasa/cli/arguments/train.py +11 -3
  10. rasa/cli/data.py +70 -8
  11. rasa/cli/e2e_test.py +104 -431
  12. rasa/cli/evaluate.py +1 -1
  13. rasa/cli/interactive.py +1 -0
  14. rasa/cli/llm_fine_tuning.py +398 -0
  15. rasa/cli/project_templates/calm/endpoints.yml +1 -1
  16. rasa/cli/project_templates/tutorial/endpoints.yml +1 -1
  17. rasa/cli/run.py +15 -14
  18. rasa/cli/scaffold.py +10 -8
  19. rasa/cli/studio/studio.py +35 -5
  20. rasa/cli/train.py +56 -8
  21. rasa/cli/utils.py +22 -5
  22. rasa/cli/x.py +1 -1
  23. rasa/constants.py +7 -1
  24. rasa/core/actions/action.py +98 -49
  25. rasa/core/actions/action_run_slot_rejections.py +4 -1
  26. rasa/core/actions/custom_action_executor.py +9 -6
  27. rasa/core/actions/direct_custom_actions_executor.py +80 -0
  28. rasa/core/actions/e2e_stub_custom_action_executor.py +68 -0
  29. rasa/core/actions/grpc_custom_action_executor.py +2 -2
  30. rasa/core/actions/http_custom_action_executor.py +6 -5
  31. rasa/core/agent.py +21 -17
  32. rasa/core/channels/__init__.py +2 -0
  33. rasa/core/channels/audiocodes.py +1 -16
  34. rasa/core/channels/voice_aware/__init__.py +0 -0
  35. rasa/core/channels/voice_aware/jambonz.py +103 -0
  36. rasa/core/channels/voice_aware/jambonz_protocol.py +344 -0
  37. rasa/core/channels/voice_aware/utils.py +20 -0
  38. rasa/core/channels/voice_native/__init__.py +0 -0
  39. rasa/core/constants.py +6 -1
  40. rasa/core/information_retrieval/faiss.py +7 -4
  41. rasa/core/information_retrieval/information_retrieval.py +8 -0
  42. rasa/core/information_retrieval/milvus.py +9 -2
  43. rasa/core/information_retrieval/qdrant.py +1 -1
  44. rasa/core/nlg/contextual_response_rephraser.py +32 -10
  45. rasa/core/nlg/summarize.py +4 -3
  46. rasa/core/policies/enterprise_search_policy.py +113 -45
  47. rasa/core/policies/flows/flow_executor.py +122 -76
  48. rasa/core/policies/intentless_policy.py +83 -29
  49. rasa/core/processor.py +72 -54
  50. rasa/core/run.py +5 -4
  51. rasa/core/tracker_store.py +8 -4
  52. rasa/core/training/interactive.py +1 -1
  53. rasa/core/utils.py +56 -57
  54. rasa/dialogue_understanding/coexistence/llm_based_router.py +53 -13
  55. rasa/dialogue_understanding/commands/__init__.py +6 -0
  56. rasa/dialogue_understanding/commands/restart_command.py +58 -0
  57. rasa/dialogue_understanding/commands/session_start_command.py +59 -0
  58. rasa/dialogue_understanding/commands/utils.py +40 -0
  59. rasa/dialogue_understanding/generator/constants.py +10 -3
  60. rasa/dialogue_understanding/generator/flow_retrieval.py +21 -5
  61. rasa/dialogue_understanding/generator/llm_based_command_generator.py +13 -3
  62. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +134 -90
  63. rasa/dialogue_understanding/generator/nlu_command_adapter.py +47 -7
  64. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +127 -41
  65. rasa/dialogue_understanding/patterns/restart.py +37 -0
  66. rasa/dialogue_understanding/patterns/session_start.py +37 -0
  67. rasa/dialogue_understanding/processor/command_processor.py +16 -3
  68. rasa/dialogue_understanding/processor/command_processor_component.py +6 -2
  69. rasa/e2e_test/aggregate_test_stats_calculator.py +134 -0
  70. rasa/e2e_test/assertions.py +1223 -0
  71. rasa/e2e_test/assertions_schema.yml +106 -0
  72. rasa/e2e_test/constants.py +20 -0
  73. rasa/e2e_test/e2e_config.py +220 -0
  74. rasa/e2e_test/e2e_config_schema.yml +26 -0
  75. rasa/e2e_test/e2e_test_case.py +131 -8
  76. rasa/e2e_test/e2e_test_converter.py +363 -0
  77. rasa/e2e_test/e2e_test_converter_prompt.jinja2 +70 -0
  78. rasa/e2e_test/e2e_test_coverage_report.py +364 -0
  79. rasa/e2e_test/e2e_test_result.py +26 -6
  80. rasa/e2e_test/e2e_test_runner.py +493 -71
  81. rasa/e2e_test/e2e_test_schema.yml +96 -0
  82. rasa/e2e_test/pykwalify_extensions.py +39 -0
  83. rasa/e2e_test/stub_custom_action.py +70 -0
  84. rasa/e2e_test/utils/__init__.py +0 -0
  85. rasa/e2e_test/utils/e2e_yaml_utils.py +55 -0
  86. rasa/e2e_test/utils/io.py +598 -0
  87. rasa/e2e_test/utils/validation.py +80 -0
  88. rasa/engine/graph.py +9 -3
  89. rasa/engine/recipes/default_components.py +0 -2
  90. rasa/engine/recipes/default_recipe.py +10 -2
  91. rasa/engine/storage/local_model_storage.py +40 -12
  92. rasa/engine/validation.py +78 -1
  93. rasa/env.py +9 -0
  94. rasa/graph_components/providers/story_graph_provider.py +59 -6
  95. rasa/llm_fine_tuning/__init__.py +0 -0
  96. rasa/llm_fine_tuning/annotation_module.py +241 -0
  97. rasa/llm_fine_tuning/conversations.py +144 -0
  98. rasa/llm_fine_tuning/llm_data_preparation_module.py +178 -0
  99. rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +407 -0
  100. rasa/llm_fine_tuning/paraphrasing/__init__.py +0 -0
  101. rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +281 -0
  102. rasa/llm_fine_tuning/paraphrasing/default_rephrase_prompt_template.jina2 +44 -0
  103. rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +121 -0
  104. rasa/llm_fine_tuning/paraphrasing/rephrased_user_message.py +10 -0
  105. rasa/llm_fine_tuning/paraphrasing_module.py +128 -0
  106. rasa/llm_fine_tuning/storage.py +174 -0
  107. rasa/llm_fine_tuning/train_test_split_module.py +441 -0
  108. rasa/model_training.py +56 -16
  109. rasa/nlu/persistor.py +157 -36
  110. rasa/server.py +45 -10
  111. rasa/shared/constants.py +76 -16
  112. rasa/shared/core/domain.py +27 -19
  113. rasa/shared/core/events.py +28 -2
  114. rasa/shared/core/flows/flow.py +208 -13
  115. rasa/shared/core/flows/flow_path.py +84 -0
  116. rasa/shared/core/flows/flows_list.py +33 -11
  117. rasa/shared/core/flows/flows_yaml_schema.json +269 -193
  118. rasa/shared/core/flows/validation.py +112 -25
  119. rasa/shared/core/flows/yaml_flows_io.py +149 -10
  120. rasa/shared/core/trackers.py +6 -0
  121. rasa/shared/core/training_data/structures.py +20 -0
  122. rasa/shared/core/training_data/visualization.html +2 -2
  123. rasa/shared/exceptions.py +4 -0
  124. rasa/shared/importers/importer.py +64 -16
  125. rasa/shared/nlu/constants.py +2 -0
  126. rasa/shared/providers/_configs/__init__.py +0 -0
  127. rasa/shared/providers/_configs/azure_openai_client_config.py +183 -0
  128. rasa/shared/providers/_configs/client_config.py +57 -0
  129. rasa/shared/providers/_configs/default_litellm_client_config.py +130 -0
  130. rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +234 -0
  131. rasa/shared/providers/_configs/openai_client_config.py +175 -0
  132. rasa/shared/providers/_configs/self_hosted_llm_client_config.py +176 -0
  133. rasa/shared/providers/_configs/utils.py +101 -0
  134. rasa/shared/providers/_ssl_verification_utils.py +124 -0
  135. rasa/shared/providers/embedding/__init__.py +0 -0
  136. rasa/shared/providers/embedding/_base_litellm_embedding_client.py +259 -0
  137. rasa/shared/providers/embedding/_langchain_embedding_client_adapter.py +74 -0
  138. rasa/shared/providers/embedding/azure_openai_embedding_client.py +277 -0
  139. rasa/shared/providers/embedding/default_litellm_embedding_client.py +102 -0
  140. rasa/shared/providers/embedding/embedding_client.py +90 -0
  141. rasa/shared/providers/embedding/embedding_response.py +41 -0
  142. rasa/shared/providers/embedding/huggingface_local_embedding_client.py +191 -0
  143. rasa/shared/providers/embedding/openai_embedding_client.py +172 -0
  144. rasa/shared/providers/llm/__init__.py +0 -0
  145. rasa/shared/providers/llm/_base_litellm_client.py +251 -0
  146. rasa/shared/providers/llm/azure_openai_llm_client.py +338 -0
  147. rasa/shared/providers/llm/default_litellm_llm_client.py +84 -0
  148. rasa/shared/providers/llm/llm_client.py +76 -0
  149. rasa/shared/providers/llm/llm_response.py +50 -0
  150. rasa/shared/providers/llm/openai_llm_client.py +155 -0
  151. rasa/shared/providers/llm/self_hosted_llm_client.py +293 -0
  152. rasa/shared/providers/mappings.py +75 -0
  153. rasa/shared/utils/cli.py +30 -0
  154. rasa/shared/utils/io.py +65 -2
  155. rasa/shared/utils/llm.py +246 -200
  156. rasa/shared/utils/yaml.py +121 -15
  157. rasa/studio/auth.py +6 -4
  158. rasa/studio/config.py +13 -4
  159. rasa/studio/constants.py +1 -0
  160. rasa/studio/data_handler.py +10 -3
  161. rasa/studio/download.py +19 -13
  162. rasa/studio/train.py +2 -3
  163. rasa/studio/upload.py +19 -11
  164. rasa/telemetry.py +113 -58
  165. rasa/tracing/instrumentation/attribute_extractors.py +32 -17
  166. rasa/utils/common.py +18 -19
  167. rasa/utils/endpoints.py +7 -4
  168. rasa/utils/json_utils.py +60 -0
  169. rasa/utils/licensing.py +9 -1
  170. rasa/utils/ml_utils.py +4 -2
  171. rasa/validator.py +213 -3
  172. rasa/version.py +1 -1
  173. rasa_pro-3.10.16.dist-info/METADATA +196 -0
  174. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/RECORD +179 -113
  175. rasa/nlu/classifiers/llm_intent_classifier.py +0 -519
  176. rasa/shared/providers/openai/clients.py +0 -43
  177. rasa/shared/providers/openai/session_handler.py +0 -110
  178. rasa_pro-3.9.18.dist-info/METADATA +0 -563
  179. /rasa/{shared/providers/openai → cli/project_templates/tutorial/actions}/__init__.py +0 -0
  180. /rasa/cli/project_templates/tutorial/{actions.py → actions/actions.py} +0 -0
  181. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/NOTICE +0 -0
  182. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/WHEEL +0 -0
  183. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/entry_points.txt +0 -0
README.md CHANGED
@@ -38,378 +38,4 @@ Check out our
38
38
  - [Rasa Pro / CALM tutorial](https://rasa.com/docs/rasa-pro/tutorial), and
39
39
  - [Rasa pro changelog](https://rasa.com/docs/rasa/rasa-pro-changelog/)
40
40
 
41
- <<<<<<< HEAD
42
- ### Managing environments
43
-
44
- The official [Poetry guide](https://python-poetry.org/docs/managing-environments/) suggests to use
45
- [pyenv](https://github.com/pyenv/pyenv) or any other similar tool to easily switch between Python versions.
46
- This is how it can be done:
47
-
48
- ```bash
49
- pyenv install 3.10.10
50
- pyenv local 3.10.10 # Activate Python 3.10.10 for the current project
51
- ```
52
- *Note*: If you have trouble installing a specific version of python on your system
53
- it might be worth trying other supported versions.
54
-
55
- By default, Poetry will try to use the currently activated Python version to create the virtual environment
56
- for the current project automatically. You can also create and activate a virtual environment manually — in this
57
- case, Poetry should pick it up and use it to install the dependencies. For example:
58
-
59
- ```bash
60
- python -m venv .venv
61
- source .venv/bin/activate
62
- ```
63
-
64
- You can make sure that the environment is picked up by executing
65
-
66
- ```bash
67
- poetry env info
68
- ```
69
-
70
- ### Building from source
71
-
72
- To install dependencies and `rasa` itself in editable mode execute
73
-
74
- ```bash
75
- make install
76
- ```
77
-
78
- *Note for macOS users*: under macOS Big Sur we've seen some compiler issues for
79
- dependencies. Using `export SYSTEM_VERSION_COMPAT=1` before the installation helped.
80
-
81
-
82
- #### Installing optional dependencies
83
-
84
- In order to install rasa's optional dependencies, you need to run:
85
-
86
- ```bash
87
- make install-full
88
- ```
89
-
90
- *Note for macOS users*: The command `make install-full` could result in a failure while installing `tokenizers`
91
- (issue described in depth [here](https://github.com/huggingface/tokenizers/issues/1050)).
92
-
93
- In order to resolve it, you must follow these steps to install a Rust compiler:
94
- ```bash
95
- brew install rustup
96
- rustup-init
97
- ```
98
-
99
- After initialising the Rust compiler, you should restart the console and check its installation:
100
- ```bash
101
- rustc --version
102
- ```
103
-
104
- In case the PATH variable had not been automatically setup, run:
105
- ```bash
106
- export PATH="$HOME/.cargo/bin:$PATH"
107
- ```
108
-
109
- #### Installing from published Python package
110
-
111
- We have a private package registry running at **europe-west3-docker.pkg.dev/rasa-releases/** which hosts python packages as well
112
- as docker containers. To use it, you need to be authenticated.
113
- Follow the steps in the [google documentation](https://cloud.google.com/artifact-registry/docs/python/authentication#keyring)
114
- to make sure `pip` has the necessary credentials to authenticate with the registry.
115
- Afterwards, you should be able to run `pip install rasa`.
116
-
117
- To be able to pull the docker image via `docker pull europe-west3-docker.pkg.dev/rasa-releases/rasa/rasa`,
118
- you’ll need to authenticate using the `gcloud auth` command: `gcloud auth configure-docker europe-west3-docker.pkg.dev`.
119
-
120
- More information is available in our [public documentation](https://rasa.com/docs/rasa-pro/installation/python/installation).
121
-
122
- ### Running the Tests
123
-
124
- In order to run the tests, make sure that you have set locally the environment variable `RASA_PRO_LICENSE` to a valid license available in 1Password.
125
- You should ensure to install the development requirements:
126
-
127
- ```bash
128
- make prepare-tests-ubuntu # Only on Ubuntu and Debian based systems
129
- make prepare-tests-macos # Only on macOS
130
- ```
131
-
132
- Then, run the tests:
133
-
134
- ```bash
135
- make test
136
- ```
137
-
138
- They can also be run at multiple jobs to save some time:
139
-
140
- ```bash
141
- JOBS=[n] make test
142
- ```
143
-
144
- Where `[n]` is the number of jobs desired. If omitted, `[n]` will be automatically chosen by pytest.
145
-
146
-
147
- ### Running the Integration Tests
148
-
149
- In order to run the integration tests, make sure that you have the development requirements installed:
150
-
151
- ```bash
152
- make prepare-tests-ubuntu # Only on Ubuntu and Debian based systems
153
- make prepare-tests-macos # Only on macOS
154
- ```
155
-
156
- Then, you'll need to start services with the following command which uses
157
- [Docker Compose](https://docs.docker.com/compose/install/):
158
-
159
- ```bash
160
- make run-integration-containers
161
- ```
162
-
163
- Finally, you can run the integration tests like this:
164
-
165
- ```bash
166
- make test-integration
167
- ```
168
-
169
- In order to run locally the integration tests for the tracing capability, you must first build the rasa image locally.
170
- You can do so using the `docker buildx bake` command.
171
- Note that the rasa image build requires a few base images, which must be built prior to building the rasa image.
172
- The Dockerfiles for these base images are located in the `docker` subdirectory.
173
-
174
- You must also set the following environment variables to build the rasa image locally:
175
- - `TARGET_IMAGE_REGISTRY`, e.g. you can either use `rasa` or the private registry `europe-west3-docker.pkg.dev/rasa-releases/rasa-docker`.
176
- - `IMAGE_TAG`, e.g. `localdev`, `latest` or PR ID.
177
- - `BASE_IMAGE_HASH`, e.g. `localdev`
178
- - `BASE_MITIE_IMAGE_HASH`, e.g. `localdev`
179
- - `BASE_BUILDER_IMAGE_HASH`, e.g. `localdev`
180
-
181
-
182
- ### Resolving merge conflicts
183
-
184
- Poetry doesn't include any solution that can help to resolve merge conflicts in
185
- the lock file `poetry.lock` by default.
186
- However, there is a great tool called [poetry-merge-lock](https://poetry-merge-lock.readthedocs.io/en/latest/).
187
- Here is how you can install it:
188
-
189
- ```bash
190
- pip install poetry-merge-lock
191
- ```
192
-
193
- Just execute this command to resolve merge conflicts in `poetry.lock` automatically:
194
-
195
- ```bash
196
- poetry-merge-lock
197
- ```
198
-
199
- ### Build a Docker image locally
200
-
201
- In order to build a Docker image on your local machine execute the following command:
202
-
203
- ```bash
204
- make build-docker
205
- ```
206
-
207
- The Docker image is available on your local machine as `rasa-private-dev`.
208
-
209
- ### Code Style
210
-
211
- To ensure a standardized code style we use the [ruff](https://docs.astral.sh/ruff/formatter/) formatter.
212
- To ensure our type annotations are correct we use the type checker [mypy](https://mypy.readthedocs.io/en/stable/).
213
- If your code is not formatted properly or doesn't type check, GitHub will fail to build.
214
-
215
- #### Formatting
216
-
217
- If you want to automatically format your code on every commit, you can use [pre-commit](https://pre-commit.com/).
218
- Just install it via `pip install pre-commit` and execute `pre-commit install` in the root folder.
219
- This will add a hook to the repository, which reformats files on every commit.
220
-
221
- If you want to set it up manually, install `ruff` via `poetry install`.
222
- To reformat files execute
223
- ```
224
- make formatter
225
- ```
226
-
227
- #### Type Checking
228
-
229
- If you want to check types on the codebase, install `mypy` using `poetry install`.
230
- To check the types execute
231
- ```
232
- make types
233
- ```
234
-
235
- ### Backporting
236
-
237
- In order to port changes to `main` and across release branches, we use the `backport` workflow located at
238
- the `.github/workflows/backport.yml` path.
239
- This workflow is triggered by the `backport-to-<release-branch>` label applied to a PR, for example `backport-to-3.8.x`.
240
- Current available target branches are `main` and maintained release branches.
241
-
242
- When a PR gets labelled `backport-to-<release-branch>`, a PR is opened by the `backport-github-action` as soon as the
243
- source PR gets closed (by merging). If you want to close the PR without merging changes, make sure to remove the `backport-to-<release-branch>` label.
244
-
245
- The PR author which the action assigns to the backporting PR has to resolve any conflicts before approving and merging.
246
- Release PRs should also be labelled with `backport-to-main` to backport the `CHANGELOG.md` updates to `main`.
247
- Backporting version updates should be accepted to the `main` branch from the latest release branch only.
248
-
249
- Here are some guidelines to follow when backporting changes and resolving conflicts:
250
-
251
- a) for conflicts in `version.py`: accept only the version from the latest release branch. Do not merge version changes
252
- from earlier release branches into `main` because this could cause issues when trying to make the next minor release.
253
-
254
- b) for conflicts in `pyproject.toml`: if related to the `rasa-pro` version, accept only the latest release branch;
255
- if related to other dependencies, accept `main` or whichever is the higher upgrade (main usually has the updated
256
- dependencies because we only do housekeeping on `main`, apart from vulnerability updates). Be mindful of dependencies that
257
- are removed from `main` but still exist in former release branches (for example `langchain`).
258
-
259
- c) for conflicts in `poetry.lock`: accept changes which were already present on the target branch, then run
260
- `poetry lock --no-update` so that the lock file contains your changes from `pyproject.toml` too.
261
-
262
- d) for conflicts in `CHANGELOG.md`: Manually place the changelog in their allocated section (e.g. 3.8.10 will go under the
263
- 3.8 section with the other releases, rather than go at the top of the file)
264
-
265
- If the backporting workflow fails, you are encouraged to cherry-pick the commits manually and create a PR to
266
- the target branch. Alternatively, you can install the backporting CLI tool as described [here](https://github.com/sorenlouv/backport?tab=readme-ov-file#install).
267
-
268
- ## Releases
269
- Rasa has implemented robust policies governing version naming, as well as release pace for major, minor, and patch releases.
270
-
271
- The values for a given version number (MAJOR.MINOR.PATCH) are incremented as follows:
272
- - MAJOR version for incompatible API changes or other breaking changes.
273
- - MINOR version for functionality added in a backward compatible manner.
274
- - PATCH version for backward compatible bug fixes.
275
-
276
- The following table describes the version types and their expected *release cadence*:
277
-
278
- | Version Type | Description | Target Cadence |
279
- |--------------|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
280
- | Major | For significant changes, or when any backward-incompatible changes are introduced to the API or data model. | Every 1 - 2 yrs |
281
- | Minor | For when new backward-compatible functionality is introduced, a minor feature is introduced, or when a set of smaller features is rolled out. | +/- Quarterly |
282
- | Patch | For backward-compatible bug fixes that fix incorrect behavior. | As needed |
283
-
284
- While this table represents our target release frequency, we reserve the right to modify it based on changing market conditions and technical requirements.
285
-
286
- ### Maintenance Policy
287
- Our End of Life policy defines how long a given release is considered supported, as well as how long a release is
288
- considered to be still in active development or maintenance.
289
-
290
- The maintenance duration and end of life for every release are shown on our website as part of the [Product Release and Maintenance Policy](https://rasa.com/rasa-product-release-and-maintenance-policy/).
291
-
292
- ### Cutting a Major / Minor release
293
- #### A week before release day
294
-
295
- **Post a message on the engineering Slack channel**, letting the team know you'll be the one cutting the upcoming
296
- release, as well as:
297
- 1. Reminding everyone to go over their issues and PRs and prioritise reviews and merges
298
- 2. Reminding everyone of the scheduled date for the release
299
-
300
- #### A day before release day
301
-
302
- 1. **Evaluate the status of any PR merging that's happening. Follow up with people on their
303
- bugs and fixes.** If the release introduces new bugs or regressions that can't be fixed in time, we should discuss on
304
- Slack about this and take a decision on how to move forward. If the issue is not ready to be merged in time, we remove the issue / PR from the release and notify the PR owner and the product manager on Slack about it. The PR / issue owners are responsible for
305
- communicating any issues which might be release relevant. Postponing the release should be considered as an edge case scenario.
306
-
307
- #### Release day! 🚀
308
-
309
- 1. **At the start of the day, post a small message on slack announcing release day!** Communicate you'll be handling
310
- the release, and the time you're aiming to start releasing (again, no later than 4pm, as issues may arise and
311
- cause delays). This message should be posted early in the morning and before moving forward with any of the steps of the release,
312
- in order to give enough time to people to check their PRs and issues. That way they can plan any remaining work. A template of the slack message can be found [here](https://rasa-hq.slack.com/archives/C36SS4N8M/p1613032208137500?thread_ts=1612876410.068400&cid=C36SS4N8M).
313
- The release time should be communicated transparently so that others can plan potentially necessary steps accordingly. If there are bigger changes this should be communicated.
314
- 2. Once everything in the release is taken care of, post a small message on Slack communicating you are about to
315
- start the release process (in case anything is missing).
316
- 3. **You may now do the release by following the instructions outlined in the
317
- [Rasa Pro README](#steps-to-release-a-new-version) !**
318
-
319
- ### Steps to release a new version
320
- Releasing a new version is quite simple, as the packages are build and distributed by GitHub Actions.
321
-
322
- *Release steps*:
323
- 1. Make sure all dependencies are up to date (**especially Rasa SDK**)
324
- - For Rasa SDK, except in the case of a patch release, that means first creating a [new Rasa SDK release](https://github.com/RasaHQ/rasa-sdk#steps-to-release-a-new-version) (make sure the version numbers between the new Rasa and Rasa SDK releases match)
325
- - Once the tag with the new Rasa SDK release is pushed and the package appears on [pypi](https://pypi.org/project/rasa-sdk/), the dependency in the rasa repository can be resolved (see below).
326
- 2. If this is a minor / major release: Make sure all fixes from currently supported minor versions have been merged from their respective release branches (e.g. 3.8.x) back into main.
327
- 3. In case of a minor release, create a new branch that corresponds to the new release, e.g.
328
- ```bash
329
- git checkout -b 3.8.x
330
- git push origin 3.8.x
331
- ```
332
- 4. Switch to the branch you want to cut the release from (`main` in case of a major, the `<major>.<minor>.x` branch for minors and patches)
333
- - Update the `rasa-sdk` entry in `pyproject.toml` with the new release version and run `poetry update`. This creates a new `poetry.lock` file with all dependencies resolved.
334
- - Commit the changes with `git commit -am "bump rasa-sdk dependency"` but do not push them. They will be automatically picked up by the following step.
335
- 5. Run `make release`
336
- 6. Create a PR against the release branch (e.g. `3.8.x`)
337
- 7. Once your PR is merged, [this](https://github.com/RasaHQ/rasa-private/actions/workflows/tag-release.yml) workflow runs and an automatic tag is created and pushed to remote.
338
- (If this fails for some reason, then run the following manually on the release branch) :
339
- ```bash
340
- git checkout 3.8.x
341
- git pull origin 3.8.x
342
- git tag 3.8.0 -m "next release"
343
- git push origin 3.8.0 --tags
344
- ```
345
- GitHub will build this tag and publish the build artifacts.
346
- 8. After all the steps are completed and if everything goes well then we should see a message automatically posted in the company's Slack (`release` channel) like this [one](https://rasa-hq.slack.com/archives/C7B08Q5FX/p1614354499046600)
347
- 9. If however an error occurs in the build, then we should see a failure message automatically posted in the company's Slack (`dev-tribe` channel) like this [one](https://rasa-hq.slack.com/archives/C01M5TAHDHA/p1701444735622919)
348
- (In this case do the following checks):
349
- - Check the workflows in [Github Actions](https://github.com/RasaHQ/rasa-private/actions) and make sure that the merged PR of the current release is completed successfully. To easily find your PR you can use the filters `event: push` and `branch: <version number>` (example on release 2.4 you can see [here](https://github.com/RasaHQ/rasa/actions/runs/643344876))
350
- - If the workflow is not completed, then try to re-run the workflow in case that solves the problem
351
- - If the problem persists, check also the log files and try to find the root cause of the issue
352
- - If you still cannot resolve the error, contact the infrastructure team by providing any helpful information from your investigation
353
- 10. If the release is successful, add the newly created release branch to the backporting configuration in the `.backportrc.json` file to
354
- the `targetBranchesChoices` list. This is necessary for the backporting workflow to work correctly with new release branches.
355
-
356
-
357
- ### Cutting a Patch release
358
-
359
- Patch releases are simpler to cut, since they are meant to contain only bugfixes.
360
-
361
- **The only things you need to do to cut a patch release are:**
362
-
363
- 1. Notify the engineering team on Slack that you are planning to cut a patch, in case someone has an important fix
364
- to add.
365
- 2. Make sure the bugfix(es) are in the release branch you will use (p.e if you are cutting a `3.8.2` patch, you will
366
- need your fixes to be on the `3.8.x` release branch). All patch releases must come from a `.x` branch!
367
- 3. Once you're ready to release the Rasa Pro patch, checkout the branch, run `make release` and follow the
368
- steps + get the PR merged.
369
- 4. Once the PR is in, wait for the [tag release workflow](https://github.com/RasaHQ/rasa-private/actions/workflows/tag-release.yml) to create the tag.
370
- (If this fails for some reason, then run the following manually on the release branch) :
371
- ```bash
372
- git checkout 3.8.x
373
- git pull origin 3.8.x
374
- git tag 3.8.0 -m "next release"
375
- git push origin 3.8.0 --tags
376
- ```
377
- 5. After this you should see the CI workflow "Continuous Integration" in the Actions tab with the relevant tag name. Keep an eye on it to make sure it is successful as sometimes retries might be required.
378
- 6. After all the steps are completed and if everything goes well then we should see a message automatically posted in the company's Slack (`release` channel) like this [one](https://rasa-hq.slack.com/archives/C7B08Q5FX/p1614354499046600)
379
- 7. If however an error occurs in the build, then we should see a failure message automatically posted in the company's Slack (`dev-tribe` channel) like this [one](https://rasa-hq.slack.com/archives/C01M5TAHDHA/p1701444735622919)
380
-
381
- Make sure to merge the branch `3.7.x` after your PR with `main`. This needs to be done manually until Roberto is added (see [ATO-2091](https://rasahq.atlassian.net/browse/ATO-2091))
382
-
383
- ### Cutting a Pre release version
384
-
385
- A Pre release version is an alpha, beta, dev or rc version. For more details on which version you require refer to the [Rasa Software Release Lifecycle](https://www.notion.so/rasa/Rasa-Software-Release-Lifecycle-eb704d75f87646a9a9aca1f3fbe71fb3#6e26ac9a15b64f91bb94d6bfea9306a0)
386
-
387
- 1. Make sure you are using the right branch for the release, for instance pre releases are always made from either the main or a feature branch (especially for a dev release)
388
- 2. Once you're ready to release, checkout the branch, run `make release` and follow the
389
- steps.
390
- 3. Only in case of a pre release, the release branch created will be prefixed with 'prepare-release-pre-'
391
- 4. Note that when releasing from a feature branch the 'prepare-release-pre' branch will not be created automatically and has to be done manually. This is done to ensure all major/minor/patch releases only happens from the correct branches.
392
- (In this case the version updates will be added to the same branch as a commit, and you will have to manually create a `prepare-release-pre-' branch and push to remote)
393
- 5. Only in case of a pre release, we currently skip all test runs and docker image builds on a 'prepare-release-pre-' PR. This was done to speed up the pre release process.
394
- 6. Once your PR gets merged, the [tag release workflow](https://github.com/RasaHQ/rasa-private/actions/workflows/tag-release.yml) will create the tag.
395
- 7. After this you should see the CI workflow "Continuous Integration" in the Actions tab with the relevant tag name. Keep an eye on it to make sure it is successful as sometimes retries might be required.
396
- 8. After all the steps are completed and if everything goes well then we should see a message automatically posted in the company's Slack (`release` channel) like this [one](https://rasa-hq.slack.com/archives/C7B08Q5FX/p1614354499046600)
397
- 9. If however an error occurs in the build, then we should see a failure message automatically posted in the company's Slack (`dev-tribe` channel) like this [one](https://rasa-hq.slack.com/archives/C01M5TAHDHA/p1701444735622919)
398
-
399
-
400
- ### Actively maintained versions
401
-
402
- Please refer to the [Rasa Product Release and Maintenance Policy](https://rasa.com/rasa-product-release-and-maintenance-policy/) page.
403
-
404
- ## Troubleshooting
405
-
406
- - When running docker commands, if you encounter this error: `OSError No space left on device`, consider running:
407
-
408
- ```shell
409
- docker system prune --all
410
- ```
411
-
412
- For more information on this command, please see the [Official Docker Documentation](https://docs.docker.com/engine/reference/commandline/system_prune/).
413
- =======
414
41
  for more. Also feel free to reach out to us on the [Rasa forum](https://forum.rasa.com/).
415
- >>>>>>> 2c5cd7bc639 (update readme.md from main branch on 3.10.x (#1597))
rasa/__init__.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import logging
2
2
 
3
- from rasa import version, plugin # noqa: F401
4
- from rasa.api import run, train, test # noqa: F401
3
+ from rasa import version
5
4
 
6
5
  # define the version before the other imports since these need it
7
6
  __version__ = version.__version__
rasa/__main__.py CHANGED
@@ -25,6 +25,7 @@ from rasa.cli import (
25
25
  visualize,
26
26
  x,
27
27
  evaluate,
28
+ llm_fine_tuning,
28
29
  )
29
30
  from rasa.cli.arguments.default_arguments import add_logging_options
30
31
  from rasa.cli.utils import (
@@ -76,6 +77,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
76
77
  export.add_subparser(subparsers, parents=parent_parsers)
77
78
  x.add_subparser(subparsers, parents=parent_parsers)
78
79
  evaluate.add_subparser(subparsers, parents=parent_parsers)
80
+ llm_fine_tuning.add_subparser(subparsers, parent_parsers)
79
81
  plugin_manager().hook.refine_cli(
80
82
  subparsers=subparsers, parent_parsers=parent_parsers
81
83
  )
@@ -85,12 +87,15 @@ def create_argument_parser() -> argparse.ArgumentParser:
85
87
 
86
88
  def print_version() -> None:
87
89
  """Prints version information of rasa tooling and python."""
90
+ from rasa.utils.licensing import get_license_expiration_date
91
+
88
92
  print(f"Rasa Version : {version.__version__}")
89
93
  print(f"Minimum Compatible Version: {MINIMUM_COMPATIBLE_VERSION}")
90
94
  print(f"Rasa SDK Version : {rasa_sdk_version}")
91
95
  print(f"Python Version : {platform.python_version()}")
92
96
  print(f"Operating System : {platform.platform()}")
93
97
  print(f"Python Path : {sys.executable}")
98
+ print(f"License Expires : {get_license_expiration_date()}")
94
99
 
95
100
 
96
101
  def main() -> None:
@@ -123,7 +123,7 @@ class AnonymizationRuleExecutor:
123
123
  else None
124
124
  )
125
125
 
126
- self.anonymizer_engine = AnonymizerEngine()
126
+ self.anonymizer_engine = AnonymizerEngine() # type: ignore
127
127
 
128
128
  @staticmethod
129
129
  def _validate_anonymization_rule_list(
@@ -146,7 +146,7 @@ class AnonymizationRuleExecutor:
146
146
 
147
147
  return True
148
148
 
149
- def run(self, text: Text) -> Text:
149
+ def run(self, text: Text) -> Optional[Text]:
150
150
  """Anonymizes the given text using the given anonymization rule list."""
151
151
  if (
152
152
  self.analyzer is None
rasa/api.py CHANGED
@@ -1,6 +1,8 @@
1
- from typing import Any, Text, Dict, Union, List, Optional, TYPE_CHECKING
2
1
  import asyncio
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Text, Union
3
+
3
4
  import rasa.shared.constants
5
+ from rasa.nlu.persistor import StorageType
4
6
 
5
7
  # WARNING: Be careful about adding any top level imports at this place!
6
8
  # These functions are imported in `rasa.__init__` and any top level import
@@ -15,11 +17,11 @@ if TYPE_CHECKING:
15
17
 
16
18
 
17
19
  def run(
18
- model: "Text",
19
- endpoints: "Text",
20
- connector: "Optional[Text]" = None,
21
- credentials: "Optional[Text]" = None,
22
- **kwargs: "Dict[Text, Any]",
20
+ model: Text,
21
+ endpoints: Text,
22
+ connector: Optional[Text] = None,
23
+ credentials: Optional[Text] = None,
24
+ **kwargs: Dict[Text, Any],
23
25
  ) -> None:
24
26
  """Runs a Rasa model.
25
27
 
@@ -34,12 +36,12 @@ def run(
34
36
 
35
37
  """
36
38
  import rasa.core.run
37
- from rasa.core.utils import AvailableEndpoints
38
- from rasa.shared.utils.cli import print_warning
39
39
  import rasa.shared.utils.common
40
+ from rasa.core.utils import AvailableEndpoints
40
41
  from rasa.shared.constants import DOCS_BASE_URL
42
+ from rasa.shared.utils.cli import print_warning
41
43
 
42
- _endpoints = AvailableEndpoints.read_endpoints(endpoints)
44
+ _endpoints = AvailableEndpoints.get_instance(endpoints)
43
45
 
44
46
  if not connector and not credentials:
45
47
  connector = "rest"
@@ -63,18 +65,19 @@ def run(
63
65
 
64
66
 
65
67
  def train(
66
- domain: "Text",
67
- config: "Text",
68
+ domain: Text,
69
+ config: Text,
68
70
  training_files: "Union[Text, List[Text]]",
69
- output: "Text" = rasa.shared.constants.DEFAULT_MODELS_PATH,
71
+ output: Text = rasa.shared.constants.DEFAULT_MODELS_PATH,
70
72
  dry_run: bool = False,
71
73
  force_training: bool = False,
72
- fixed_model_name: "Optional[Text]" = None,
74
+ fixed_model_name: Optional[Text] = None,
73
75
  persist_nlu_training_data: bool = False,
74
- core_additional_arguments: "Optional[Dict]" = None,
75
- nlu_additional_arguments: "Optional[Dict]" = None,
76
- model_to_finetune: "Optional[Text]" = None,
76
+ core_additional_arguments: Optional[Dict] = None,
77
+ nlu_additional_arguments: Optional[Dict] = None,
78
+ model_to_finetune: Optional[Text] = None,
77
79
  finetuning_epoch_fraction: float = 1.0,
80
+ remote_storage: Optional[StorageType] = None,
78
81
  ) -> "TrainingResult":
79
82
  """Runs Rasa Core and NLU training in `async` loop.
80
83
 
@@ -96,6 +99,7 @@ def train(
96
99
  a directory in case the latest trained model should be used.
97
100
  finetuning_epoch_fraction: The fraction currently specified training epochs
98
101
  in the model configuration which should be used for finetuning.
102
+ remote_storage: Remote storage to use for model storage.
99
103
 
100
104
  Returns:
101
105
  An instance of `TrainingResult`.
@@ -116,16 +120,17 @@ def train(
116
120
  nlu_additional_arguments=nlu_additional_arguments,
117
121
  model_to_finetune=model_to_finetune,
118
122
  finetuning_epoch_fraction=finetuning_epoch_fraction,
123
+ remote_storage=remote_storage,
119
124
  )
120
125
  )
121
126
 
122
127
 
123
128
  def test(
124
- model: "Text",
125
- stories: "Text",
126
- nlu_data: "Text",
127
- output: "Text" = rasa.shared.constants.DEFAULT_RESULTS_PATH,
128
- additional_arguments: "Optional[Dict]" = None,
129
+ model: Text,
130
+ stories: Text,
131
+ nlu_data: Text,
132
+ output: Text = rasa.shared.constants.DEFAULT_RESULTS_PATH,
133
+ additional_arguments: Optional[Dict] = None,
129
134
  ) -> None:
130
135
  """Test a Rasa model against a set of test data.
131
136
 
@@ -136,8 +141,7 @@ def test(
136
141
  output: path to folder where all output will be stored
137
142
  additional_arguments: additional arguments for the test call
138
143
  """
139
- from rasa.model_testing import test_core
140
- from rasa.model_testing import test_nlu
144
+ from rasa.model_testing import test_core, test_nlu
141
145
 
142
146
  if additional_arguments is None:
143
147
  additional_arguments = {}
@@ -10,8 +10,8 @@ from rasa.cli.arguments.default_arguments import (
10
10
  from rasa.shared.constants import DEFAULT_CONVERTED_DATA_PATH
11
11
 
12
12
 
13
- def set_convert_arguments(parser: argparse.ArgumentParser, data_type: Text) -> None:
14
- """Sets convert command arguments."""
13
+ def set_convert_nlu_arguments(parser: argparse.ArgumentParser, data_type: Text) -> None:
14
+ """Sets convert nlu command arguments."""
15
15
  parser.add_argument(
16
16
  "-f",
17
17
  "--format",
@@ -32,6 +32,31 @@ def set_convert_arguments(parser: argparse.ArgumentParser, data_type: Text) -> N
32
32
  parser.add_argument("-l", "--language", default="en", help="Language of data.")
33
33
 
34
34
 
35
+ def set_convert_e2e_arguments(parser: argparse.ArgumentParser) -> None:
36
+ """Sets convert e2e command arguments.
37
+
38
+ Args:
39
+ parser: Parser we are going to attach arguments to.
40
+ """
41
+ parser.add_argument(
42
+ "path",
43
+ type=str,
44
+ help="Path to the input CSV or XLS/XLSX file.",
45
+ )
46
+ parser.add_argument(
47
+ "-o",
48
+ "--output",
49
+ type=str,
50
+ default="e2e_tests",
51
+ help="Output directory to store the tests.",
52
+ )
53
+ parser.add_argument(
54
+ "--sheet-name",
55
+ type=str,
56
+ help="Worksheet name containing relevant data. Mandatory for Excel file input.",
57
+ )
58
+
59
+
35
60
  def set_split_arguments(parser: argparse.ArgumentParser) -> None:
36
61
  add_nlu_data_param(parser, help_text="File or folder containing your NLU data.")
37
62
 
@@ -1,13 +1,14 @@
1
1
  import argparse
2
2
  import logging
3
- from typing import Text, Union, Optional
3
+ from typing import Optional, Text, Union
4
4
 
5
+ from rasa.nlu.persistor import RemoteStorageType, StorageType, parse_remote_storage
5
6
  from rasa.shared.constants import (
6
7
  DEFAULT_CONFIG_PATH,
7
- DEFAULT_DOMAIN_PATH,
8
- DEFAULT_MODELS_PATH,
9
8
  DEFAULT_DATA_PATH,
9
+ DEFAULT_DOMAIN_PATH,
10
10
  DEFAULT_ENDPOINTS_PATH,
11
+ DEFAULT_MODELS_PATH,
11
12
  )
12
13
 
13
14
 
@@ -163,3 +164,24 @@ def add_logging_options(parser: argparse.ArgumentParser) -> None:
163
164
  help="If set, the name of the logging configuration file will be set "
164
165
  "to the given name.",
165
166
  )
167
+
168
+
169
+ def add_remote_storage_param(
170
+ parser: Union[argparse.ArgumentParser, argparse._ActionsContainer],
171
+ required: bool = False,
172
+ ) -> None:
173
+ parser.add_argument(
174
+ "--remote-storage",
175
+ help="Remote storage which should be used to store/load the model."
176
+ f"Supported storages are: {RemoteStorageType.list()}. "
177
+ "You can also provide your own implementation of the `Persistor` interface.",
178
+ required=required,
179
+ type=parse_remote_storage_arg,
180
+ )
181
+
182
+
183
+ def parse_remote_storage_arg(value: str) -> StorageType:
184
+ try:
185
+ return parse_remote_storage(value)
186
+ except ValueError as e:
187
+ raise argparse.ArgumentTypeError(str(e))
rasa/cli/arguments/run.py CHANGED
@@ -1,16 +1,19 @@
1
- import os
2
-
3
1
  import argparse
2
+ import os
4
3
  from typing import Union
5
4
 
6
- from rasa.cli.arguments.default_arguments import add_model_param, add_endpoint_param
5
+ from rasa.cli.arguments.default_arguments import (
6
+ add_endpoint_param,
7
+ add_model_param,
8
+ add_remote_storage_param,
9
+ )
7
10
  from rasa.core import constants
8
11
  from rasa.env import (
12
+ AUTH_TOKEN_ENV,
9
13
  DEFAULT_JWT_METHOD,
10
14
  JWT_METHOD_ENV,
11
- JWT_SECRET_ENV,
12
15
  JWT_PRIVATE_KEY_ENV,
13
- AUTH_TOKEN_ENV,
16
+ JWT_SECRET_ENV,
14
17
  )
15
18
 
16
19
 
@@ -136,10 +139,7 @@ def add_server_settings_arguments(parser: argparse.ArgumentParser) -> None:
136
139
  type=int,
137
140
  help="Maximum time a request can take to process (sec).",
138
141
  )
139
- server_arguments.add_argument(
140
- "--remote-storage",
141
- help="Set the remote location where your Rasa model is stored, e.g. on AWS.",
142
- )
142
+ add_remote_storage_param(server_arguments)
143
143
  server_arguments.add_argument(
144
144
  "--ssl-certificate",
145
145
  help="Set the SSL Certificate to create a TLS secured server.",