diff --git a/docs/docs/action-server/knowledge-base-actions.mdx b/docs/docs/action-server/knowledge-base-actions.mdx index 538c79cdfdfc..956c854fe993 100644 --- a/docs/docs/action-server/knowledge-base-actions.mdx +++ b/docs/docs/action-server/knowledge-base-actions.mdx @@ -563,7 +563,7 @@ You can customize your `InMemoryKnowledgeBase` by overwriting the following func You can overwrite it by calling the function `set_ordinal_mention_mapping()`. If you want to learn more about how this mapping is used, check out [Resolve Mentions](./knowledge-base-actions.mdx#resolve-mentions). -See the [example bot](https://github.com/RasaHQ/rasa/blob/main/examples/knowledgebasebot/actions/actions.py) for an +See the [example bot](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/knowledgebasebot/actions/actions.py) for an example implementation of an `InMemoryKnowledgeBase` that uses the method `set_representation_function_of_object()` to overwrite the default representation of the object type “hotel.” The implementation of the `InMemoryKnowledgeBase` itself can be found in the diff --git a/docs/docs/domain.mdx b/docs/docs/domain.mdx index 471768d440fd..512ef26de260 100644 --- a/docs/docs/domain.mdx +++ b/docs/docs/domain.mdx @@ -6,9 +6,9 @@ abstract: The domain defines the universe in which your assistant operates. It s --- Here is a full example of a domain, taken from the -[concertbot](https://github.com/RasaHQ/rasa/tree/main/examples/concertbot) example: +[concertbot](https://github.com/RasaHQ/rasa/tree/main/examples/nlu_based/concertbot) example: -```yaml-rasa (docs/sources/examples/concertbot/domain.yml) +```yaml-rasa (docs/sources/examples/nlu_based/concertbot/domain.yml) ``` ## Multiple Domain Files diff --git a/docs/docs/reaching-out-to-user.mdx b/docs/docs/reaching-out-to-user.mdx index 66dfe1627f13..79e14e7e980b 100644 --- a/docs/docs/reaching-out-to-user.mdx +++ b/docs/docs/reaching-out-to-user.mdx @@ -62,7 +62,7 @@ Sometimes you want an external device to change the course of an ongoing convers For example, if you have a moisture-sensor attached to a Raspberry Pi, you could use it to notify you when a plant needs watering via your assistant. -The examples below are from the [reminderbot example bot](https://github.com/RasaHQ/rasa/blob/main/examples/reminderbot), +The examples below are from the [reminderbot example bot](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/reminderbot), which includes both reminders and external events. ### 1. Trigger an Intent @@ -90,7 +90,7 @@ In a real-life scenario, your external device would get the conversation ID from In the dry plant example, you might have a database of plants, the users that water them, and the users' conversation IDs. Your Raspberry Pi would get the conversation ID directly from the database. To try out the reminderbot example locally, you'll need to get the conversation ID manually. See -the reminderbot [README](https://github.com/RasaHQ/rasa/blob/main/examples/reminderbot) for more information. +the reminderbot [README](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/reminderbot) for more information. ### 3. Add NLU Training Data @@ -159,7 +159,7 @@ External Events and Reminders don't work in request-response channels like the ` Custom connectors for assistants implementing reminders or external events should be built off of the [CallbackInput channel](./connectors/your-own-website.mdx#callbackinput) instead of the RestInput channel. -See the [reminderbot README](https://github.com/RasaHQ/rasa/blob/main/examples/reminderbot/README.md) +See the [reminderbot README](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/reminderbot/README.md) for instructions on how to test your reminders locally. ::: @@ -180,7 +180,7 @@ You should see the bot respond in your channel: ## Reminders You can have your assistant reach out to the user after a set amount of time by using [Reminders](./action-server/events.mdx#reminder). -The examples below are from the [reminderbot example bot](https://github.com/RasaHQ/rasa/blob/main/examples/reminderbot). +The examples below are from the [reminderbot example bot](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/reminderbot). You can clone it and follow the instructions in `README` to try out the full version. ### Scheduling Reminders @@ -432,7 +432,7 @@ intents: To try out reminders you'll need to start a [CallbackChannel](./connectors/your-own-website.mdx#callbackinput). You'll also need to start the action server to schedule, react to, and cancel your reminders. -See the [reminderbot README](https://github.com/RasaHQ/rasa/blob/main/examples/reminderbot) for details. +See the [reminderbot README](https://github.com/RasaHQ/rasa/blob/main/examples/nlu_based/reminderbot) for details. Then, if you send the bot a message like `Remind me to call Paul Pots`, you should get a reminder back five minutes later that says `Remember to call Paul Pots!`. diff --git a/docs/package.json b/docs/package.json index 2361812f890d..8c1d8c01bf4c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -115,7 +115,9 @@ "\\.prototyping\\.rasa\\.com", "^https://github\\.com/mit-nlp/MITIE/releases/download/v0\\.4/MITIE-models-v0\\.2\\.tar\\.bz2$", "^https://forum.rasa.com/t/rasa-open-source-2-0-is-out-now-internal-draft/35577$", - "https://docs-test-001.openai.azure.com" + "https://docs-test-001.openai.azure.com", + "^https://github.com/RasaHQ/rasa/tree/main/examples/*", + "^https://github.com/RasaHQ/rasa/blob/main/examples/*" ] } ] diff --git a/examples/money_transfer/actions.py b/examples/money_transfer/actions.py new file mode 100644 index 000000000000..508083283686 --- /dev/null +++ b/examples/money_transfer/actions.py @@ -0,0 +1,19 @@ +from typing import Any, Text, Dict, List +from rasa_sdk import Action, Tracker +from rasa_sdk.executor import CollectingDispatcher +from rasa_sdk.events import SlotSet + +class ActionCheckSufficientFunds(Action): + def name(self) -> Text: + return "action_check_sufficient_funds" + + def run(self, dispatcher: CollectingDispatcher, + tracker: Tracker, + domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: + balance = 1000 # hard-coded for tutorial purposes + # a real api call would look something like + # result = requests.get("https://example.com/api/balance") + # balance = result.json()["balance"] + transfer_amount = tracker.get_slot("amount") + has_sufficient_funds = transfer_amount <= balance + return [SlotSet("has_sufficient_funds", has_sufficient_funds)] diff --git a/examples/money_transfer/config.yml b/examples/money_transfer/config.yml new file mode 100644 index 000000000000..3801f4a2c879 --- /dev/null +++ b/examples/money_transfer/config.yml @@ -0,0 +1,13 @@ +recipe: default.v1 +language: en +pipeline: + - name: LLMCommandGenerator + llm: + model_name: gpt-4 + +policies: + - name: rasa.core.policies.flow_policy.FlowPolicy +# - name: rasa_plus.ml.DocsearchPolicy +# - name: RulePolicy + +assistant_id: 20230405-114328-tranquil-mustard diff --git a/examples/money_transfer/data/flows.yml b/examples/money_transfer/data/flows.yml new file mode 100644 index 000000000000..76ecae6e6e5d --- /dev/null +++ b/examples/money_transfer/data/flows.yml @@ -0,0 +1,23 @@ +flows: + transfer_money: + description: This flow lets users send money to friends and family. + steps: + - collect: recipient + - collect: amount + - action: action_check_sufficient_funds + next: + - if: not has_sufficient_funds + then: + - action: utter_insufficient_funds + next: END + - else: final_confirmation + - id: final_confirmation + collect: final_confirmation + next: + - if: not final_confirmation + then: + - action: utter_transfer_cancelled + next: END + - else: transfer_successful + - id: transfer_successful + action: utter_transfer_complete diff --git a/examples/money_transfer/domain.yml b/examples/money_transfer/domain.yml new file mode 100644 index 000000000000..6d2cd6f1304c --- /dev/null +++ b/examples/money_transfer/domain.yml @@ -0,0 +1,43 @@ +version: "3.1" + +slots: + recipient: + type: text + mappings: + - type: custom + amount: + type: float + mappings: + - type: custom + final_confirmation: + type: bool + mappings: + - type: custom + has_sufficient_funds: + type: bool + mappings: + - type: custom + +responses: + utter_ask_recipient: + - text: "Who would you like to send money to?" + + utter_ask_amount: + - text: "How much money would you like to send?" + + utter_transfer_complete: + - text: "All done. ${amount} has been sent to {recipient}." + + utter_ask_final_confirmation: + - text: "Please confirm: you want to transfer ${amount} to {recipient}?" + + utter_transfer_cancelled: + - text: "Your transfer has been cancelled." + + utter_insufficient_funds: + - text: "You do not have enough funds to make this transaction." + + + +actions: + - action_check_sufficient_funds diff --git a/examples/money_transfer/e2e_tests/complete_request.yml b/examples/money_transfer/e2e_tests/complete_request.yml new file mode 100644 index 000000000000..99072cb957c9 --- /dev/null +++ b/examples/money_transfer/e2e_tests/complete_request.yml @@ -0,0 +1,7 @@ +test_cases: + - test_case: user corrects recipient in the next message + steps: + - user: I want to send 400 dollars to James + - utter: utter_ask_final_confirmation + - user: yes + - utter: utter_transfer_complete diff --git a/examples/reminderbot/endpoints.yml b/examples/money_transfer/endpoints.yml similarity index 100% rename from examples/reminderbot/endpoints.yml rename to examples/money_transfer/endpoints.yml diff --git a/examples/concertbot/actions/__init__.py b/examples/nlu_based/__init__.py similarity index 100% rename from examples/concertbot/actions/__init__.py rename to examples/nlu_based/__init__.py diff --git a/examples/concertbot/README.md b/examples/nlu_based/concertbot/README.md similarity index 100% rename from examples/concertbot/README.md rename to examples/nlu_based/concertbot/README.md diff --git a/examples/formbot/actions/__init__.py b/examples/nlu_based/concertbot/actions/__init__.py similarity index 100% rename from examples/formbot/actions/__init__.py rename to examples/nlu_based/concertbot/actions/__init__.py diff --git a/examples/concertbot/actions/actions.py b/examples/nlu_based/concertbot/actions/actions.py similarity index 100% rename from examples/concertbot/actions/actions.py rename to examples/nlu_based/concertbot/actions/actions.py diff --git a/examples/concertbot/config.yml b/examples/nlu_based/concertbot/config.yml similarity index 100% rename from examples/concertbot/config.yml rename to examples/nlu_based/concertbot/config.yml diff --git a/examples/concertbot/data/nlu.yml b/examples/nlu_based/concertbot/data/nlu.yml similarity index 100% rename from examples/concertbot/data/nlu.yml rename to examples/nlu_based/concertbot/data/nlu.yml diff --git a/examples/concertbot/data/rules.yml b/examples/nlu_based/concertbot/data/rules.yml similarity index 100% rename from examples/concertbot/data/rules.yml rename to examples/nlu_based/concertbot/data/rules.yml diff --git a/examples/concertbot/data/stories.yml b/examples/nlu_based/concertbot/data/stories.yml similarity index 100% rename from examples/concertbot/data/stories.yml rename to examples/nlu_based/concertbot/data/stories.yml diff --git a/examples/concertbot/domain.yml b/examples/nlu_based/concertbot/domain.yml similarity index 100% rename from examples/concertbot/domain.yml rename to examples/nlu_based/concertbot/domain.yml diff --git a/examples/concertbot/endpoints.yml b/examples/nlu_based/concertbot/endpoints.yml similarity index 100% rename from examples/concertbot/endpoints.yml rename to examples/nlu_based/concertbot/endpoints.yml diff --git a/examples/e2ebot/config.yml b/examples/nlu_based/e2ebot/config.yml similarity index 100% rename from examples/e2ebot/config.yml rename to examples/nlu_based/e2ebot/config.yml diff --git a/examples/e2ebot/data/nlu.yml b/examples/nlu_based/e2ebot/data/nlu.yml similarity index 100% rename from examples/e2ebot/data/nlu.yml rename to examples/nlu_based/e2ebot/data/nlu.yml diff --git a/examples/e2ebot/data/stories.yml b/examples/nlu_based/e2ebot/data/stories.yml similarity index 100% rename from examples/e2ebot/data/stories.yml rename to examples/nlu_based/e2ebot/data/stories.yml diff --git a/examples/e2ebot/domain.yml b/examples/nlu_based/e2ebot/domain.yml similarity index 100% rename from examples/e2ebot/domain.yml rename to examples/nlu_based/e2ebot/domain.yml diff --git a/examples/e2ebot/tests/test_stories.yml b/examples/nlu_based/e2ebot/tests/test_stories.yml similarity index 100% rename from examples/e2ebot/tests/test_stories.yml rename to examples/nlu_based/e2ebot/tests/test_stories.yml diff --git a/examples/formbot/README.md b/examples/nlu_based/formbot/README.md similarity index 100% rename from examples/formbot/README.md rename to examples/nlu_based/formbot/README.md diff --git a/examples/knowledgebasebot/actions/__init__.py b/examples/nlu_based/formbot/actions/__init__.py similarity index 100% rename from examples/knowledgebasebot/actions/__init__.py rename to examples/nlu_based/formbot/actions/__init__.py diff --git a/examples/formbot/actions/actions.py b/examples/nlu_based/formbot/actions/actions.py similarity index 100% rename from examples/formbot/actions/actions.py rename to examples/nlu_based/formbot/actions/actions.py diff --git a/examples/formbot/config.yml b/examples/nlu_based/formbot/config.yml similarity index 100% rename from examples/formbot/config.yml rename to examples/nlu_based/formbot/config.yml diff --git a/examples/formbot/data/nlu.yml b/examples/nlu_based/formbot/data/nlu.yml similarity index 100% rename from examples/formbot/data/nlu.yml rename to examples/nlu_based/formbot/data/nlu.yml diff --git a/examples/formbot/data/rules.yml b/examples/nlu_based/formbot/data/rules.yml similarity index 100% rename from examples/formbot/data/rules.yml rename to examples/nlu_based/formbot/data/rules.yml diff --git a/examples/formbot/data/stories.yml b/examples/nlu_based/formbot/data/stories.yml similarity index 100% rename from examples/formbot/data/stories.yml rename to examples/nlu_based/formbot/data/stories.yml diff --git a/examples/formbot/domain.yml b/examples/nlu_based/formbot/domain.yml similarity index 100% rename from examples/formbot/domain.yml rename to examples/nlu_based/formbot/domain.yml diff --git a/examples/formbot/endpoints.yml b/examples/nlu_based/formbot/endpoints.yml similarity index 100% rename from examples/formbot/endpoints.yml rename to examples/nlu_based/formbot/endpoints.yml diff --git a/examples/formbot/tests/test_stories.yml b/examples/nlu_based/formbot/tests/test_stories.yml similarity index 100% rename from examples/formbot/tests/test_stories.yml rename to examples/nlu_based/formbot/tests/test_stories.yml diff --git a/examples/knowledgebasebot/README.md b/examples/nlu_based/knowledgebasebot/README.md similarity index 100% rename from examples/knowledgebasebot/README.md rename to examples/nlu_based/knowledgebasebot/README.md diff --git a/examples/reminderbot/actions/__init__.py b/examples/nlu_based/knowledgebasebot/actions/__init__.py similarity index 100% rename from examples/reminderbot/actions/__init__.py rename to examples/nlu_based/knowledgebasebot/actions/__init__.py diff --git a/examples/knowledgebasebot/actions/actions.py b/examples/nlu_based/knowledgebasebot/actions/actions.py similarity index 100% rename from examples/knowledgebasebot/actions/actions.py rename to examples/nlu_based/knowledgebasebot/actions/actions.py diff --git a/examples/knowledgebasebot/config.yml b/examples/nlu_based/knowledgebasebot/config.yml similarity index 100% rename from examples/knowledgebasebot/config.yml rename to examples/nlu_based/knowledgebasebot/config.yml diff --git a/examples/knowledgebasebot/data/nlu.yml b/examples/nlu_based/knowledgebasebot/data/nlu.yml similarity index 100% rename from examples/knowledgebasebot/data/nlu.yml rename to examples/nlu_based/knowledgebasebot/data/nlu.yml diff --git a/examples/knowledgebasebot/data/rules.yml b/examples/nlu_based/knowledgebasebot/data/rules.yml similarity index 100% rename from examples/knowledgebasebot/data/rules.yml rename to examples/nlu_based/knowledgebasebot/data/rules.yml diff --git a/examples/knowledgebasebot/data/stories.yml b/examples/nlu_based/knowledgebasebot/data/stories.yml similarity index 100% rename from examples/knowledgebasebot/data/stories.yml rename to examples/nlu_based/knowledgebasebot/data/stories.yml diff --git a/examples/knowledgebasebot/domain.yml b/examples/nlu_based/knowledgebasebot/domain.yml similarity index 100% rename from examples/knowledgebasebot/domain.yml rename to examples/nlu_based/knowledgebasebot/domain.yml diff --git a/examples/knowledgebasebot/endpoints.yml b/examples/nlu_based/knowledgebasebot/endpoints.yml similarity index 100% rename from examples/knowledgebasebot/endpoints.yml rename to examples/nlu_based/knowledgebasebot/endpoints.yml diff --git a/examples/knowledgebasebot/knowledge_base_data.json b/examples/nlu_based/knowledgebasebot/knowledge_base_data.json similarity index 100% rename from examples/knowledgebasebot/knowledge_base_data.json rename to examples/nlu_based/knowledgebasebot/knowledge_base_data.json diff --git a/examples/moodbot/README.md b/examples/nlu_based/moodbot/README.md similarity index 100% rename from examples/moodbot/README.md rename to examples/nlu_based/moodbot/README.md diff --git a/examples/moodbot/config.yml b/examples/nlu_based/moodbot/config.yml similarity index 100% rename from examples/moodbot/config.yml rename to examples/nlu_based/moodbot/config.yml diff --git a/examples/moodbot/credentials.yml b/examples/nlu_based/moodbot/credentials.yml similarity index 100% rename from examples/moodbot/credentials.yml rename to examples/nlu_based/moodbot/credentials.yml diff --git a/examples/moodbot/data/nlu.yml b/examples/nlu_based/moodbot/data/nlu.yml similarity index 100% rename from examples/moodbot/data/nlu.yml rename to examples/nlu_based/moodbot/data/nlu.yml diff --git a/examples/moodbot/data/rules.yml b/examples/nlu_based/moodbot/data/rules.yml similarity index 100% rename from examples/moodbot/data/rules.yml rename to examples/nlu_based/moodbot/data/rules.yml diff --git a/examples/moodbot/data/stories.yml b/examples/nlu_based/moodbot/data/stories.yml similarity index 100% rename from examples/moodbot/data/stories.yml rename to examples/nlu_based/moodbot/data/stories.yml diff --git a/examples/moodbot/domain.yml b/examples/nlu_based/moodbot/domain.yml similarity index 100% rename from examples/moodbot/domain.yml rename to examples/nlu_based/moodbot/domain.yml diff --git a/examples/reminderbot/README.md b/examples/nlu_based/reminderbot/README.md similarity index 100% rename from examples/reminderbot/README.md rename to examples/nlu_based/reminderbot/README.md diff --git a/examples/rules/actions/__init__.py b/examples/nlu_based/reminderbot/actions/__init__.py similarity index 100% rename from examples/rules/actions/__init__.py rename to examples/nlu_based/reminderbot/actions/__init__.py diff --git a/examples/reminderbot/actions/actions.py b/examples/nlu_based/reminderbot/actions/actions.py similarity index 100% rename from examples/reminderbot/actions/actions.py rename to examples/nlu_based/reminderbot/actions/actions.py diff --git a/examples/reminderbot/callback_server.py b/examples/nlu_based/reminderbot/callback_server.py similarity index 100% rename from examples/reminderbot/callback_server.py rename to examples/nlu_based/reminderbot/callback_server.py diff --git a/examples/reminderbot/config.yml b/examples/nlu_based/reminderbot/config.yml similarity index 100% rename from examples/reminderbot/config.yml rename to examples/nlu_based/reminderbot/config.yml diff --git a/examples/reminderbot/credentials.yml b/examples/nlu_based/reminderbot/credentials.yml similarity index 100% rename from examples/reminderbot/credentials.yml rename to examples/nlu_based/reminderbot/credentials.yml diff --git a/examples/reminderbot/data/nlu.yml b/examples/nlu_based/reminderbot/data/nlu.yml similarity index 100% rename from examples/reminderbot/data/nlu.yml rename to examples/nlu_based/reminderbot/data/nlu.yml diff --git a/examples/reminderbot/data/rules.yml b/examples/nlu_based/reminderbot/data/rules.yml similarity index 100% rename from examples/reminderbot/data/rules.yml rename to examples/nlu_based/reminderbot/data/rules.yml diff --git a/examples/reminderbot/data/stories.yml b/examples/nlu_based/reminderbot/data/stories.yml similarity index 100% rename from examples/reminderbot/data/stories.yml rename to examples/nlu_based/reminderbot/data/stories.yml diff --git a/examples/reminderbot/domain.yml b/examples/nlu_based/reminderbot/domain.yml similarity index 100% rename from examples/reminderbot/domain.yml rename to examples/nlu_based/reminderbot/domain.yml diff --git a/examples/nlu_based/reminderbot/endpoints.yml b/examples/nlu_based/reminderbot/endpoints.yml new file mode 100644 index 000000000000..5f65275b8802 --- /dev/null +++ b/examples/nlu_based/reminderbot/endpoints.yml @@ -0,0 +1,42 @@ +# This file contains the different endpoints your bot can use. + +# Server where the models are pulled from. +# https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server + +#models: +# url: http://my-server.com/models/default_core@latest +# wait_time_between_pulls: 10 # [optional](default: 100) + +# Server which runs your custom actions. +# https://rasa.com/docs/rasa/custom-actions + +action_endpoint: + url: "http://localhost:5055/webhook" + +# Tracker store which is used to store the conversations. +# By default the conversations are stored in memory. +# https://rasa.com/docs/rasa/tracker-stores + +#tracker_store: +# type: redis +# url: +# port: +# db: +# password: +# use_ssl: + +#tracker_store: +# type: mongod +# url: +# db: +# username: +# password: + +# Event broker which all conversation events should be streamed to. +# https://rasa.com/docs/rasa/event-brokers + +#event_broker: +# url: localhost +# username: username +# password: password +# queue: queue diff --git a/examples/responseselectorbot/README.md b/examples/nlu_based/responseselectorbot/README.md similarity index 100% rename from examples/responseselectorbot/README.md rename to examples/nlu_based/responseselectorbot/README.md diff --git a/examples/responseselectorbot/config.yml b/examples/nlu_based/responseselectorbot/config.yml similarity index 100% rename from examples/responseselectorbot/config.yml rename to examples/nlu_based/responseselectorbot/config.yml diff --git a/examples/responseselectorbot/data/nlu.yml b/examples/nlu_based/responseselectorbot/data/nlu.yml similarity index 100% rename from examples/responseselectorbot/data/nlu.yml rename to examples/nlu_based/responseselectorbot/data/nlu.yml diff --git a/examples/responseselectorbot/data/rules.yml b/examples/nlu_based/responseselectorbot/data/rules.yml similarity index 100% rename from examples/responseselectorbot/data/rules.yml rename to examples/nlu_based/responseselectorbot/data/rules.yml diff --git a/examples/responseselectorbot/data/stories.yml b/examples/nlu_based/responseselectorbot/data/stories.yml similarity index 100% rename from examples/responseselectorbot/data/stories.yml rename to examples/nlu_based/responseselectorbot/data/stories.yml diff --git a/examples/responseselectorbot/domain.yml b/examples/nlu_based/responseselectorbot/domain.yml similarity index 100% rename from examples/responseselectorbot/domain.yml rename to examples/nlu_based/responseselectorbot/domain.yml diff --git a/examples/nlu_based/rules/actions/__init__.py b/examples/nlu_based/rules/actions/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/examples/rules/actions/actions.py b/examples/nlu_based/rules/actions/actions.py similarity index 100% rename from examples/rules/actions/actions.py rename to examples/nlu_based/rules/actions/actions.py diff --git a/examples/rules/config.yml b/examples/nlu_based/rules/config.yml similarity index 100% rename from examples/rules/config.yml rename to examples/nlu_based/rules/config.yml diff --git a/examples/rules/data/nlu.yml b/examples/nlu_based/rules/data/nlu.yml similarity index 100% rename from examples/rules/data/nlu.yml rename to examples/nlu_based/rules/data/nlu.yml diff --git a/examples/rules/data/rules.yml b/examples/nlu_based/rules/data/rules.yml similarity index 100% rename from examples/rules/data/rules.yml rename to examples/nlu_based/rules/data/rules.yml diff --git a/examples/rules/domain.yml b/examples/nlu_based/rules/domain.yml similarity index 100% rename from examples/rules/domain.yml rename to examples/nlu_based/rules/domain.yml diff --git a/examples/rules/endpoints.yml b/examples/nlu_based/rules/endpoints.yml similarity index 100% rename from examples/rules/endpoints.yml rename to examples/nlu_based/rules/endpoints.yml diff --git a/rasa/cli/project_templates/tutorial/data/flows.yml b/rasa/cli/project_templates/tutorial/data/flows.yml index 040a96b776f1..d849432a00e6 100644 --- a/rasa/cli/project_templates/tutorial/data/flows.yml +++ b/rasa/cli/project_templates/tutorial/data/flows.yml @@ -2,11 +2,6 @@ flows: transfer_money: description: This flow lets users send money to friends and family. steps: - - id: "ask_recipient" - collect: recipient - next: "ask_amount" - - id: "ask_amount" - collect: amount - next: "transfer_successful" - - id: "transfer_successful" - action: utter_transfer_complete + - collect: recipient + - collect: amount + - action: utter_transfer_complete diff --git a/tests/core/conftest.py b/tests/core/conftest.py index ff69c4acec19..1da3c380e10d 100644 --- a/tests/core/conftest.py +++ b/tests/core/conftest.py @@ -135,11 +135,11 @@ def default_tracker(domain: Domain) -> DialogueStateTracker: @pytest.fixture(scope="session") async def trained_formbot(trained_async: Callable) -> Text: return await trained_async( - domain="examples/formbot/domain.yml", - config="examples/formbot/config.yml", + domain="examples/nlu_based/formbot/domain.yml", + config="examples/nlu_based/formbot/config.yml", training_files=[ - "examples/formbot/data/rules.yml", - "examples/formbot/data/stories.yml", + "examples/nlu_based/formbot/data/rules.yml", + "examples/nlu_based/formbot/data/stories.yml", ], ) diff --git a/tests/core/policies/test_rule_policy.py b/tests/core/policies/test_rule_policy.py index 945a6717a826..9fa5cdee415c 100644 --- a/tests/core/policies/test_rule_policy.py +++ b/tests/core/policies/test_rule_policy.py @@ -758,7 +758,7 @@ def test_rule_policy_finetune( ) original_data = training.load_data( - "examples/rules/data/rules.yml", trained_rule_policy_domain + "examples/nlu_based/rules/data/rules.yml", trained_rule_policy_domain ) loaded_policy.train(original_data + [new_rule], trained_rule_policy_domain) @@ -805,7 +805,7 @@ def test_rule_policy_contradicting_rule_finetune( ) original_data = training.load_data( - "examples/rules/data/rules.yml", trained_rule_policy_domain + "examples/nlu_based/rules/data/rules.yml", trained_rule_policy_domain ) with pytest.raises(InvalidRule) as execinfo: @@ -1847,7 +1847,7 @@ def test_immediate_submit(policy: RulePolicy): @pytest.fixture() def trained_rule_policy_domain() -> Domain: - return Domain.load("examples/rules/domain.yml") + return Domain.load("examples/nlu_based/rules/domain.yml") @pytest.fixture() @@ -1855,7 +1855,7 @@ def trained_rule_policy( trained_rule_policy_domain: Domain, policy: RulePolicy ) -> RulePolicy: trackers = training.load_data( - "examples/rules/data/rules.yml", trained_rule_policy_domain + "examples/nlu_based/rules/data/rules.yml", trained_rule_policy_domain ) policy.train(trackers, trained_rule_policy_domain) diff --git a/tests/dialogues.py b/tests/dialogues.py index 412326cc3baf..d2deefb3559c 100644 --- a/tests/dialogues.py +++ b/tests/dialogues.py @@ -272,6 +272,6 @@ TEST_DOMAINS_FOR_DIALOGUES = [ "data/test_domains/default_with_slots.yml", - "examples/formbot/domain.yml", + "examples/nlu_based/formbot/domain.yml", "data/test_moodbot/domain.yml", ] diff --git a/tests/examples/test_example_bots_training_data.py b/tests/examples/test_example_bots_training_data.py index f5790582afb1..e77b7df48990 100644 --- a/tests/examples/test_example_bots_training_data.py +++ b/tests/examples/test_example_bots_training_data.py @@ -14,23 +14,23 @@ "config_file, domain_file, data_folder, raise_slot_warning, msg", [ ( - "examples/concertbot/config.yml", - "examples/concertbot/domain.yml", - "examples/concertbot/data", + "examples/nlu_based/concertbot/config.yml", + "examples/nlu_based/concertbot/domain.yml", + "examples/nlu_based/concertbot/data", True, None, ), ( - "examples/formbot/config.yml", - "examples/formbot/domain.yml", - "examples/formbot/data", + "examples/nlu_based/formbot/config.yml", + "examples/nlu_based/formbot/domain.yml", + "examples/nlu_based/formbot/data", True, None, ), ( - "examples/knowledgebasebot/config.yml", - "examples/knowledgebasebot/domain.yml", - "examples/knowledgebasebot/data", + "examples/nlu_based/knowledgebasebot/config.yml", + "examples/nlu_based/knowledgebasebot/domain.yml", + "examples/nlu_based/knowledgebasebot/data", True, "You are using an experimental feature: " "Action 'action_query_knowledge_base'!", @@ -43,16 +43,16 @@ None, ), ( - "examples/reminderbot/config.yml", - "examples/reminderbot/domain.yml", - "examples/reminderbot/data", + "examples/nlu_based/reminderbot/config.yml", + "examples/nlu_based/reminderbot/domain.yml", + "examples/nlu_based/reminderbot/data", True, None, ), ( - "examples/rules/config.yml", - "examples/rules/domain.yml", - "examples/rules/data", + "examples/nlu_based/rules/config.yml", + "examples/nlu_based/rules/domain.yml", + "examples/nlu_based/rules/data", True, None, ), diff --git a/tests/graph_components/providers/test_domain_for_core_training_provider.py b/tests/graph_components/providers/test_domain_for_core_training_provider.py index 52e5b7eecb32..0f08ab6b921a 100644 --- a/tests/graph_components/providers/test_domain_for_core_training_provider.py +++ b/tests/graph_components/providers/test_domain_for_core_training_provider.py @@ -98,7 +98,7 @@ def test_train_core_with_original_or_provided_domain_and_compare( default_execution_context: ExecutionContext, ): # Choose an example where the provider will remove a lot of information: - example = Path("examples/formbot/") + example = Path("examples/nlu_based/formbot/") training_files = [example / "data" / "rules.yml"] # Choose a configuration with a policy diff --git a/tests/graph_components/providers/test_rule_only_provider.py b/tests/graph_components/providers/test_rule_only_provider.py index 98100f36a85c..19393fbf3ede 100644 --- a/tests/graph_components/providers/test_rule_only_provider.py +++ b/tests/graph_components/providers/test_rule_only_provider.py @@ -13,8 +13,10 @@ def test_provide( ): resource = Resource("some resource") - domain = Domain.load("examples/rules/domain.yml") - trackers = rasa.core.training.load_data("examples/rules/data/rules.yml", domain) + domain = Domain.load("examples/nlu_based/rules/domain.yml") + trackers = rasa.core.training.load_data( + "examples/nlu_based/rules/data/rules.yml", domain + ) policy = RulePolicy.create( RulePolicy.get_default_config(), diff --git a/tests/shared/core/test_slot_mappings.py b/tests/shared/core/test_slot_mappings.py index 7e67f388b102..152620a225da 100644 --- a/tests/shared/core/test_slot_mappings.py +++ b/tests/shared/core/test_slot_mappings.py @@ -28,7 +28,7 @@ def test_slot_mapping_entity_is_desired(slot_name: Text, expected: bool): def test_slot_mapping_intent_is_desired(domain: Domain): - domain = Domain.from_file("examples/formbot/domain.yml") + domain = Domain.from_file("examples/nlu_based/formbot/domain.yml") tracker = DialogueStateTracker("sender_id_test", slots=domain.slots) event1 = UserUttered( text="I'd like to book a restaurant for 2 people.", diff --git a/tests/test_validator.py b/tests/test_validator.py index d901d73fb333..1e7e93b9098c 100644 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -347,7 +347,7 @@ def test_early_exit_on_invalid_domain(): def test_verify_there_is_not_example_repetition_in_intents(): importer = RasaFileImporter( domain_path="data/test_moodbot/domain.yml", - training_data_paths=["examples/knowledgebasebot/data/nlu.yml"], + training_data_paths=["examples/nlu_based/knowledgebasebot/data/nlu.yml"], ) validator = Validator.from_importer(importer) # force validator to not ignore warnings (default is True)