From 27f0baada155c12e7ca122735f851d8a7a945dec Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Thu, 14 Sep 2023 23:08:04 +0200 Subject: [PATCH 1/5] changed license temporarily --- LICENSE.txt | 201 ------------------------------------------------- README.md | 3 +- poetry.lock | 4 +- pyproject.toml | 3 +- 4 files changed, 3 insertions(+), 208 deletions(-) delete mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 0975a64b87b9..000000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2022 Rasa Technologies GmbH - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md index 83ee79501a4e..832b6527b00f 100644 --- a/README.md +++ b/README.md @@ -443,8 +443,7 @@ thus validating compatibility between Rasa and Rasa X/Enterprise. Please refer to the [Rasa Product Release and Maintenance Policy](https://rasa.com/rasa-product-release-and-maintenance-policy/) page. ## License -Licensed under the Apache License, Version 2.0. -Copyright 2022 Rasa Technologies GmbH. [Copy of the license](LICENSE.txt). +Copyright 2022 Rasa Technologies GmbH. A list of the Licenses of the dependencies of the project can be found at the bottom of the diff --git a/poetry.lock b/poetry.lock index fb73f7a5c761..bfdf7ad716ef 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4821,10 +4821,8 @@ prompt-toolkit = ">=3.0,<3.0.29" "ruamel.yaml" = ">=0.16.5,<0.18.0" sanic = ">=21.12.0,<22.0.0" Sanic-Cors = ">=2.0.0,<3.0.0" -setuptools = ">=65.5.1" typing-extensions = ">=4.1.1,<5.0.0" websockets = ">=10.0,<12.0" -wheel = ">=0.38.1" [[package]] name = "redis" @@ -7507,4 +7505,4 @@ transformers = ["sentencepiece", "transformers"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.11" -content-hash = "74cb676c21adacee996bf57ed0d53a1e4d37048e3dd0352e4404e75895b4580d" +content-hash = "932867176f645c4a61a11f28b781b11d145a1b1f481e167ed830a579e8596c6c" diff --git a/pyproject.toml b/pyproject.toml index c0a6ba0bb0c0..96b65d009791 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,11 +16,10 @@ maintainers = [ "Tom Bocklisch ",] homepage = "https://rasa.com" repository = "https://github.com/rasahq/rasa" documentation = "https://rasa.com/docs" -classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Libraries",] +classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries",] keywords = [ "nlp", "machine-learning", "machine-learning-library", "bot", "bots", "botkit", "rasa conversational-agents", "conversational-ai", "chatbot", "chatbot-framework", "bot-framework",] include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys", "rasa/core/channels/chat.html", "rasa/cdu/classifiers/command_prompt_template.jinja2",] readme = "README.md" -license = "Apache-2.0" [[tool.poetry.source]] name = "internal repository mirroring psycopg binary for macos" url = "https://europe-west3-python.pkg.dev/rasa-releases/psycopg-binary/simple/" From 4eae577870a5fee38b62896b24656aba36074384 Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Fri, 15 Sep 2023 10:27:47 +0200 Subject: [PATCH 2/5] prepared release of version 3.8.0a8 --- pyproject.toml | 2 +- rasa/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 96b65d009791..8eda283ffa69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .pytest_cache | build | dist))" [tool.poetry] name = "rasa" -version = "3.8.0a6" +version = "3.8.0a8" description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants" authors = [ "Rasa Technologies GmbH ",] maintainers = [ "Tom Bocklisch ",] diff --git a/rasa/version.py b/rasa/version.py index 46b429cae333..f1144650aeda 100644 --- a/rasa/version.py +++ b/rasa/version.py @@ -1,3 +1,3 @@ # this file will automatically be changed, # do not add anything but the version number here! -__version__ = "3.8.0a6" +__version__ = "3.8.0a8" From ce8922ff169b0a699dee3bccc71d832b420a6979 Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Fri, 15 Sep 2023 14:16:40 +0200 Subject: [PATCH 3/5] prepared release of version 3.8.0a7 --- pyproject.toml | 2 +- rasa/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8eda283ffa69..c0a02e9e5646 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .pytest_cache | build | dist))" [tool.poetry] name = "rasa" -version = "3.8.0a8" +version = "3.8.0a7" description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants" authors = [ "Rasa Technologies GmbH ",] maintainers = [ "Tom Bocklisch ",] diff --git a/rasa/version.py b/rasa/version.py index f1144650aeda..6e999d3f7755 100644 --- a/rasa/version.py +++ b/rasa/version.py @@ -1,3 +1,3 @@ # this file will automatically be changed, # do not add anything but the version number here! -__version__ = "3.8.0a8" +__version__ = "3.8.0a7" From c0870ae531d457aec646f573d745f2744d56705f Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Mon, 18 Sep 2023 06:29:58 +0200 Subject: [PATCH 4/5] remoed obsolete type coercion during condition checking of pypred --- rasa/core/policies/flow_policy.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/rasa/core/policies/flow_policy.py b/rasa/core/policies/flow_policy.py index 00d70f0f2a7b..635c969ec9bc 100644 --- a/rasa/core/policies/flow_policy.py +++ b/rasa/core/policies/flow_policy.py @@ -294,30 +294,11 @@ def is_condition_satisfied( ) -> bool: """Evaluate a predicate condition.""" - def get_value( - initial_value: Union[Text, None] - ) -> Union[Text, float, bool, None]: - if initial_value is None or isinstance(initial_value, (bool, float)): - return initial_value - - # if this isn't a bool or float, it's something else - # the below is a best effort to convert it to something we can - # use for the predicate evaluation - initial_value = str(initial_value) # make sure it's a string - - if initial_value.lower() in ["true", "false"]: - return initial_value.lower() == "true" - - if initial_value.isnumeric(): - return float(initial_value) - - return initial_value - # attach context to the predicate evaluation to allow coditions using it context = {"context": DialogueStack.from_tracker(tracker).current_context()} document: Dict[str, Any] = context.copy() for slot in self.domain.slots: - document[slot.name] = get_value(tracker.get_slot(slot.name)) + document[slot.name] = tracker.get_slot(slot.name) p = Predicate(self.render_template_variables(predicate, context)) try: return p.evaluate(document) From 2bfcb05ebb009fec32b7e2de6efa4626ab6a569b Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Mon, 18 Sep 2023 06:58:17 +0200 Subject: [PATCH 5/5] renamed cdu -> dialogue understanding --- .../default_config_core_predict_schema.yml | 2 +- .../default_config_e2e_predict_schema.yml | 2 +- .../default_config_predict_schema.yml | 2 +- .../max_hist_config_predict_schema.yml | 2 +- data/test_config/graph_config.yml | 2 +- pyproject.toml | 2 +- rasa/cdu/commands/__init__.py | 29 ------------- rasa/cdu/generator/__init__.py | 4 -- rasa/cdu/stack/frames/__init__.py | 17 -------- rasa/core/actions/action.py | 6 +-- rasa/core/actions/flow_trigger_action.py | 4 +- rasa/core/nlg/response.py | 2 +- rasa/core/policies/flow_policy.py | 18 ++++---- rasa/core/policies/policy.py | 2 +- .../__init__.py | 0 .../commands/__init__.py | 42 +++++++++++++++++++ .../commands/can_not_handle_command.py | 2 +- .../commands/cancel_flow_command.py | 10 ++--- .../commands/chit_chat_answer_command.py | 6 +-- .../commands/clarify_command.py | 6 +-- .../commands/command.py | 0 .../commands/correct_slots_command.py | 10 ++--- .../commands/error_command.py | 8 ++-- .../commands/free_form_answer_command.py | 2 +- .../commands/human_handoff_command.py | 2 +- .../commands/knowledge_answer_command.py | 6 +-- .../commands/set_slot_command.py | 6 +-- .../commands/start_flow_command.py | 11 +++-- .../generator/__init__.py | 6 +++ .../generator/command_generator.py | 2 +- .../generator/command_prompt_template.jinja2 | 0 .../generator/llm_command_generator.py | 8 ++-- .../generator/nlu_command_adapter.py | 0 .../patterns/__init__.py | 0 .../patterns/cancel.py | 7 +++- .../patterns/clarify.py | 4 +- .../patterns/collect_information.py | 4 +- .../patterns/completed.py | 2 +- .../patterns/continue_interrupted.py | 2 +- .../patterns/correction.py | 6 +-- .../patterns/default_flows_for_patterns.yml | 0 .../patterns/internal_error.py | 2 +- .../processor/__init__.py | 0 .../processor/command_processor.py | 15 ++++--- .../processor/command_processor_component.py | 2 +- .../stack/__init__.py | 0 .../stack/dialogue_stack.py | 2 +- .../stack/frames/__init__.py | 19 +++++++++ .../stack/frames/chit_chat_frame.py | 2 +- .../stack/frames/dialogue_stack_frame.py | 0 .../stack/frames/flow_stack_frame.py | 2 +- .../stack/frames/pattern_frame.py | 2 +- .../stack/frames/search_frame.py | 2 +- .../stack/utils.py | 8 ++-- rasa/engine/recipes/default_components.py | 4 +- rasa/engine/recipes/default_recipe.py | 4 +- rasa/shared/importers/importer.py | 4 +- .../commands/test_can_not_handle_command.py | 4 +- .../cdu/commands/test_cancel_flow_command.py | 8 ++-- .../commands/test_chit_chat_answer_command.py | 4 +- tests/cdu/commands/test_clarify_command.py | 2 +- tests/cdu/commands/test_command.py | 4 +- .../commands/test_correct_slots_command.py | 15 ++++--- tests/cdu/commands/test_error_command.py | 2 +- .../commands/test_human_handoff_command.py | 4 +- .../commands/test_konwledge_answer_command.py | 4 +- tests/cdu/commands/test_set_slot_command.py | 2 +- tests/cdu/commands/test_start_flow_command.py | 2 +- .../cdu/stack/frames/test_chit_chat_frame.py | 2 +- .../stack/frames/test_dialogue_stack_frame.py | 2 +- tests/cdu/stack/frames/test_flow_frame.py | 2 +- tests/cdu/stack/frames/test_search_frame.py | 2 +- tests/cdu/stack/test_dialogue_stack.py | 6 +-- tests/cdu/stack/test_utils.py | 10 ++--- 74 files changed, 218 insertions(+), 171 deletions(-) delete mode 100644 rasa/cdu/commands/__init__.py delete mode 100644 rasa/cdu/generator/__init__.py delete mode 100644 rasa/cdu/stack/frames/__init__.py rename rasa/{cdu => dialogue_understanding}/__init__.py (100%) create mode 100644 rasa/dialogue_understanding/commands/__init__.py rename rasa/{cdu => dialogue_understanding}/commands/can_not_handle_command.py (95%) rename rasa/{cdu => dialogue_understanding}/commands/cancel_flow_command.py (90%) rename rasa/{cdu => dialogue_understanding}/commands/chit_chat_answer_command.py (86%) rename rasa/{cdu => dialogue_understanding}/commands/clarify_command.py (92%) rename rasa/{cdu => dialogue_understanding}/commands/command.py (100%) rename rasa/{cdu => dialogue_understanding}/commands/correct_slots_command.py (97%) rename rasa/{cdu => dialogue_understanding}/commands/error_command.py (87%) rename rasa/{cdu => dialogue_understanding}/commands/free_form_answer_command.py (73%) rename rasa/{cdu => dialogue_understanding}/commands/human_handoff_command.py (95%) rename rasa/{cdu => dialogue_understanding}/commands/knowledge_answer_command.py (86%) rename rasa/{cdu => dialogue_understanding}/commands/set_slot_command.py (92%) rename rasa/{cdu => dialogue_understanding}/commands/start_flow_command.py (89%) create mode 100644 rasa/dialogue_understanding/generator/__init__.py rename rasa/{cdu => dialogue_understanding}/generator/command_generator.py (97%) rename rasa/{cdu => dialogue_understanding}/generator/command_prompt_template.jinja2 (100%) rename rasa/{cdu => dialogue_understanding}/generator/llm_command_generator.py (98%) rename rasa/{cdu => dialogue_understanding}/generator/nlu_command_adapter.py (100%) rename rasa/{cdu => dialogue_understanding}/patterns/__init__.py (100%) rename rasa/{cdu => dialogue_understanding}/patterns/cancel.py (95%) rename rasa/{cdu => dialogue_understanding}/patterns/clarify.py (96%) rename rasa/{cdu => dialogue_understanding}/patterns/collect_information.py (93%) rename rasa/{cdu => dialogue_understanding}/patterns/completed.py (94%) rename rasa/{cdu => dialogue_understanding}/patterns/continue_interrupted.py (94%) rename rasa/{cdu => dialogue_understanding}/patterns/correction.py (95%) rename rasa/{cdu => dialogue_understanding}/patterns/default_flows_for_patterns.yml (100%) rename rasa/{cdu => dialogue_understanding}/patterns/internal_error.py (93%) rename rasa/{cdu => dialogue_understanding}/processor/__init__.py (100%) rename rasa/{cdu => dialogue_understanding}/processor/command_processor.py (95%) rename rasa/{cdu => dialogue_understanding}/processor/command_processor_component.py (92%) rename rasa/{cdu => dialogue_understanding}/stack/__init__.py (100%) rename rasa/{cdu => dialogue_understanding}/stack/dialogue_stack.py (98%) create mode 100644 rasa/dialogue_understanding/stack/frames/__init__.py rename rasa/{cdu => dialogue_understanding}/stack/frames/chit_chat_frame.py (90%) rename rasa/{cdu => dialogue_understanding}/stack/frames/dialogue_stack_frame.py (100%) rename rasa/{cdu => dialogue_understanding}/stack/frames/flow_stack_frame.py (98%) rename rasa/{cdu => dialogue_understanding}/stack/frames/pattern_frame.py (69%) rename rasa/{cdu => dialogue_understanding}/stack/frames/search_frame.py (90%) rename rasa/{cdu => dialogue_understanding}/stack/utils.py (92%) diff --git a/data/graph_schemas/default_config_core_predict_schema.yml b/data/graph_schemas/default_config_core_predict_schema.yml index ce8715b6c9ed..4aa0e1903b43 100644 --- a/data/graph_schemas/default_config_core_predict_schema.yml +++ b/data/graph_schemas/default_config_core_predict_schema.yml @@ -25,7 +25,7 @@ nodes: needs: tracker: __tracker__ flows: flows_provider - uses: rasa.cdu.processor.command_processor_component.CommandProcessorComponent + uses: rasa.dialogue_understanding.processor.command_processor_component.CommandProcessorComponent constructor_name: load fn: execute_commands config: { } diff --git a/data/graph_schemas/default_config_e2e_predict_schema.yml b/data/graph_schemas/default_config_e2e_predict_schema.yml index 46d1cb69aab7..7861c3719d3e 100644 --- a/data/graph_schemas/default_config_e2e_predict_schema.yml +++ b/data/graph_schemas/default_config_e2e_predict_schema.yml @@ -247,7 +247,7 @@ nodes: needs: tracker: __tracker__ flows: flows_provider - uses: rasa.cdu.processor.command_processor_component.CommandProcessorComponent + uses: rasa.dialogue_understanding.processor.command_processor_component.CommandProcessorComponent constructor_name: load fn: execute_commands config: { } diff --git a/data/graph_schemas/default_config_predict_schema.yml b/data/graph_schemas/default_config_predict_schema.yml index 8a1908f745e7..de5790c4d31f 100644 --- a/data/graph_schemas/default_config_predict_schema.yml +++ b/data/graph_schemas/default_config_predict_schema.yml @@ -163,7 +163,7 @@ nodes: needs: tracker: __tracker__ flows: flows_provider - uses: rasa.cdu.processor.command_processor_component.CommandProcessorComponent + uses: rasa.dialogue_understanding.processor.command_processor_component.CommandProcessorComponent constructor_name: load fn: execute_commands config: { } diff --git a/data/graph_schemas/max_hist_config_predict_schema.yml b/data/graph_schemas/max_hist_config_predict_schema.yml index 9beb1771dec9..aed0dc4bdbed 100644 --- a/data/graph_schemas/max_hist_config_predict_schema.yml +++ b/data/graph_schemas/max_hist_config_predict_schema.yml @@ -25,7 +25,7 @@ nodes: needs: tracker: __tracker__ flows: flows_provider - uses: rasa.cdu.processor.command_processor_component.CommandProcessorComponent + uses: rasa.dialogue_understanding.processor.command_processor_component.CommandProcessorComponent constructor_name: load fn: execute_commands config: { } diff --git a/data/test_config/graph_config.yml b/data/test_config/graph_config.yml index 7f8b3200f5f0..a816e91ec000 100644 --- a/data/test_config/graph_config.yml +++ b/data/test_config/graph_config.yml @@ -356,7 +356,7 @@ predict_schema: needs: tracker: __tracker__ flows: flows_provider - uses: rasa.cdu.processor.command_processor_component.CommandProcessorComponent + uses: rasa.dialogue_understanding.processor.command_processor_component.CommandProcessorComponent constructor_name: load fn: execute_commands config: { } diff --git a/pyproject.toml b/pyproject.toml index c0a02e9e5646..16fc82f44ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ repository = "https://github.com/rasahq/rasa" documentation = "https://rasa.com/docs" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries",] keywords = [ "nlp", "machine-learning", "machine-learning-library", "bot", "bots", "botkit", "rasa conversational-agents", "conversational-ai", "chatbot", "chatbot-framework", "bot-framework",] -include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys", "rasa/core/channels/chat.html", "rasa/cdu/classifiers/command_prompt_template.jinja2",] +include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys", "rasa/core/channels/chat.html", "rasa/dialogue_understanding/classifiers/command_prompt_template.jinja2",] readme = "README.md" [[tool.poetry.source]] name = "internal repository mirroring psycopg binary for macos" diff --git a/rasa/cdu/commands/__init__.py b/rasa/cdu/commands/__init__.py deleted file mode 100644 index c364839b8f44..000000000000 --- a/rasa/cdu/commands/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -from rasa.cdu.commands.command import Command -from rasa.cdu.commands.free_form_answer_command import FreeFormAnswerCommand -from rasa.cdu.commands.cancel_flow_command import CancelFlowCommand -from rasa.cdu.commands.knowledge_answer_command import KnowledgeAnswerCommand -from rasa.cdu.commands.chit_chat_answer_command import ChitChatAnswerCommand -from rasa.cdu.commands.can_not_handle_command import CannotHandleCommand -from rasa.cdu.commands.clarify_command import ClarifyCommand -from rasa.cdu.commands.error_command import ErrorCommand -from rasa.cdu.commands.set_slot_command import SetSlotCommand -from rasa.cdu.commands.start_flow_command import StartFlowCommand -from rasa.cdu.commands.human_handoff_command import HumanHandoffCommand -from rasa.cdu.commands.correct_slots_command import CorrectSlotsCommand, CorrectedSlot - - -__all__ = [ - "Command", - "FreeFormAnswerCommand", - "CancelFlowCommand", - "KnowledgeAnswerCommand", - "ChitChatAnswerCommand", - "CannotHandleCommand", - "ClarifyCommand", - "ErrorCommand", - "SetSlotCommand", - "StartFlowCommand", - "HumanHandoffCommand", - "CorrectSlotsCommand", - "CorrectedSlot", -] diff --git a/rasa/cdu/generator/__init__.py b/rasa/cdu/generator/__init__.py deleted file mode 100644 index 0fe0868ef1d5..000000000000 --- a/rasa/cdu/generator/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from rasa.cdu.generator.command_generator import CommandGenerator -from rasa.cdu.generator.llm_command_generator import LLMCommandGenerator - -__all__ = ["CommandGenerator", "LLMCommandGenerator"] diff --git a/rasa/cdu/stack/frames/__init__.py b/rasa/cdu/stack/frames/__init__.py deleted file mode 100644 index 404dccce571e..000000000000 --- a/rasa/cdu/stack/frames/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -from rasa.cdu.stack.frames.dialogue_stack_frame import DialogueStackFrame -from rasa.cdu.stack.frames.flow_stack_frame import ( - UserFlowStackFrame, - BaseFlowStackFrame, -) -from rasa.cdu.stack.frames.pattern_frame import PatternFlowStackFrame -from rasa.cdu.stack.frames.search_frame import SearchStackFrame -from rasa.cdu.stack.frames.chit_chat_frame import ChitChatStackFrame - -__all__ = [ - "DialogueStackFrame", - "BaseFlowStackFrame", - "PatternFlowStackFrame", - "UserFlowStackFrame", - "SearchStackFrame", - "ChitChatStackFrame", -] diff --git a/rasa/core/actions/action.py b/rasa/core/actions/action.py index 69424a39ccab..65f5e51cd444 100644 --- a/rasa/core/actions/action.py +++ b/rasa/core/actions/action.py @@ -97,9 +97,9 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["Action"]: """List default actions.""" from rasa.core.actions.two_stage_fallback import TwoStageFallbackAction - from rasa.cdu.patterns.correction import ActionCorrectFlowSlot - from rasa.cdu.patterns.cancel import ActionCancelFlow - from rasa.cdu.patterns.clarify import ActionClarifyFlows + from rasa.dialogue_understanding.patterns.correction import ActionCorrectFlowSlot + from rasa.dialogue_understanding.patterns.cancel import ActionCancelFlow + from rasa.dialogue_understanding.patterns.clarify import ActionClarifyFlows return [ ActionListen(), diff --git a/rasa/core/actions/flow_trigger_action.py b/rasa/core/actions/flow_trigger_action.py index 2d7d0317826a..82ee017679bf 100644 --- a/rasa/core/actions/flow_trigger_action.py +++ b/rasa/core/actions/flow_trigger_action.py @@ -1,8 +1,8 @@ from typing import Any, Dict, Optional, Text, List import structlog -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import ( +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import ( FlowStackFrameType, UserFlowStackFrame, ) diff --git a/rasa/core/nlg/response.py b/rasa/core/nlg/response.py index b931c6b28c0e..756b243602d8 100644 --- a/rasa/core/nlg/response.py +++ b/rasa/core/nlg/response.py @@ -1,6 +1,6 @@ import copy import logging -from rasa.cdu.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack from rasa.core.constants import DEFAULT_TEMPLATE_ENGINE, TEMPLATE_ENGINE_CONFIG_KEY from rasa.shared.core.trackers import DialogueStateTracker diff --git a/rasa/core/policies/flow_policy.py b/rasa/core/policies/flow_policy.py index 635c969ec9bc..273bc97f8b96 100644 --- a/rasa/core/policies/flow_policy.py +++ b/rasa/core/policies/flow_policy.py @@ -1,27 +1,29 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Dict, Text, List, Optional, Union +from typing import Any, Dict, Text, List, Optional from jinja2 import Template from structlog.contextvars import ( bound_contextvars, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames import ( +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames import ( BaseFlowStackFrame, DialogueStackFrame, UserFlowStackFrame, ) -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.patterns.completed import CompletedPatternFlowStackFrame -from rasa.cdu.patterns.continue_interrupted import ( +from rasa.dialogue_understanding.patterns.completed import ( + CompletedPatternFlowStackFrame, +) +from rasa.dialogue_understanding.patterns.continue_interrupted import ( ContinueInterruptedPatternFlowStackFrame, ) -from rasa.cdu.stack.frames.flow_stack_frame import FlowStackFrameType -from rasa.cdu.stack.utils import top_user_flow_frame +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import FlowStackFrameType +from rasa.dialogue_understanding.stack.utils import top_user_flow_frame from rasa.core.constants import ( DEFAULT_POLICY_PRIORITY, diff --git a/rasa/core/policies/policy.py b/rasa/core/policies/policy.py index 439e32741b97..acf17ea8661c 100644 --- a/rasa/core/policies/policy.py +++ b/rasa/core/policies/policy.py @@ -4,7 +4,7 @@ import logging from enum import Enum from pathlib import Path -from rasa.cdu.stack.dialogue_stack import ( +from rasa.dialogue_understanding.stack.dialogue_stack import ( DialogueStack, DialogueStackFrame, ) diff --git a/rasa/cdu/__init__.py b/rasa/dialogue_understanding/__init__.py similarity index 100% rename from rasa/cdu/__init__.py rename to rasa/dialogue_understanding/__init__.py diff --git a/rasa/dialogue_understanding/commands/__init__.py b/rasa/dialogue_understanding/commands/__init__.py new file mode 100644 index 000000000000..fd437043c2da --- /dev/null +++ b/rasa/dialogue_understanding/commands/__init__.py @@ -0,0 +1,42 @@ +from rasa.dialogue_understanding.commands.command import Command +from rasa.dialogue_understanding.commands.free_form_answer_command import ( + FreeFormAnswerCommand, +) +from rasa.dialogue_understanding.commands.cancel_flow_command import CancelFlowCommand +from rasa.dialogue_understanding.commands.knowledge_answer_command import ( + KnowledgeAnswerCommand, +) +from rasa.dialogue_understanding.commands.chit_chat_answer_command import ( + ChitChatAnswerCommand, +) +from rasa.dialogue_understanding.commands.can_not_handle_command import ( + CannotHandleCommand, +) +from rasa.dialogue_understanding.commands.clarify_command import ClarifyCommand +from rasa.dialogue_understanding.commands.error_command import ErrorCommand +from rasa.dialogue_understanding.commands.set_slot_command import SetSlotCommand +from rasa.dialogue_understanding.commands.start_flow_command import StartFlowCommand +from rasa.dialogue_understanding.commands.human_handoff_command import ( + HumanHandoffCommand, +) +from rasa.dialogue_understanding.commands.correct_slots_command import ( + CorrectSlotsCommand, + CorrectedSlot, +) + + +__all__ = [ + "Command", + "FreeFormAnswerCommand", + "CancelFlowCommand", + "KnowledgeAnswerCommand", + "ChitChatAnswerCommand", + "CannotHandleCommand", + "ClarifyCommand", + "ErrorCommand", + "SetSlotCommand", + "StartFlowCommand", + "HumanHandoffCommand", + "CorrectSlotsCommand", + "CorrectedSlot", +] diff --git a/rasa/cdu/commands/can_not_handle_command.py b/rasa/dialogue_understanding/commands/can_not_handle_command.py similarity index 95% rename from rasa/cdu/commands/can_not_handle_command.py rename to rasa/dialogue_understanding/commands/can_not_handle_command.py index 1316770b05fe..631cbe378ec4 100644 --- a/rasa/cdu/commands/can_not_handle_command.py +++ b/rasa/dialogue_understanding/commands/can_not_handle_command.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Any, Dict, List -from rasa.cdu.commands import Command +from rasa.dialogue_understanding.commands import Command from rasa.shared.core.events import Event from rasa.shared.core.flows.flow import FlowsList from rasa.shared.core.trackers import DialogueStateTracker diff --git a/rasa/cdu/commands/cancel_flow_command.py b/rasa/dialogue_understanding/commands/cancel_flow_command.py similarity index 90% rename from rasa/cdu/commands/cancel_flow_command.py rename to rasa/dialogue_understanding/commands/cancel_flow_command.py index 9d75b89c6229..9a880111e7fe 100644 --- a/rasa/cdu/commands/cancel_flow_command.py +++ b/rasa/dialogue_understanding/commands/cancel_flow_command.py @@ -5,15 +5,15 @@ import structlog -from rasa.cdu.commands import Command -from rasa.cdu.patterns.cancel import CancelPatternFlowStackFrame -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames import UserFlowStackFrame +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.patterns.cancel import CancelPatternFlowStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames import UserFlowStackFrame from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList from rasa.shared.core.trackers import DialogueStateTracker -from rasa.cdu.stack.utils import top_user_flow_frame +from rasa.dialogue_understanding.stack.utils import top_user_flow_frame structlogger = structlog.get_logger() diff --git a/rasa/cdu/commands/chit_chat_answer_command.py b/rasa/dialogue_understanding/commands/chit_chat_answer_command.py similarity index 86% rename from rasa/cdu/commands/chit_chat_answer_command.py rename to rasa/dialogue_understanding/commands/chit_chat_answer_command.py index 74b75081a25a..38be12d210b8 100644 --- a/rasa/cdu/commands/chit_chat_answer_command.py +++ b/rasa/dialogue_understanding/commands/chit_chat_answer_command.py @@ -2,9 +2,9 @@ from dataclasses import dataclass from typing import Any, Dict, List -from rasa.cdu.commands import FreeFormAnswerCommand -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.chit_chat_frame import ChitChatStackFrame +from rasa.dialogue_understanding.commands import FreeFormAnswerCommand +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.chit_chat_frame import ChitChatStackFrame from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/cdu/commands/clarify_command.py b/rasa/dialogue_understanding/commands/clarify_command.py similarity index 92% rename from rasa/cdu/commands/clarify_command.py rename to rasa/dialogue_understanding/commands/clarify_command.py index da60ba8b878c..69a413730e0f 100644 --- a/rasa/cdu/commands/clarify_command.py +++ b/rasa/dialogue_understanding/commands/clarify_command.py @@ -4,9 +4,9 @@ from typing import Any, Dict, List import structlog -from rasa.cdu.commands import Command -from rasa.cdu.patterns.clarify import ClarifyPatternFlowStackFrame -from rasa.cdu.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.patterns.clarify import ClarifyPatternFlowStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/cdu/commands/command.py b/rasa/dialogue_understanding/commands/command.py similarity index 100% rename from rasa/cdu/commands/command.py rename to rasa/dialogue_understanding/commands/command.py diff --git a/rasa/cdu/commands/correct_slots_command.py b/rasa/dialogue_understanding/commands/correct_slots_command.py similarity index 97% rename from rasa/cdu/commands/correct_slots_command.py rename to rasa/dialogue_understanding/commands/correct_slots_command.py index d68641a684b4..6c9a425ba084 100644 --- a/rasa/cdu/commands/correct_slots_command.py +++ b/rasa/dialogue_understanding/commands/correct_slots_command.py @@ -5,13 +5,13 @@ import structlog -from rasa.cdu.commands import Command -from rasa.cdu.patterns.correction import ( +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.patterns.correction import ( FLOW_PATTERN_CORRECTION_ID, CorrectionPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import ( +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import ( BaseFlowStackFrame, UserFlowStackFrame, ) @@ -19,7 +19,7 @@ from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import END_STEP, ContinueFlowStep, FlowStep, FlowsList from rasa.shared.core.trackers import DialogueStateTracker -import rasa.cdu.stack.utils as utils +import rasa.dialogue_understanding.stack.utils as utils structlogger = structlog.get_logger() diff --git a/rasa/cdu/commands/error_command.py b/rasa/dialogue_understanding/commands/error_command.py similarity index 87% rename from rasa/cdu/commands/error_command.py rename to rasa/dialogue_understanding/commands/error_command.py index a7c25a7082ac..b5e62cb90d1c 100644 --- a/rasa/cdu/commands/error_command.py +++ b/rasa/dialogue_understanding/commands/error_command.py @@ -4,9 +4,11 @@ from typing import Any, Dict, List import structlog -from rasa.cdu.commands import Command -from rasa.cdu.patterns.internal_error import InternalErrorPatternFlowStackFrame -from rasa.cdu.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.patterns.internal_error import ( + InternalErrorPatternFlowStackFrame, +) +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/cdu/commands/free_form_answer_command.py b/rasa/dialogue_understanding/commands/free_form_answer_command.py similarity index 73% rename from rasa/cdu/commands/free_form_answer_command.py rename to rasa/dialogue_understanding/commands/free_form_answer_command.py index 6dc38808c192..13bac7e5ff5c 100644 --- a/rasa/cdu/commands/free_form_answer_command.py +++ b/rasa/dialogue_understanding/commands/free_form_answer_command.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from rasa.cdu.commands import Command +from rasa.dialogue_understanding.commands import Command @dataclass diff --git a/rasa/cdu/commands/human_handoff_command.py b/rasa/dialogue_understanding/commands/human_handoff_command.py similarity index 95% rename from rasa/cdu/commands/human_handoff_command.py rename to rasa/dialogue_understanding/commands/human_handoff_command.py index 819a6e6f4c19..a91630018c50 100644 --- a/rasa/cdu/commands/human_handoff_command.py +++ b/rasa/dialogue_understanding/commands/human_handoff_command.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Any, Dict, List -from rasa.cdu.commands import Command +from rasa.dialogue_understanding.commands import Command from rasa.shared.core.events import Event from rasa.shared.core.flows.flow import FlowsList from rasa.shared.core.trackers import DialogueStateTracker diff --git a/rasa/cdu/commands/knowledge_answer_command.py b/rasa/dialogue_understanding/commands/knowledge_answer_command.py similarity index 86% rename from rasa/cdu/commands/knowledge_answer_command.py rename to rasa/dialogue_understanding/commands/knowledge_answer_command.py index fa708cb1cb5c..3077dd44a739 100644 --- a/rasa/cdu/commands/knowledge_answer_command.py +++ b/rasa/dialogue_understanding/commands/knowledge_answer_command.py @@ -2,9 +2,9 @@ from dataclasses import dataclass from typing import Any, Dict, List -from rasa.cdu.commands import FreeFormAnswerCommand -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.search_frame import SearchStackFrame +from rasa.dialogue_understanding.commands import FreeFormAnswerCommand +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.search_frame import SearchStackFrame from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/cdu/commands/set_slot_command.py b/rasa/dialogue_understanding/commands/set_slot_command.py similarity index 92% rename from rasa/cdu/commands/set_slot_command.py rename to rasa/dialogue_understanding/commands/set_slot_command.py index 136f89f60adc..c17bfea9c15f 100644 --- a/rasa/cdu/commands/set_slot_command.py +++ b/rasa/dialogue_understanding/commands/set_slot_command.py @@ -4,9 +4,9 @@ from typing import Any, Dict, List import structlog -from rasa.cdu.commands import Command -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.utils import filled_slots_for_active_flow +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.utils import filled_slots_for_active_flow from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList from rasa.shared.core.trackers import DialogueStateTracker diff --git a/rasa/cdu/commands/start_flow_command.py b/rasa/dialogue_understanding/commands/start_flow_command.py similarity index 89% rename from rasa/cdu/commands/start_flow_command.py rename to rasa/dialogue_understanding/commands/start_flow_command.py index fd559d989063..cb3cd5d5166a 100644 --- a/rasa/cdu/commands/start_flow_command.py +++ b/rasa/dialogue_understanding/commands/start_flow_command.py @@ -4,13 +4,16 @@ from typing import Any, Dict, List import structlog -from rasa.cdu.commands import Command -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import ( +from rasa.dialogue_understanding.commands import Command +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import ( FlowStackFrameType, UserFlowStackFrame, ) -from rasa.cdu.stack.utils import top_user_flow_frame, user_flows_on_the_stack +from rasa.dialogue_understanding.stack.utils import ( + top_user_flow_frame, + user_flows_on_the_stack, +) from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/dialogue_understanding/generator/__init__.py b/rasa/dialogue_understanding/generator/__init__.py new file mode 100644 index 000000000000..8d4efbb2bc73 --- /dev/null +++ b/rasa/dialogue_understanding/generator/__init__.py @@ -0,0 +1,6 @@ +from rasa.dialogue_understanding.generator.command_generator import CommandGenerator +from rasa.dialogue_understanding.generator.llm_command_generator import ( + LLMCommandGenerator, +) + +__all__ = ["CommandGenerator", "LLMCommandGenerator"] diff --git a/rasa/cdu/generator/command_generator.py b/rasa/dialogue_understanding/generator/command_generator.py similarity index 97% rename from rasa/cdu/generator/command_generator.py rename to rasa/dialogue_understanding/generator/command_generator.py index 2a0e4b0e3e2a..3e87102061f7 100644 --- a/rasa/cdu/generator/command_generator.py +++ b/rasa/dialogue_understanding/generator/command_generator.py @@ -1,5 +1,5 @@ from typing import List, Optional -from rasa.cdu.commands import Command +from rasa.dialogue_understanding.commands import Command from rasa.shared.core.flows.flow import FlowsList from rasa.shared.core.trackers import DialogueStateTracker from rasa.shared.nlu.training_data.message import Message diff --git a/rasa/cdu/generator/command_prompt_template.jinja2 b/rasa/dialogue_understanding/generator/command_prompt_template.jinja2 similarity index 100% rename from rasa/cdu/generator/command_prompt_template.jinja2 rename to rasa/dialogue_understanding/generator/command_prompt_template.jinja2 diff --git a/rasa/cdu/generator/llm_command_generator.py b/rasa/dialogue_understanding/generator/llm_command_generator.py similarity index 98% rename from rasa/cdu/generator/llm_command_generator.py rename to rasa/dialogue_understanding/generator/llm_command_generator.py index 9a6bd14ac533..d4c4088c9d7a 100644 --- a/rasa/cdu/generator/llm_command_generator.py +++ b/rasa/dialogue_understanding/generator/llm_command_generator.py @@ -4,9 +4,9 @@ from jinja2 import Template import structlog -from rasa.cdu.stack.utils import top_flow_frame -from rasa.cdu.generator import CommandGenerator -from rasa.cdu.commands import ( +from rasa.dialogue_understanding.stack.utils import top_flow_frame +from rasa.dialogue_understanding.generator import CommandGenerator +from rasa.dialogue_understanding.commands import ( Command, ErrorCommand, SetSlotCommand, @@ -44,7 +44,7 @@ ) DEFAULT_COMMAND_PROMPT_TEMPLATE = importlib.resources.read_text( - "rasa.cdu.generator", "command_prompt_template.jinja2" + "rasa.dialogue_understanding.generator", "command_prompt_template.jinja2" ) structlogger = structlog.get_logger() diff --git a/rasa/cdu/generator/nlu_command_adapter.py b/rasa/dialogue_understanding/generator/nlu_command_adapter.py similarity index 100% rename from rasa/cdu/generator/nlu_command_adapter.py rename to rasa/dialogue_understanding/generator/nlu_command_adapter.py diff --git a/rasa/cdu/patterns/__init__.py b/rasa/dialogue_understanding/patterns/__init__.py similarity index 100% rename from rasa/cdu/patterns/__init__.py rename to rasa/dialogue_understanding/patterns/__init__.py diff --git a/rasa/cdu/patterns/cancel.py b/rasa/dialogue_understanding/patterns/cancel.py similarity index 95% rename from rasa/cdu/patterns/cancel.py rename to rasa/dialogue_understanding/patterns/cancel.py index 0a11d02c4f18..fa1eda6316c4 100644 --- a/rasa/cdu/patterns/cancel.py +++ b/rasa/dialogue_understanding/patterns/cancel.py @@ -4,10 +4,13 @@ from typing import Any, Dict, List, Optional import structlog -from rasa.cdu.stack.dialogue_stack import ( +from rasa.dialogue_understanding.stack.dialogue_stack import ( DialogueStack, ) -from rasa.cdu.stack.frames import PatternFlowStackFrame, BaseFlowStackFrame +from rasa.dialogue_understanding.stack.frames import ( + PatternFlowStackFrame, + BaseFlowStackFrame, +) from rasa.core.actions import action from rasa.core.channels.channel import OutputChannel from rasa.core.nlg.generator import NaturalLanguageGenerator diff --git a/rasa/cdu/patterns/clarify.py b/rasa/dialogue_understanding/patterns/clarify.py similarity index 96% rename from rasa/cdu/patterns/clarify.py rename to rasa/dialogue_understanding/patterns/clarify.py index ddc238e501e3..4a7b1df074f0 100644 --- a/rasa/cdu/patterns/clarify.py +++ b/rasa/dialogue_understanding/patterns/clarify.py @@ -4,10 +4,10 @@ from typing import Any, Dict, List, Optional import structlog -from rasa.cdu.stack.dialogue_stack import ( +from rasa.dialogue_understanding.stack.dialogue_stack import ( DialogueStack, ) -from rasa.cdu.stack.frames import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames import PatternFlowStackFrame from rasa.core.actions import action from rasa.core.channels.channel import OutputChannel from rasa.core.nlg.generator import NaturalLanguageGenerator diff --git a/rasa/cdu/patterns/collect_information.py b/rasa/dialogue_understanding/patterns/collect_information.py similarity index 93% rename from rasa/cdu/patterns/collect_information.py rename to rasa/dialogue_understanding/patterns/collect_information.py index 9b8b70146d40..86442c6edc8b 100644 --- a/rasa/cdu/patterns/collect_information.py +++ b/rasa/dialogue_understanding/patterns/collect_information.py @@ -2,9 +2,9 @@ from dataclasses import dataclass from typing import Any, Dict, List -from rasa.cdu.stack.dialogue_stack import DialogueStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStackFrame from rasa.shared.constants import RASA_DEFAULT_FLOW_PATTERN_PREFIX -from rasa.cdu.stack.frames import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames import PatternFlowStackFrame FLOW_PATTERN_COLLECT_INFORMATION = ( RASA_DEFAULT_FLOW_PATTERN_PREFIX + "ask_collect_information" diff --git a/rasa/cdu/patterns/completed.py b/rasa/dialogue_understanding/patterns/completed.py similarity index 94% rename from rasa/cdu/patterns/completed.py rename to rasa/dialogue_understanding/patterns/completed.py index ff6a080f3c54..5852be45c1d8 100644 --- a/rasa/cdu/patterns/completed.py +++ b/rasa/dialogue_understanding/patterns/completed.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from typing import Any, Dict from rasa.shared.constants import RASA_DEFAULT_FLOW_PATTERN_PREFIX -from rasa.cdu.stack.frames import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames import PatternFlowStackFrame FLOW_PATTERN_COMPLETED = RASA_DEFAULT_FLOW_PATTERN_PREFIX + "completed" diff --git a/rasa/cdu/patterns/continue_interrupted.py b/rasa/dialogue_understanding/patterns/continue_interrupted.py similarity index 94% rename from rasa/cdu/patterns/continue_interrupted.py rename to rasa/dialogue_understanding/patterns/continue_interrupted.py index 5e66196cab57..1137408c8383 100644 --- a/rasa/cdu/patterns/continue_interrupted.py +++ b/rasa/dialogue_understanding/patterns/continue_interrupted.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from typing import Any, Dict from rasa.shared.constants import RASA_DEFAULT_FLOW_PATTERN_PREFIX -from rasa.cdu.stack.frames import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames import PatternFlowStackFrame FLOW_PATTERN_CONTINUE_INTERRUPTED = ( diff --git a/rasa/cdu/patterns/correction.py b/rasa/dialogue_understanding/patterns/correction.py similarity index 95% rename from rasa/cdu/patterns/correction.py rename to rasa/dialogue_understanding/patterns/correction.py index a258a4e7d6a9..e8626fa6ff20 100644 --- a/rasa/cdu/patterns/correction.py +++ b/rasa/dialogue_understanding/patterns/correction.py @@ -2,10 +2,10 @@ from dataclasses import dataclass, field from typing import Any, Dict, Text, List, Optional -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack from rasa.shared.constants import RASA_DEFAULT_FLOW_PATTERN_PREFIX from rasa.shared.core.constants import ( DIALOGUE_STACK_SLOT, @@ -19,7 +19,7 @@ import structlog from rasa.core.actions import action from rasa.core.channels import OutputChannel -from rasa.cdu.stack.frames import ( +from rasa.dialogue_understanding.stack.frames import ( BaseFlowStackFrame, PatternFlowStackFrame, ) diff --git a/rasa/cdu/patterns/default_flows_for_patterns.yml b/rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml similarity index 100% rename from rasa/cdu/patterns/default_flows_for_patterns.yml rename to rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml diff --git a/rasa/cdu/patterns/internal_error.py b/rasa/dialogue_understanding/patterns/internal_error.py similarity index 93% rename from rasa/cdu/patterns/internal_error.py rename to rasa/dialogue_understanding/patterns/internal_error.py index fe57d6be9c7e..405953d9cf06 100644 --- a/rasa/cdu/patterns/internal_error.py +++ b/rasa/dialogue_understanding/patterns/internal_error.py @@ -3,7 +3,7 @@ from rasa.shared.constants import RASA_DEFAULT_FLOW_PATTERN_PREFIX from dataclasses import dataclass from typing import Any, Dict -from rasa.cdu.stack.frames import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames import PatternFlowStackFrame FLOW_PATTERN_INTERNAL_ERROR_ID = RASA_DEFAULT_FLOW_PATTERN_PREFIX + "internal_error" diff --git a/rasa/cdu/processor/__init__.py b/rasa/dialogue_understanding/processor/__init__.py similarity index 100% rename from rasa/cdu/processor/__init__.py rename to rasa/dialogue_understanding/processor/__init__.py diff --git a/rasa/cdu/processor/command_processor.py b/rasa/dialogue_understanding/processor/command_processor.py similarity index 95% rename from rasa/cdu/processor/command_processor.py rename to rasa/dialogue_understanding/processor/command_processor.py index c258b0255a9d..c9919900b448 100644 --- a/rasa/cdu/processor/command_processor.py +++ b/rasa/dialogue_understanding/processor/command_processor.py @@ -1,7 +1,7 @@ from typing import List, Optional, Type import structlog -from rasa.cdu.commands import ( +from rasa.dialogue_understanding.commands import ( CancelFlowCommand, Command, CorrectSlotsCommand, @@ -9,17 +9,20 @@ SetSlotCommand, FreeFormAnswerCommand, ) -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.patterns.correction import ( +from rasa.dialogue_understanding.patterns.correction import ( CorrectionPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames import ( +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames import ( BaseFlowStackFrame, ) -from rasa.cdu.stack.utils import filled_slots_for_active_flow, top_flow_frame +from rasa.dialogue_understanding.stack.utils import ( + filled_slots_for_active_flow, + top_flow_frame, +) from rasa.shared.core.events import Event, SlotSet from rasa.shared.core.flows.flow import ( FlowsList, diff --git a/rasa/cdu/processor/command_processor_component.py b/rasa/dialogue_understanding/processor/command_processor_component.py similarity index 92% rename from rasa/cdu/processor/command_processor_component.py rename to rasa/dialogue_understanding/processor/command_processor_component.py index 38ff56890f7f..e557ab2c83c8 100644 --- a/rasa/cdu/processor/command_processor_component.py +++ b/rasa/dialogue_understanding/processor/command_processor_component.py @@ -1,7 +1,7 @@ from __future__ import annotations from typing import Any, Dict, List, Text -from rasa.cdu.processor.command_processor import execute_commands +from rasa.dialogue_understanding.processor.command_processor import execute_commands from rasa.engine.graph import ExecutionContext, GraphComponent from rasa.engine.storage.resource import Resource diff --git a/rasa/cdu/stack/__init__.py b/rasa/dialogue_understanding/stack/__init__.py similarity index 100% rename from rasa/cdu/stack/__init__.py rename to rasa/dialogue_understanding/stack/__init__.py diff --git a/rasa/cdu/stack/dialogue_stack.py b/rasa/dialogue_understanding/stack/dialogue_stack.py similarity index 98% rename from rasa/cdu/stack/dialogue_stack.py rename to rasa/dialogue_understanding/stack/dialogue_stack.py index 9b18ed64e4cb..5059b919523d 100644 --- a/rasa/cdu/stack/dialogue_stack.py +++ b/rasa/dialogue_understanding/stack/dialogue_stack.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Any, Callable, Dict, List, Optional -from rasa.cdu.stack.frames import DialogueStackFrame +from rasa.dialogue_understanding.stack.frames import DialogueStackFrame from rasa.shared.core.constants import ( DIALOGUE_STACK_SLOT, ) diff --git a/rasa/dialogue_understanding/stack/frames/__init__.py b/rasa/dialogue_understanding/stack/frames/__init__.py new file mode 100644 index 000000000000..57bdfa9ce178 --- /dev/null +++ b/rasa/dialogue_understanding/stack/frames/__init__.py @@ -0,0 +1,19 @@ +from rasa.dialogue_understanding.stack.frames.dialogue_stack_frame import ( + DialogueStackFrame, +) +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import ( + UserFlowStackFrame, + BaseFlowStackFrame, +) +from rasa.dialogue_understanding.stack.frames.pattern_frame import PatternFlowStackFrame +from rasa.dialogue_understanding.stack.frames.search_frame import SearchStackFrame +from rasa.dialogue_understanding.stack.frames.chit_chat_frame import ChitChatStackFrame + +__all__ = [ + "DialogueStackFrame", + "BaseFlowStackFrame", + "PatternFlowStackFrame", + "UserFlowStackFrame", + "SearchStackFrame", + "ChitChatStackFrame", +] diff --git a/rasa/cdu/stack/frames/chit_chat_frame.py b/rasa/dialogue_understanding/stack/frames/chit_chat_frame.py similarity index 90% rename from rasa/cdu/stack/frames/chit_chat_frame.py rename to rasa/dialogue_understanding/stack/frames/chit_chat_frame.py index 42cf4af0482a..27e05583066b 100644 --- a/rasa/cdu/stack/frames/chit_chat_frame.py +++ b/rasa/dialogue_understanding/stack/frames/chit_chat_frame.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Any, Dict -from rasa.cdu.stack.frames import DialogueStackFrame +from rasa.dialogue_understanding.stack.frames import DialogueStackFrame @dataclass diff --git a/rasa/cdu/stack/frames/dialogue_stack_frame.py b/rasa/dialogue_understanding/stack/frames/dialogue_stack_frame.py similarity index 100% rename from rasa/cdu/stack/frames/dialogue_stack_frame.py rename to rasa/dialogue_understanding/stack/frames/dialogue_stack_frame.py diff --git a/rasa/cdu/stack/frames/flow_stack_frame.py b/rasa/dialogue_understanding/stack/frames/flow_stack_frame.py similarity index 98% rename from rasa/cdu/stack/frames/flow_stack_frame.py rename to rasa/dialogue_understanding/stack/frames/flow_stack_frame.py index fa0064cccc12..ceeb4d5bfe39 100644 --- a/rasa/cdu/stack/frames/flow_stack_frame.py +++ b/rasa/dialogue_understanding/stack/frames/flow_stack_frame.py @@ -3,7 +3,7 @@ from enum import Enum from typing import Any, Dict, Optional -from rasa.cdu.stack.frames import DialogueStackFrame +from rasa.dialogue_understanding.stack.frames import DialogueStackFrame from rasa.shared.core.flows.flow import START_STEP, Flow, FlowStep, FlowsList from rasa.shared.exceptions import RasaException diff --git a/rasa/cdu/stack/frames/pattern_frame.py b/rasa/dialogue_understanding/stack/frames/pattern_frame.py similarity index 69% rename from rasa/cdu/stack/frames/pattern_frame.py rename to rasa/dialogue_understanding/stack/frames/pattern_frame.py index 3e7594b03994..54e10f2f688e 100644 --- a/rasa/cdu/stack/frames/pattern_frame.py +++ b/rasa/dialogue_understanding/stack/frames/pattern_frame.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from rasa.cdu.stack.frames import BaseFlowStackFrame +from rasa.dialogue_understanding.stack.frames import BaseFlowStackFrame @dataclass diff --git a/rasa/cdu/stack/frames/search_frame.py b/rasa/dialogue_understanding/stack/frames/search_frame.py similarity index 90% rename from rasa/cdu/stack/frames/search_frame.py rename to rasa/dialogue_understanding/stack/frames/search_frame.py index 68ea6c0c04c2..efa7aa0bd14e 100644 --- a/rasa/cdu/stack/frames/search_frame.py +++ b/rasa/dialogue_understanding/stack/frames/search_frame.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Any, Dict -from rasa.cdu.stack.frames import DialogueStackFrame +from rasa.dialogue_understanding.stack.frames import DialogueStackFrame @dataclass diff --git a/rasa/cdu/stack/utils.py b/rasa/dialogue_understanding/stack/utils.py similarity index 92% rename from rasa/cdu/stack/utils.py rename to rasa/dialogue_understanding/stack/utils.py index 744f0de08e49..144638e2b71e 100644 --- a/rasa/cdu/stack/utils.py +++ b/rasa/dialogue_understanding/stack/utils.py @@ -1,10 +1,10 @@ from typing import Optional, Set -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.stack.frames import BaseFlowStackFrame -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames import UserFlowStackFrame +from rasa.dialogue_understanding.stack.frames import BaseFlowStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames import UserFlowStackFrame from rasa.shared.core.flows.flow import FlowsList diff --git a/rasa/engine/recipes/default_components.py b/rasa/engine/recipes/default_components.py index 9d46707d9345..11c2212cc41f 100644 --- a/rasa/engine/recipes/default_components.py +++ b/rasa/engine/recipes/default_components.py @@ -1,7 +1,9 @@ from rasa.nlu.classifiers.diet_classifier import DIETClassifier from rasa.nlu.classifiers.fallback_classifier import FallbackClassifier from rasa.nlu.classifiers.keyword_intent_classifier import KeywordIntentClassifier -from rasa.cdu.generator.llm_command_generator import LLMCommandGenerator +from rasa.dialogue_understanding.generator.llm_command_generator import ( + LLMCommandGenerator, +) from rasa.nlu.classifiers.logistic_regression_classifier import ( LogisticRegressionClassifier, ) diff --git a/rasa/engine/recipes/default_recipe.py b/rasa/engine/recipes/default_recipe.py index 13153ab70a65..ca47bf658fbd 100644 --- a/rasa/engine/recipes/default_recipe.py +++ b/rasa/engine/recipes/default_recipe.py @@ -14,7 +14,9 @@ CoreFeaturizationCollector, ) from rasa.graph_components.providers.flows_provider import FlowsProvider -from rasa.cdu.processor.command_processor_component import CommandProcessorComponent +from rasa.dialogue_understanding.processor.command_processor_component import ( + CommandProcessorComponent, +) from rasa.plugin import plugin_manager from rasa.shared.exceptions import FileNotFoundException from rasa.core.policies.ensemble import DefaultPolicyPredictionEnsemble diff --git a/rasa/shared/importers/importer.py b/rasa/shared/importers/importer.py index 09a45aff359c..a03c92298940 100644 --- a/rasa/shared/importers/importer.py +++ b/rasa/shared/importers/importer.py @@ -391,7 +391,7 @@ def load_default_pattern_flows() -> FlowsList: from rasa.shared.core.flows.yaml_flows_io import YAMLFlowsReader default_flows_file = pkg_resources.resource_filename( - "rasa.cdu.patterns", DEFAULT_PATTERN_FLOWS_FILE_NAME + "rasa.dialogue_understanding.patterns", DEFAULT_PATTERN_FLOWS_FILE_NAME ) return YAMLFlowsReader.read_from_file(default_flows_file) @@ -400,7 +400,7 @@ def load_default_pattern_flows() -> FlowsList: def load_default_pattern_flows_domain() -> Domain: """Loads the default flows from the file system.""" default_flows_file = pkg_resources.resource_filename( - "rasa.cdu.patterns", DEFAULT_PATTERN_FLOWS_FILE_NAME + "rasa.dialogue_understanding.patterns", DEFAULT_PATTERN_FLOWS_FILE_NAME ) return Domain.from_path(default_flows_file) diff --git a/tests/cdu/commands/test_can_not_handle_command.py b/tests/cdu/commands/test_can_not_handle_command.py index 84f2df134b1d..d0aa676f020a 100644 --- a/tests/cdu/commands/test_can_not_handle_command.py +++ b/tests/cdu/commands/test_can_not_handle_command.py @@ -1,4 +1,6 @@ -from rasa.cdu.commands.can_not_handle_command import CannotHandleCommand +from rasa.dialogue_understanding.commands.can_not_handle_command import ( + CannotHandleCommand, +) from rasa.shared.core.events import UserUttered from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_cancel_flow_command.py b/tests/cdu/commands/test_cancel_flow_command.py index 58b290d217eb..0aa2ea74113a 100644 --- a/tests/cdu/commands/test_cancel_flow_command.py +++ b/tests/cdu/commands/test_cancel_flow_command.py @@ -1,10 +1,10 @@ import pytest -from rasa.cdu.commands.cancel_flow_command import CancelFlowCommand -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.commands.cancel_flow_command import CancelFlowCommand +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import UserFlowStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import UserFlowStackFrame from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import SlotSet from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_chit_chat_answer_command.py b/tests/cdu/commands/test_chit_chat_answer_command.py index e2a42bbfc4f4..b222f91780af 100644 --- a/tests/cdu/commands/test_chit_chat_answer_command.py +++ b/tests/cdu/commands/test_chit_chat_answer_command.py @@ -1,4 +1,6 @@ -from rasa.cdu.commands.chit_chat_answer_command import ChitChatAnswerCommand +from rasa.dialogue_understanding.commands.chit_chat_answer_command import ( + ChitChatAnswerCommand, +) from rasa.shared.core.events import SlotSet, UserUttered from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_clarify_command.py b/tests/cdu/commands/test_clarify_command.py index 47af776f8a5a..3dba7a707d1e 100644 --- a/tests/cdu/commands/test_clarify_command.py +++ b/tests/cdu/commands/test_clarify_command.py @@ -1,5 +1,5 @@ import pytest -from rasa.cdu.commands.clarify_command import ClarifyCommand +from rasa.dialogue_understanding.commands.clarify_command import ClarifyCommand from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import SlotSet from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_command.py b/tests/cdu/commands/test_command.py index a78eb367a28a..7235e23af7ca 100644 --- a/tests/cdu/commands/test_command.py +++ b/tests/cdu/commands/test_command.py @@ -1,6 +1,6 @@ import pytest -from rasa.cdu.commands.command import Command -from rasa.cdu.commands.set_slot_command import SetSlotCommand +from rasa.dialogue_understanding.commands.command import Command +from rasa.dialogue_understanding.commands.set_slot_command import SetSlotCommand def test_command_from_json(): diff --git a/tests/cdu/commands/test_correct_slots_command.py b/tests/cdu/commands/test_correct_slots_command.py index 5ce56eb8c8da..a0d5e8ef130d 100644 --- a/tests/cdu/commands/test_correct_slots_command.py +++ b/tests/cdu/commands/test_correct_slots_command.py @@ -1,12 +1,17 @@ from typing import Any, Dict, List import pytest -from rasa.cdu.commands.correct_slots_command import CorrectSlotsCommand, CorrectedSlot -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.commands.correct_slots_command import ( + CorrectSlotsCommand, + CorrectedSlot, +) +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.patterns.correction import CorrectionPatternFlowStackFrame -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import UserFlowStackFrame +from rasa.dialogue_understanding.patterns.correction import ( + CorrectionPatternFlowStackFrame, +) +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import UserFlowStackFrame from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import SlotSet from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_error_command.py b/tests/cdu/commands/test_error_command.py index 10e09157d736..187b4d37e98f 100644 --- a/tests/cdu/commands/test_error_command.py +++ b/tests/cdu/commands/test_error_command.py @@ -1,4 +1,4 @@ -from rasa.cdu.commands.error_command import ErrorCommand +from rasa.dialogue_understanding.commands.error_command import ErrorCommand from rasa.shared.core.events import SlotSet, UserUttered from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_human_handoff_command.py b/tests/cdu/commands/test_human_handoff_command.py index 3f9f0030a5fd..df4e274fbe28 100644 --- a/tests/cdu/commands/test_human_handoff_command.py +++ b/tests/cdu/commands/test_human_handoff_command.py @@ -1,4 +1,6 @@ -from rasa.cdu.commands.human_handoff_command import HumanHandoffCommand +from rasa.dialogue_understanding.commands.human_handoff_command import ( + HumanHandoffCommand, +) from rasa.shared.core.events import UserUttered from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_konwledge_answer_command.py b/tests/cdu/commands/test_konwledge_answer_command.py index 0ea12650df5e..6aa407f5e35e 100644 --- a/tests/cdu/commands/test_konwledge_answer_command.py +++ b/tests/cdu/commands/test_konwledge_answer_command.py @@ -1,4 +1,6 @@ -from rasa.cdu.commands.knowledge_answer_command import KnowledgeAnswerCommand +from rasa.dialogue_understanding.commands.knowledge_answer_command import ( + KnowledgeAnswerCommand, +) from rasa.shared.core.events import SlotSet, UserUttered from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/commands/test_set_slot_command.py b/tests/cdu/commands/test_set_slot_command.py index 00443cc06024..84e3867c2c0c 100644 --- a/tests/cdu/commands/test_set_slot_command.py +++ b/tests/cdu/commands/test_set_slot_command.py @@ -1,5 +1,5 @@ import pytest -from rasa.cdu.commands.set_slot_command import SetSlotCommand +from rasa.dialogue_understanding.commands.set_slot_command import SetSlotCommand from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import SlotSet from rasa.shared.core.flows.flow import FlowsList diff --git a/tests/cdu/commands/test_start_flow_command.py b/tests/cdu/commands/test_start_flow_command.py index f220421e136e..2ac2895b44d1 100644 --- a/tests/cdu/commands/test_start_flow_command.py +++ b/tests/cdu/commands/test_start_flow_command.py @@ -1,5 +1,5 @@ import pytest -from rasa.cdu.commands.start_flow_command import StartFlowCommand +from rasa.dialogue_understanding.commands.start_flow_command import StartFlowCommand from rasa.shared.core.constants import DIALOGUE_STACK_SLOT from rasa.shared.core.events import SlotSet from rasa.shared.core.trackers import DialogueStateTracker diff --git a/tests/cdu/stack/frames/test_chit_chat_frame.py b/tests/cdu/stack/frames/test_chit_chat_frame.py index 6adb5a699a2d..7e74ad1c87ad 100644 --- a/tests/cdu/stack/frames/test_chit_chat_frame.py +++ b/tests/cdu/stack/frames/test_chit_chat_frame.py @@ -1,4 +1,4 @@ -from rasa.cdu.stack.frames.chit_chat_frame import ChitChatStackFrame +from rasa.dialogue_understanding.stack.frames.chit_chat_frame import ChitChatStackFrame def test_chit_chat_frame_type(): diff --git a/tests/cdu/stack/frames/test_dialogue_stack_frame.py b/tests/cdu/stack/frames/test_dialogue_stack_frame.py index dc367e2f204a..155791aca2f9 100644 --- a/tests/cdu/stack/frames/test_dialogue_stack_frame.py +++ b/tests/cdu/stack/frames/test_dialogue_stack_frame.py @@ -2,7 +2,7 @@ from typing import Any, Dict import pytest -from rasa.cdu.stack.frames.dialogue_stack_frame import ( +from rasa.dialogue_understanding.stack.frames.dialogue_stack_frame import ( DialogueStackFrame, InvalidStackFrameType, generate_stack_frame_id, diff --git a/tests/cdu/stack/frames/test_flow_frame.py b/tests/cdu/stack/frames/test_flow_frame.py index 2e9fa8fd1221..3cf75fc4c96d 100644 --- a/tests/cdu/stack/frames/test_flow_frame.py +++ b/tests/cdu/stack/frames/test_flow_frame.py @@ -1,5 +1,5 @@ import pytest -from rasa.cdu.stack.frames.flow_stack_frame import ( +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import ( InvalidFlowIdException, InvalidFlowStackFrameType, InvalidFlowStepIdException, diff --git a/tests/cdu/stack/frames/test_search_frame.py b/tests/cdu/stack/frames/test_search_frame.py index 4e13118a29a7..249fc7e7697e 100644 --- a/tests/cdu/stack/frames/test_search_frame.py +++ b/tests/cdu/stack/frames/test_search_frame.py @@ -1,4 +1,4 @@ -from rasa.cdu.stack.frames.search_frame import SearchStackFrame +from rasa.dialogue_understanding.stack.frames.search_frame import SearchStackFrame def test_search_frame_type(): diff --git a/tests/cdu/stack/test_dialogue_stack.py b/tests/cdu/stack/test_dialogue_stack.py index c510f3626dbf..c5f36a3d0521 100644 --- a/tests/cdu/stack/test_dialogue_stack.py +++ b/tests/cdu/stack/test_dialogue_stack.py @@ -1,9 +1,9 @@ import dataclasses -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.flow_stack_frame import UserFlowStackFrame +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import UserFlowStackFrame def test_dialogue_stack_from_dict(): diff --git a/tests/cdu/stack/test_utils.py b/tests/cdu/stack/test_utils.py index 3b3adb8587aa..984be9ffc3b7 100644 --- a/tests/cdu/stack/test_utils.py +++ b/tests/cdu/stack/test_utils.py @@ -1,10 +1,10 @@ -from rasa.cdu.patterns.collect_information import ( +from rasa.dialogue_understanding.patterns.collect_information import ( CollectInformationPatternFlowStackFrame, ) -from rasa.cdu.stack.dialogue_stack import DialogueStack -from rasa.cdu.stack.frames.chit_chat_frame import ChitChatStackFrame -from rasa.cdu.stack.frames.flow_stack_frame import UserFlowStackFrame -from rasa.cdu.stack.utils import ( +from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack +from rasa.dialogue_understanding.stack.frames.chit_chat_frame import ChitChatStackFrame +from rasa.dialogue_understanding.stack.frames.flow_stack_frame import UserFlowStackFrame +from rasa.dialogue_understanding.stack.utils import ( filled_slots_for_active_flow, top_flow_frame, top_user_flow_frame,