diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index dc1fbbe3f046..13fc9bd19b27 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -861,7 +861,7 @@ jobs: uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0 + uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.7.0 - name: Read Poetry Version 🔢 run: | @@ -1046,7 +1046,7 @@ jobs: uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0 + uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.7.0 - name: Free disk space if: needs.changes.outputs.docker == 'true' diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml index 93c1008da5f3..4521fbf34474 100644 --- a/.github/workflows/nightly_release.yml +++ b/.github/workflows/nightly_release.yml @@ -141,7 +141,7 @@ jobs: shell: bash - name: Set up Docker Buildx - uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c + uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 id: buildx with: version: v0.5.1 diff --git a/CHANGELOG.mdx b/CHANGELOG.mdx index a7f7ef724426..5c8847ad6904 100644 --- a/CHANGELOG.mdx +++ b/CHANGELOG.mdx @@ -16,6 +16,27 @@ https://github.com/RasaHQ/rasa/tree/main/changelog/ . --> +## [3.6.8] - 2023-08-30 + +Rasa 3.6.8 (2023-08-30) + +No significant changes. + + +## [3.6.7] - 2023-08-29 + +Rasa 3.6.7 (2023-08-29) +### Bugfixes +- [#12768](https://github.com/rasahq/rasa/issues/12768): Updated certifi, cryptography, and scipy packages to address security vulnerabilities. + + +## [3.6.6] - 2023-08-23 + +Rasa 3.6.6 (2023-08-23) +### Bugfixes +- [#12755](https://github.com/rasahq/rasa/issues/12755): Updated setuptools and wheel to address security vulnerabilities. + + ## [3.6.5] - 2023-08-17 Rasa 3.6.5 (2023-08-17) diff --git a/changelog/12778.improvement.md b/changelog/12778.improvement.md new file mode 100644 index 000000000000..3981d7da3d8b --- /dev/null +++ b/changelog/12778.improvement.md @@ -0,0 +1 @@ +Added additional method `fingerprint_addon` to the `GraphComponent` interface to allow inclusion of external data into the fingerprint calculation of a component \ No newline at end of file diff --git a/changelog/12790.bugfix.md b/changelog/12790.bugfix.md new file mode 100644 index 000000000000..4715d8ac618a --- /dev/null +++ b/changelog/12790.bugfix.md @@ -0,0 +1 @@ +Fixed `KeyError` which resulted when `domain_responses` doesn't exist as a keyword argument while using a custom action dispatcher with nlg server. \ No newline at end of file diff --git a/data/test_classes/graph_component_interface.py b/data/test_classes/graph_component_interface.py index f4d2d005bef3..90beddd3fe63 100644 --- a/data/test_classes/graph_component_interface.py +++ b/data/test_classes/graph_component_interface.py @@ -99,3 +99,12 @@ def not_supported_languages() -> Optional[List[Text]]: def required_packages() -> List[Text]: """Any extra python dependencies required for this component to run.""" return [] + + @classmethod + def fingerprint_addon(cls, config: Dict[str, Any]) -> Optional[str]: + """Adds additional data to the fingerprint calculation. + + This is useful if a component uses external data that is not provided + by the graph. + """ + return None diff --git a/docs/docs/installation/installing-rasa-open-source.mdx b/docs/docs/installation/installing-rasa-open-source.mdx index b94051f93f4c..1a87e35696a1 100644 --- a/docs/docs/installation/installing-rasa-open-source.mdx +++ b/docs/docs/installation/installing-rasa-open-source.mdx @@ -9,19 +9,6 @@ import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import { Button } from "@theme/Button"; -:::note Want to explore first? -You can explore Rasa Open Source online using the Rasa Playground even before you install it. -At the end of the tutorial, you can download the resulting assistant, install Rasa on -your machine and continue development locally. - - - Rasa Playground - -::: - ## Install Rasa Open Source @@ -147,7 +134,7 @@ python3 -m spacy download en_core_web_md :::tip Using `zsh`? -In zsh, square brackets are interpreted as patterns on the command line. +In zsh, square brackets are interpreted as patterns on the command line. To run commands with square brackets, you can either enclose the arguments with square brackets in quotes, like `pip3 install 'rasa[spacy]'`, or escape the square brackets using backslashes, like `pip3 install rasa\[spacy\]`. diff --git a/docs/docs/playground.mdx b/docs/docs/playground.mdx deleted file mode 100644 index ea4f19d3f0e3..000000000000 --- a/docs/docs/playground.mdx +++ /dev/null @@ -1,267 +0,0 @@ ---- -id: playground -sidebar_label: "Rasa Playground" -title: "Rasa Playground" -abstract: Learn the basics of building an assistant with Rasa with this interactive guide. You will be able to customize the assistant, talk to it and download the project so you can continue to build. -hide_table_of_contents: true ---- - -import useBaseUrl from "@docusaurus/useBaseUrl"; -import Prototyper, { DownloadButton, TrainButton } from "@theme/Prototyper"; -import AssistantBuilder from "@theme/AssistantBuilder"; - - - -## Build your assistant - -In this guide, we are creating an assistant that helps users subscribe to a newsletter. Go through each of the steps below to see how a simple assistant is created: - - - - - -What are the various things people might say to an assistant that can help them subscribe to a newsletter? - -For an assistant to recognize what a user is saying no matter how the user phrases their message, we need to provide example messages the assistant can learn from. -We group these examples according to the idea or the goal the message is expressing, which is also called the intent. -In the code block on the right, we have added an intent called greet, which contains example -messages like “Hi”, “Hey”, and “good morning”. - -Intents and their examples are used as training data for the assistant's Natural Language Understanding (NLU) model. - -[Learn more about NLU data and its format](./training-data-format.mdx) - - - - -```yaml-rasa live noResult assistantBuilder name=nlu -nlu: -- intent: greet - examples: | - - Hi - - Hey! - - Hallo - - Good day - - Good morning - -- intent: subscribe - examples: | - - I want to get the newsletter - - Can you send me the newsletter? - - Can you sign me up for the newsletter? - -- intent: inform - examples: | - - My email is example@example.com - - random@example.com - - Please send it to anything@example.com - - Email is something@example.com -``` - - - - - - - -Now that the assistant understands a few messages users might say, it needs responses it can send back to the user. - -“Hello, how can I help you?” and “what’s your email address?” are some of the responses our assistant will use. You’ll see how to connect user messages and responses in the next steps. - -In the code block below, we have listed some responses and added one or more text -options for each of them. If a response has multiple text options, one of these options will be chosen at random whenever that response is predicted. - -[Learn more about responses](./responses.mdx) - - - - -```yaml-rasa live noResult assistantBuilder name=responses -responses: - utter_greet: - - text: | - Hello! How can I help you? - - text: | - Hi! - utter_ask_email: - - text: | - What is your email address? - utter_subscribed: - - text: | - Check your inbox at {email} in order to finish subscribing to the newsletter! - - text: | - You're all set! Check your inbox at {email} to confirm your subscription. -``` - - - - - - - -[Stories](./stories.mdx) are example conversations that train an assistant to respond correctly depending on what the user has said previously in the conversation. -The story format shows the intent of the user message followed by the assistant’s action or response. - -Your first story should show a conversation flow where the assistant helps the user accomplish their goal in a straightforward way. Later, you can add stories for situations where the user doesn't want to provide their information or switches to another topic. - -In the code block below, we have added a story where the user and assistant exchange greetings, the user asks to subscribe to the newsletter, and the assistant starts collecting the information it needs through the newsletter_form. You will learn about forms in the next step. - -[Learn more about stories](./writing-stories.mdx) - - - - -```yaml-rasa live noResult assistantBuilder name=stories -stories: - - story: greet and subscribe - steps: - - intent: greet - - action: utter_greet - - intent: subscribe - - action: newsletter_form - - active_loop: newsletter_form -``` - - - - - - - -There are many situations where an assistant needs to collect information from the user. For example, when a user wants to subscribe to a newsletter, the assistant must ask for their email address. - -You can do this in Rasa using a form. In the code block below, we added the -`newsletter_form` and used it to collect an email address from the user. - -[Learn more about forms here](./forms.mdx) - - - - -```yaml-rasa live noResult assistantBuilder name=forms -slots: - email: - type: text - mappings: - - type: from_text - conditions: - - active_loop: newsletter_form - requested_slot: email -forms: - newsletter_form: - required_slots: - - email -``` - - - - - - - -Rules describe parts of conversations that should always follow the same path no matter what has been said previously in the conversation. - -We want our assistant to always respond to a certain intent with a specific action, so we use a rule to map that action to the intent. - -In the code block below, we have added a rule that triggers the -`newsletter_form` whenever the user expresses the intent “subscribe”. -We’ve also added a rule that triggers the `utter_subscribed` action once all the -required information has been provided. -The second rule only applies when the `newsletter_form` is active to begin with; once -it is no longer active (`active_loop: null`), the form is complete. - -[Learn more about rules and how to write them.](./rules.mdx) - -Now that you've gone through all the steps, scroll down to talk to your assistant. - - - - -```yaml-rasa live noResult assistantBuilder name=rules -rules: - - rule: activate subscribe form - steps: - - intent: subscribe - - action: newsletter_form - - active_loop: newsletter_form - - - rule: submit form - condition: - - active_loop: newsletter_form - steps: - - action: newsletter_form - - active_loop: null - - action: utter_subscribed -``` - - - - - -## Train and talk to your assistant - -Once you have reviewed the steps above, you’re ready to train your assistant. The training process generates a new machine learning model based on the training data you’ve provided. - -To train the assistant on the NLU data, stories, forms, rules and responses above, click the `Train` button: - -
- -## Looking for a challenge? Customize your assistant - -You can use this page to create an assistant that does something other than helping users subscribe to a newsletter. - -Try choosing a simple task for your assistant to do, like ordering a pizza or booking an appointment. Adapt the code blocks at each step to fit the new scenario, then train your assistant again to see it in action. - -## You have built your assistant! What’s next? - -You can download this project and continue building to create a more advanced assistant. - - - -[Install Rasa to keep building.](./installation/installing-rasa-open-source.mdx) - -
- -When you train a model, you always want to check that your assistant still behaves as -you expect. You can do that by talking to your assistant and seeing that it works. -However, as your assistant becomes more complex, you will want to use test stories to -ensure your model makes correct predictions. - -
- -Try running `rasa test` to make sure that your assistant passes your tests: - -```yaml-rasa noResult name=rules -stories: -- story: test for greet and subscribe - steps: - - user: | - Hello there - intent: greet - - action: utter_greet - - user: | - I want to subscribe to the newsletter. My email is example@email.com - intent: subscribe - - action: utter_subscribed -``` - -Check out other docs pages to learn more about -[Rasa’s CLI](./command-line-interface.mdx), -[Domains](./domain.mdx), -[Actions](./actions.mdx), -and your config’s [Pipeline](./tuning-your-model.mdx) and [Policies](./policies.mdx). - -
diff --git a/docs/docs/setting-up-ci-cd.mdx b/docs/docs/setting-up-ci-cd.mdx index 95b644779245..420994870272 100644 --- a/docs/docs/setting-up-ci-cd.mdx +++ b/docs/docs/setting-up-ci-cd.mdx @@ -68,7 +68,6 @@ jobs: - name: Rasa Train and Test GitHub Action uses: RasaHQ/rasa-train-test-gha@main with: - requirements_file: requirements.txt data_validate: true rasa_train: true cross_validation: true diff --git a/docs/netlify.toml b/docs/netlify.toml index 956b79eac95f..d7bac10afa58 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -1,198 +1,198 @@ ## CONTENT 301 REDIRECTIONS [[redirects]] - from = "/docs/rasa/user-guide/running-rasa-with-docker/" - to = "/docs/rasa/user-guide/docker/building-in-docker/" +from = "/docs/rasa/user-guide/running-rasa-with-docker/" +to = "/docs/rasa/user-guide/docker/building-in-docker/" [[redirects]] - from = "/docs/rasa/user-guide/running-the-server/" - to = "/docs/rasa/user-guide/configuring-http-api/" +from = "/docs/rasa/user-guide/running-the-server/" +to = "/docs/rasa/user-guide/configuring-http-api/" [[redirects]] - from = "/docs/rasa/user-guide/running-rasa-with-docker/#adding-custom-actions" - to = "/docs/rasa/user-guide/how-to-deploy/#deploying-your-action-server" +from = "/docs/rasa/user-guide/running-rasa-with-docker/#adding-custom-actions" +to = "/docs/rasa/user-guide/how-to-deploy/#deploying-your-action-server" [[redirects]] - from = "/docs/rasa/user-guide/how-to-deploy/#adding-custom-actions" - to = "/docs/rasa/user-guide/how-to-deploy/#deploying-your-action-server" +from = "/docs/rasa/user-guide/how-to-deploy/#adding-custom-actions" +to = "/docs/rasa/user-guide/how-to-deploy/#deploying-your-action-server" [[redirects]] - from = "/docs/rasa/user-guide/how-to-deploy/#using-docker-compose-to-run-multiple-services" - to = "/docs/rasa/user-guide/docker/deploying-in-docker-compose/" +from = "/docs/rasa/user-guide/how-to-deploy/#using-docker-compose-to-run-multiple-services" +to = "/docs/rasa/user-guide/docker/deploying-in-docker-compose/" [[redirects]] - from = "/docs/rasa/user-guide/evaluating-models/" - to = "/docs/rasa/user-guide/testing-your-assistant/" +from = "/docs/rasa/user-guide/evaluating-models/" +to = "/docs/rasa/user-guide/testing-your-assistant/" [[redirects]] - from = "/docs/rasa/user-guide/evaluating-models/#end-to-end-evaluation" - to = "/docs/rasa/user-guide/testing-your-assistant/#end-to-end-testing" +from = "/docs/rasa/user-guide/evaluating-models/#end-to-end-evaluation" +to = "/docs/rasa/user-guide/testing-your-assistant/#end-to-end-testing" [[redirects]] - from = "/docs/rasa/user-guide/installation/" - to = "/docs/rasa/installation/" +from = "/docs/rasa/user-guide/installation/" +to = "/docs/rasa/installation/" [[redirects]] - from = "/docs/rasa/nlu/training-data-format/" - to = "/docs/rasa/nlu-training-data/" +from = "/docs/rasa/nlu/training-data-format/" +to = "/docs/rasa/nlu-training-data/" [[redirects]] - from = "/docs/rasa/core/domains/" - to = "/docs/rasa/domain/" +from = "/docs/rasa/core/domains/" +to = "/docs/rasa/domain/" [[redirects]] - from = "/docs/rasa/user-guide/testing-your-assistant/" - to = "/docs/rasa/testing-your-assistant/" +from = "/docs/rasa/user-guide/testing-your-assistant/" +to = "/docs/rasa/testing-your-assistant/" [[redirects]] - from = "/docs/rasa/user-guide/command-line-interface/" - to = "/docs/rasa/command-line-interface/" +from = "/docs/rasa/user-guide/command-line-interface/" +to = "/docs/rasa/command-line-interface/" [[redirects]] - from = "/docs/rasa/user-guide/setting-up-ci-cd/" - to = "/docs/rasa/setting-up-ci-cd/" +from = "/docs/rasa/user-guide/setting-up-ci-cd/" +to = "/docs/rasa/setting-up-ci-cd/" [[redirects]] - from = "/docs/rasa/user-guide/rasa-tutorial/" - to = "/docs/rasa/prototype-an-assistant/" +from = "/docs/rasa/user-guide/rasa-tutorial/" +to = "/docs/rasa/prototype-an-assistant/" [[redirects]] - from = "/docs/rasa/user-guide/building-assistants/" - to = "/docs/rasa/chitchat-faqs/" +from = "/docs/rasa/user-guide/building-assistants/" +to = "/docs/rasa/chitchat-faqs/" [[redirects]] - from = "/docs/rasa/core/stories/" - to = "/docs/rasa/stories/" +from = "/docs/rasa/core/stories/" +to = "/docs/rasa/stories/" [[redirects]] - from = "/docs/rasa/user-guide/messaging-and-voice-channels/" - to = "/docs/rasa/messaging-and-voice-channels/" +from = "/docs/rasa/user-guide/messaging-and-voice-channels/" +to = "/docs/rasa/messaging-and-voice-channels/" [[redirects]] - from = "/docs/rasa/user-guide/configuring-http-api/" - to = "/docs/rasa/http-api/" +from = "/docs/rasa/user-guide/configuring-http-api/" +to = "/docs/rasa/http-api/" [[redirects]] - from = "/docs/rasa/user-guide/how-to-deploy/" - to = "/docs/rasa/how-to-deploy/" +from = "/docs/rasa/user-guide/how-to-deploy/" +to = "/docs/rasa/how-to-deploy/" [[redirects]] - from = "/docs/rasa/user-guide/cloud-storage/" - to = "/docs/rasa/model-storage/" +from = "/docs/rasa/user-guide/cloud-storage/" +to = "/docs/rasa/model-storage/" [[redirects]] - from = "/docs/rasa/nlu/choosing-a-pipeline/" - to = "/docs/rasa/tuning-your-model/" +from = "/docs/rasa/nlu/choosing-a-pipeline/" +to = "/docs/rasa/tuning-your-model/" [[redirects]] - from = "/docs/rasa/nlu/components/" - to = "/docs/rasa/components/" +from = "/docs/rasa/nlu/components/" +to = "/docs/rasa/components/" [[redirects]] - from = "/docs/rasa/user-guide/connectors/*" - to = "/docs/rasa/connectors/:splat" +from = "/docs/rasa/user-guide/connectors/*" +to = "/docs/rasa/connectors/:splat" [[redirects]] - from = "/docs/rasa/nlu/entity-extraction/" - to = "/docs/rasa/nlu-training-data/" +from = "/docs/rasa/nlu/entity-extraction/" +to = "/docs/rasa/nlu-training-data/" [[redirects]] - from = "/docs/rasa/core/responses/" - to = "/docs/rasa/domain/#responses" +from = "/docs/rasa/core/responses/" +to = "/docs/rasa/domain/#responses" [[redirects]] - from = "/docs/rasa/core/actions/" - to = "/docs/rasa/actions/" +from = "/docs/rasa/core/actions/" +to = "/docs/rasa/actions/" [[redirects]] - from = "/docs/rasa/core/reminders-and-external-events/" - to = "/docs/rasa/reaching-out-to-user/" +from = "/docs/rasa/core/reminders-and-external-events/" +to = "/docs/rasa/reaching-out-to-user/" [[redirects]] - from = "/docs/rasa/core/policies/" - to = "/docs/rasa/policies/" +from = "/docs/rasa/core/policies/" +to = "/docs/rasa/policies/" [[redirects]] - from = "/docs/rasa/core/slots/" - to = "/docs/rasa/domain/#slots" +from = "/docs/rasa/core/slots/" +to = "/docs/rasa/domain/#slots" [[redirects]] - from = "/docs/rasa/core/retrieval-actions/" - to = "/docs/rasa/retrieval-actions/" +from = "/docs/rasa/core/retrieval-actions/" +to = "/docs/rasa/retrieval-actions/" [[redirects]] - from = "/docs/rasa/core/forms/" - to = "/docs/rasa/forms/" +from = "/docs/rasa/core/forms/" +to = "/docs/rasa/forms/" [[redirects]] - from = "/docs/rasa/core/interactive-learning/" - to = "/docs/rasa/writing-stories/#using-interactive-learning" +from = "/docs/rasa/core/interactive-learning/" +to = "/docs/rasa/writing-stories/#using-interactive-learning" [[redirects]] - from = "/docs/rasa/core/fallback-actions/" - to = "/docs/rasa/fallback-handoff/#fallbacks" +from = "/docs/rasa/core/fallback-actions/" +to = "/docs/rasa/fallback-handoff/#fallbacks" [[redirects]] - from = "/docs/rasa/dialogue-elements/small-talk/" - to = "/docs/rasa/chitchat-faqs/" +from = "/docs/rasa/dialogue-elements/small-talk/" +to = "/docs/rasa/chitchat-faqs/" [[redirects]] - from = "/docs/rasa/api/action-server/" - to = "/docs/rasa/pages/action-server-api/" +from = "/docs/rasa/api/action-server/" +to = "/docs/rasa/pages/action-server-api/" [[redirects]] - from = "/docs/rasa/api/http-api/" - to = "/docs/rasa/pages/http-api/" +from = "/docs/rasa/api/http-api/" +to = "/docs/rasa/pages/http-api/" [[redirects]] - from = "/docs/rasa/api/jupyter-notebooks/" - to = "/docs/rasa/jupyter-notebooks/" +from = "/docs/rasa/api/jupyter-notebooks/" +to = "/docs/rasa/jupyter-notebooks/" [[redirects]] - from = "/docs/rasa/api/custom-nlu-components/" - to = "/docs/rasa/components/#custom-components" +from = "/docs/rasa/api/custom-nlu-components/" +to = "/docs/rasa/components/#custom-components" [[redirects]] - from = "/docs/rasa/api/tracker-stores/" - to = "/docs/rasa/tracker-stores/" +from = "/docs/rasa/api/tracker-stores/" +to = "/docs/rasa/tracker-stores/" [[redirects]] - from = "/docs/rasa/api/event-brokers/" - to = "/docs/rasa/event-brokers/" +from = "/docs/rasa/api/event-brokers/" +to = "/docs/rasa/event-brokers/" [[redirects]] - from = "/docs/rasa/api/lock-stores/" - to = "/docs/rasa/lock-stores/" +from = "/docs/rasa/api/lock-stores/" +to = "/docs/rasa/lock-stores/" [[redirects]] - from = "/docs/rasa/api/training-data-importers/" - to = "/docs/rasa/training-data-importers/" +from = "/docs/rasa/api/training-data-importers/" +to = "/docs/rasa/training-data-importers/" [[redirects]] - from = "/docs/rasa/retrieval-actions" - to = "/docs/rasa/chitchat-faqs/" +from = "/docs/rasa/retrieval-actions" +to = "/docs/rasa/chitchat-faqs/" [[redirects]] - from = "/docs/rasa/prototype-an-assistant" - to = "/docs/rasa/playground/" +from = "/docs/rasa/playground/" +to = "/docs/rasa/" # Redirects for latest version permalinks # this needs to be updated when we cut a new version [[redirects]] - from = "/docs/rasa/3.x/*" - to = "/docs/rasa/:splat" +from = "/docs/rasa/3.x/*" +to = "/docs/rasa/:splat" # end permalink section # FIXME: this requires some feedback as to the 404, like in the website [[redirects]] - from = "/docs/rasa/*" - to = "/docs/rasa/index.html" - status = 404 +from = "/docs/rasa/*" +to = "/docs/rasa/index.html" +status = 404 [[redirects]] - from = "/docs/rasa/installation" - to = "/docs/rasa/installation/environment-set-up/" +from = "/docs/rasa/installation" +to = "/docs/rasa/installation/environment-set-up/" [[redirects]] from = "/docs/rasa/deploy/deploy-rasa-plus/" diff --git a/docs/package.json b/docs/package.json index a3110cf737e3..2f45cb80ab85 100644 --- a/docs/package.json +++ b/docs/package.json @@ -45,7 +45,6 @@ "@lunelson/sass-u": "^0.11.0", "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", - "@philpl/buble": "^0.19.7", "@rasahq/docusaurus-theme-tabula": "^0.8.3", "classnames": "^2.3.1", "clsx": "^1.1.1", @@ -58,7 +57,6 @@ "postcss-pseudo-any": "^1.0.1", "react": "^16.8.4", "react-dom": "^16.8.4", - "react-live": "^2.2.3", "react-promise": "^3.0.2", "react-router-dom": "^5.2.0", "redoc": "^2.0.0-rc.31", diff --git a/docs/sidebars.js b/docs/sidebars.js index 297eb0026c65..346bdb0a244e 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -1,283 +1,278 @@ module.exports = { - default: [ - 'introduction', - 'rasa-pro', - 'playground', + default: [ + "introduction", + "rasa-pro", + { + type: "category", + label: "Installation", + collapsed: true, + items: [ + "installation/environment-set-up", + "installation/installing-rasa-open-source", { - type: 'category', - label: 'Installation', - collapsed: true, - items: [ - 'installation/environment-set-up', - 'installation/installing-rasa-open-source', - { - label: 'Installing Rasa Pro', - collapsed: true, - type: 'category', - items: [ - 'installation/rasa-pro/rasa-pro-artifacts', - 'installation/rasa-pro/installation', - ], - }, - ], + label: "Installing Rasa Pro", + collapsed: true, + type: "category", + items: [ + "installation/rasa-pro/rasa-pro-artifacts", + "installation/rasa-pro/installation", + ], }, + ], + }, + { + type: "category", + label: "Building Assistants", + collapsed: false, + items: [ + "migrate-from", + "command-line-interface", { - type: 'category', - label: 'Building Assistants', - collapsed: false, - items: [ - 'migrate-from', - 'command-line-interface', - { - type: 'category', - label: 'Best Practices', - collapsed: true, - items: [ - 'conversation-driven-development', - 'generating-nlu-data', - 'writing-stories', - ], - }, - { - type: 'category', - label: 'Conversation Patterns', - collapsed: true, - items: [ - 'chitchat-faqs', - 'business-logic', - 'fallback-handoff', - 'unexpected-input', - 'contextual-conversations', - 'reaching-out-to-user', - ], - }, - { - type: 'category', - label: 'Preparing For Production', - collapsed: true, - items: [ - 'messaging-and-voice-channels', - 'tuning-your-model', - 'testing-your-assistant', - 'setting-up-ci-cd', - ], - }, - 'glossary', - ], + type: "category", + label: "Best Practices", + collapsed: true, + items: [ + "conversation-driven-development", + "generating-nlu-data", + "writing-stories", + ], }, { - type: 'category', - label: 'Deploying Assistants', - collapsed: true, - items: [ - 'deploy/introduction', - 'deploy/deploy-rasa', - 'deploy/deploy-action-server', - 'deploy/deploy-rasa-pro-services', - ], + type: "category", + label: "Conversation Patterns", + collapsed: true, + items: [ + "chitchat-faqs", + "business-logic", + "fallback-handoff", + "unexpected-input", + "contextual-conversations", + "reaching-out-to-user", + ], }, { - type: 'category', - label: 'Monitoring and Analyzing Assistants', - collapsed: true, - items: [ - { - type: 'category', - label: 'Analytics', - collapsed: true, - items: [ - 'monitoring/analytics/getting-started-with-analytics', - 'monitoring/analytics/realtime-markers', - 'monitoring/analytics/example-queries', - 'monitoring/analytics/data-structure-reference', - ], - }, - 'monitoring/tracing', - 'monitoring/load-testing-guidelines', - ], + type: "category", + label: "Preparing For Production", + collapsed: true, + items: [ + "messaging-and-voice-channels", + "tuning-your-model", + "testing-your-assistant", + "setting-up-ci-cd", + ], }, - 'pii-management', + "glossary", + ], + }, + { + type: "category", + label: "Deploying Assistants", + collapsed: true, + items: [ + "deploy/introduction", + "deploy/deploy-rasa", + "deploy/deploy-action-server", + "deploy/deploy-rasa-pro-services", + ], + }, + { + type: "category", + label: "Monitoring and Analyzing Assistants", + collapsed: true, + items: [ { - type: 'category', - label: 'Concepts', - collapsed: false, - items: [ - { - type: 'category', - label: 'Training Data', - items: [ - 'training-data-format', - 'nlu-training-data', - 'stories', - 'rules', - ], - }, - 'domain', - { - type: 'category', - label: 'Config', - items: [ - 'model-configuration', - 'components', - 'policies', - 'custom-graph-components', - 'training-data-importers', - 'language-support', - 'graph-recipe', - 'spaces', - ], - }, - { - type: 'category', - label: 'Actions', - items: [ - 'actions', - 'responses', - 'custom-actions', - 'forms', - 'default-actions', - 'slot-validation-actions', - ], - }, - { - type: 'category', - label: 'Evaluation', - items: ['markers'], - }, - { - type: 'category', - label: 'Channel Connectors', - items: [ - { - type: 'category', - label: 'Text & Chat', - items: [ - 'connectors/facebook-messenger', - 'connectors/slack', - 'connectors/telegram', - 'connectors/twilio', - 'connectors/hangouts', - 'connectors/microsoft-bot-framework', - 'connectors/cisco-webex-teams', - 'connectors/rocketchat', - 'connectors/mattermost', - ], - }, - { - type: 'category', - label: 'Voice', - items: ['connectors/audiocodes-voiceai-connect'], - }, - 'connectors/custom-connectors', - ], - }, - { - type: 'category', - label: 'Architecture', // name still confusing with architecture page elsewhere - items: [ - 'arch-overview', - 'tracker-stores', - 'event-brokers', - 'model-storage', - 'lock-stores', - 'secrets-managers', - 'nlu-only', - 'nlg', - ], - }, - ], + type: "category", + label: "Analytics", + collapsed: true, + items: [ + "monitoring/analytics/getting-started-with-analytics", + "monitoring/analytics/realtime-markers", + "monitoring/analytics/example-queries", + "monitoring/analytics/data-structure-reference", + ], }, + "monitoring/tracing", + "monitoring/load-testing-guidelines", + ], + }, + "pii-management", + { + type: "category", + label: "Concepts", + collapsed: false, + items: [ { - type: 'category', - label: 'Action Server', - collapsed: true, - items: [ - 'action-server/index', - { - 'Action Server Fundamentals': [ - 'action-server/actions', - 'action-server/events', - ], - }, - { - 'Using the Rasa SDK': [ - 'action-server/running-action-server', - { - type: 'category', - label: 'Writing Custom Actions', - collapsed: true, - items: [ - 'action-server/sdk-actions', - 'action-server/sdk-tracker', - 'action-server/sdk-dispatcher', - 'action-server/sdk-events', - { - type: 'category', - label: 'Special Action Types', - collapsed: true, - items: [ - 'action-server/knowledge-bases', - 'action-server/validation-action', - ], - }, - ], - }, - 'action-server/sanic-extensions', - ], - }, - ], + type: "category", + label: "Training Data", + items: [ + "training-data-format", + "nlu-training-data", + "stories", + "rules", + ], + }, + "domain", + { + type: "category", + label: "Config", + items: [ + "model-configuration", + "components", + "policies", + "custom-graph-components", + "training-data-importers", + "language-support", + "graph-recipe", + "spaces", + ], + }, + { + type: "category", + label: "Actions", + items: [ + "actions", + "responses", + "custom-actions", + "forms", + "default-actions", + "slot-validation-actions", + ], + }, + { + type: "category", + label: "Evaluation", + items: ["markers"], + }, + { + type: "category", + label: "Channel Connectors", + items: [ + { + type: "category", + label: "Text & Chat", + items: [ + "connectors/facebook-messenger", + "connectors/slack", + "connectors/telegram", + "connectors/twilio", + "connectors/hangouts", + "connectors/microsoft-bot-framework", + "connectors/cisco-webex-teams", + "connectors/rocketchat", + "connectors/mattermost", + ], + }, + { + type: "category", + label: "Voice", + items: ["connectors/audiocodes-voiceai-connect"], + }, + "connectors/custom-connectors", + ], }, { - type: 'category', - label: 'APIs', - collapsed: true, - items: [ - 'http-api', - 'nlu-only-server', - // 'jupyter-notebooks', - ], + type: "category", + label: "Architecture", // name still confusing with architecture page elsewhere + items: [ + "arch-overview", + "tracker-stores", + "event-brokers", + "model-storage", + "lock-stores", + "secrets-managers", + "nlu-only", + "nlg", + ], }, + ], + }, + { + type: "category", + label: "Action Server", + collapsed: true, + items: [ + "action-server/index", { - type: 'category', - label: 'Reference', - collapsed: true, - items: [ - 'telemetry/telemetry', - 'telemetry/reference', - require('./docs/reference/sidebar.json'), - ], + "Action Server Fundamentals": [ + "action-server/actions", + "action-server/events", + ], }, { - type: 'category', - label: 'Change Log', - collapsed: true, - items: [ - 'rasa-pro-changelog', - 'changelog', - 'sdk_changelog', - 'compatibility-matrix', - 'migration-guide', + "Using the Rasa SDK": [ + "action-server/running-action-server", + { + type: "category", + label: "Writing Custom Actions", + collapsed: true, + items: [ + "action-server/sdk-actions", + "action-server/sdk-tracker", + "action-server/sdk-dispatcher", + "action-server/sdk-events", { - type: 'link', - label: 'Actively Maintained Versions', - href: 'https://rasa.com/rasa-product-release-and-maintenance-policy/', + type: "category", + label: "Special Action Types", + collapsed: true, + items: [ + "action-server/knowledge-bases", + "action-server/validation-action", + ], }, - ], + ], + }, + "action-server/sanic-extensions", + ], }, - ], - "llms": [ - 'llms/large-language-models', - 'llms/llm-setup', + ], + }, + { + type: "category", + label: "APIs", + collapsed: true, + items: [ + "http-api", + "nlu-only-server", + // 'jupyter-notebooks', + ], + }, + { + type: "category", + label: "Reference", + collapsed: true, + items: [ + "telemetry/telemetry", + "telemetry/reference", + require("./docs/reference/sidebar.json"), + ], + }, + { + type: "category", + label: "Change Log", + collapsed: true, + items: [ + "rasa-pro-changelog", + "changelog", + "sdk_changelog", + "compatibility-matrix", + "migration-guide", { - type: 'category', - label: 'LLM Components', - collapsed: false, - items: [ - 'llms/llm-intent', - 'llms/llm-nlg', - 'llms/llm-intentless', - ], + type: "link", + label: "Actively Maintained Versions", + href: "https://rasa.com/rasa-product-release-and-maintenance-policy/", }, - 'llms/llm-custom', - ] + ], + }, + ], + llms: [ + "llms/large-language-models", + "llms/llm-setup", + { + type: "category", + label: "LLM Components", + collapsed: false, + items: ["llms/llm-intent", "llms/llm-nlg", "llms/llm-intentless"], + }, + "llms/llm-custom", + ], }; diff --git a/docs/themes/theme-custom/index.js b/docs/themes/theme-custom/index.js index 8a0e8195f310..c0038ecb87b5 100644 --- a/docs/themes/theme-custom/index.js +++ b/docs/themes/theme-custom/index.js @@ -1,4 +1,4 @@ -const path = require('path'); +const path = require("path"); // FIXME: this package is copied from // https://github.com/facebook/docusaurus/tree/afe9ff91a4247316f0081c9b080655d575298416/packages/docusaurus-theme-live-codeblock/src @@ -8,36 +8,24 @@ module.exports = function (context) { } = context; return { - name: 'theme-custom', + name: "theme-custom", getThemePath() { - return path.resolve(__dirname, './theme'); + return path.resolve(__dirname, "./theme"); }, // FIXME: this needs to be fixed in the theme, see https://github.com/RasaHQ/docusaurus-tabula/issues/11 getClientModules() { - return [require.resolve('./custom.css')]; - }, - - configureWebpack() { - return { - resolve: { - alias: { - // fork of Buble which removes Buble's large dependency and weighs in at a smaller size of ~51kB - // https://github.com/FormidableLabs/react-live#what-bundle-size-can-i-expect - buble: '@philpl/buble', - }, - }, - }; + return [require.resolve("./custom.css")]; }, injectHtmlTags() { return { headTags: [ { - tagName: 'meta', + tagName: "meta", attributes: { - property: 'og:image', + property: "og:image", content: `${siteUrl}${baseUrl}img/og-image.png`, }, }, diff --git a/docs/themes/theme-custom/theme/AssistantBuilder/index.jsx b/docs/themes/theme-custom/theme/AssistantBuilder/index.jsx deleted file mode 100644 index ae9dcbed8a70..000000000000 --- a/docs/themes/theme-custom/theme/AssistantBuilder/index.jsx +++ /dev/null @@ -1,104 +0,0 @@ -import * as React from 'react'; -import clsx from 'clsx'; - -import RasaButton from "../RasaButton"; -import styles from './styles.module.css'; - -function Text({values, selectedValue, setSelectedValue, children, ...props}) { - const index = values.findIndex((v) => v.value === selectedValue); - - const onButtonClick = () => { - if (index < values.length - 1) { - setSelectedValue(values[index + 1].value); - } - }; - - return ( -
-
- {children} -
- - { - index !== -1 && index !== values.length - 1 && -
- -
- } -
- ) -} - -function Code({children}) { - return ( -
- {children} -
- ) -} - -function Section({children, ...props}) { - return ( -
- {React.Children.toArray(children).map( - (child) => React.cloneElement(child, props) - )} -
- ) -} - -function NextStepButton(props) { - return ( - - Next step >> - - ) -} - -function Container({children, values, defaultValue, ...props}) { - const [selectedValue, setSelectedValue] = React.useState(defaultValue); - const tabRefs = []; - - const changeSelectedValue = (newValue) => { - setSelectedValue(newValue); - }; - - return ( -
- -
- { - React.Children.toArray(children).map( - (child) => React.cloneElement(child, - {values, selectedValue, setSelectedValue, ...props} - ) - ) - } -
-
- ) -} - -export default { - Container, - Section, - Text, - Code -}; diff --git a/docs/themes/theme-custom/theme/AssistantBuilder/styles.module.css b/docs/themes/theme-custom/theme/AssistantBuilder/styles.module.css deleted file mode 100755 index c4a983a6c8d2..000000000000 --- a/docs/themes/theme-custom/theme/AssistantBuilder/styles.module.css +++ /dev/null @@ -1,90 +0,0 @@ -.container { - border: 1px solid var(--global-border-color); - border-radius: 10px; - margin-top: 40px !important; - word-break: normal; -} - -.containerTabs { - display: flex; - flex-direction: row; - padding: 0 16px; - font-size: 80%; -} - -.tab { - padding: 16px 24px; - border-bottom: 3px solid transparent; - cursor: pointer; - outline: none; - margin-top: 0 !important; -} - -.tab::before { - content: '' !important; -} - -.tabActive { - border-bottom: 3px solid var(--ifm-color-primary); - cursor: default; - font-weight: 500; -} - -.containerSections { - hyphens: none; - overflow: hidden; - height: 680px; -} - -.containerSections p { - margin-bottom: 27px; -} - -.section { - display: none; - flex-direction: row; -} - -.sectionActive { - display: flex; -} - -.text { - flex: 1; - font-size: 85%; - height: 680px; - display: flex; - flex-direction: column; -} - -.textTop { - flex: 1; - overflow-y: scroll; - padding: 24px; - border-top: 1px solid var(--global-border-color); -} - -.textButtons { - padding: 32px 24px; -} - -.code { - flex: 1; - display: flex; - font-size: 17px; - line-height: 27px; - overflow: scroll; - height: 680px; -} - -.code > div { - flex: 1; - margin-bottom: 0 !important; - display: flex; - flex-direction: column; - overflow: scroll; -} - -.code > div > div { - overflow: scroll !important; -} diff --git a/docs/themes/theme-custom/theme/CodeBlock/index.jsx b/docs/themes/theme-custom/theme/CodeBlock/index.jsx deleted file mode 100755 index 28ce514dcbaa..000000000000 --- a/docs/themes/theme-custom/theme/CodeBlock/index.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import usePrismTheme from '@theme/hooks/usePrismTheme'; -import Playground from '@theme/Playground'; -import ReactLiveScope from '@theme/ReactLiveScope'; -import CodeBlock from '@theme-init/CodeBlock'; - -const withLiveEditor = (Component) => { - return (props) => { - const {isClient} = useDocusaurusContext(); - const prismTheme = usePrismTheme(); - - if (props.live) { - return ( - - ); - } - - return ; - }; -}; - -export default withLiveEditor(CodeBlock); diff --git a/docs/themes/theme-custom/theme/Playground/index.jsx b/docs/themes/theme-custom/theme/Playground/index.jsx deleted file mode 100755 index 7df1f551120e..000000000000 --- a/docs/themes/theme-custom/theme/Playground/index.jsx +++ /dev/null @@ -1,64 +0,0 @@ -import * as React from 'react'; -import {LiveProvider, LiveEditor, LiveError, LivePreview} from 'react-live'; -import clsx from 'clsx'; -import ThemeContext from '@theme/_contexts/ThemeContext'; - -import styles from './styles.module.css'; - - -function Playground({children, theme, transformCode, noResult, assistantBuilder, name, ...props}) { - const code = children.replace(/\n$/, ''); - const themeContext = React.useContext(ThemeContext); - - // only run this when mounting - React.useEffect(() => { - themeContext.onLiveCodeStart(name, code); - }, []); - - return ( - `${code};`)} - theme={theme} - {...props}> - { - !assistantBuilder && -
- Live Editor -
- } - themeContext.onLiveCodeChange(name, value)} - /> - - { - !noResult && -
- Result -
- } - - { - !noResult && -
- - -
- } -
- ); -} - -export default Playground; diff --git a/docs/themes/theme-custom/theme/Playground/styles.module.css b/docs/themes/theme-custom/theme/Playground/styles.module.css deleted file mode 100755 index 98e7d2dea8bc..000000000000 --- a/docs/themes/theme-custom/theme/Playground/styles.module.css +++ /dev/null @@ -1,37 +0,0 @@ -.playgroundHeader { - letter-spacing: 0.08rem; - padding: 0.75rem; - text-transform: uppercase; - font-weight: bold; -} - -.playgroundEditorHeader { - background: rgb(32, 35, 42); - color: #999; -} - -.playgroundPreviewHeader { - background: rgb(236, 236, 236); - color: rgb(109, 109, 109); -} - -.playgroundPreview { - border: 1px solid #f0f0f0; - border-bottom-left-radius: var(--ifm-global-radius); - border-bottom-right-radius: var(--ifm-global-radius); - position: relative; - padding: 1rem; -} - -.playgroundEditor { - flex: 1; - overflow-y: scroll; -} - -.playgroundEditorAssistantBuilder { - border-radius: 0 0 8px 0; -} - -.playgroundEditorAssistantBuilder pre, .playgroundEditorAssistantBuilder textarea { - padding: 28px 24px !important; -} \ No newline at end of file diff --git a/docs/themes/theme-custom/theme/Prototyper/context.js b/docs/themes/theme-custom/theme/Prototyper/context.js deleted file mode 100644 index 3c746fd0ead3..000000000000 --- a/docs/themes/theme-custom/theme/Prototyper/context.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; - -const PrototyperContext = React.createContext(); - -export default PrototyperContext; diff --git a/docs/themes/theme-custom/theme/Prototyper/download-button.jsx b/docs/themes/theme-custom/theme/Prototyper/download-button.jsx deleted file mode 100644 index da4a5a0b608f..000000000000 --- a/docs/themes/theme-custom/theme/Prototyper/download-button.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -import RasaButton from '../RasaButton'; -import PrototyperContext from './context'; - -const DownloadButton = (props) => { - const prototyperContext = React.useContext(PrototyperContext); - - return ( - - Download project - - ); -}; - -export default DownloadButton; diff --git a/docs/themes/theme-custom/theme/Prototyper/index.jsx b/docs/themes/theme-custom/theme/Prototyper/index.jsx deleted file mode 100644 index e1ce9a07ee52..000000000000 --- a/docs/themes/theme-custom/theme/Prototyper/index.jsx +++ /dev/null @@ -1,6 +0,0 @@ -import DownloadButton from './download-button'; -import Prototyper from './prototyper'; -import TrainButton from './train-button'; - -export default Prototyper; -export { DownloadButton, TrainButton }; diff --git a/docs/themes/theme-custom/theme/Prototyper/prototyper.jsx b/docs/themes/theme-custom/theme/Prototyper/prototyper.jsx deleted file mode 100644 index e3f464c1d379..000000000000 --- a/docs/themes/theme-custom/theme/Prototyper/prototyper.jsx +++ /dev/null @@ -1,189 +0,0 @@ -import React from 'react'; -import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; -import ThemeContext from '@theme/_contexts/ThemeContext'; -import { isProductionBuild, uuidv4 } from '@theme/_utils'; - -import PrototyperContext from './context'; - -const jsonHeaders = { - Accept: 'application/json', - 'Content-Type': 'application/json', -}; -const trackerPollingInterval = 2000; - -const Prototyper = ({ - children, - startPrototyperApi, - trainModelApi, - chatBlockSelector, - chatBlockScriptUrl, -}) => { - const [hasStarted, setHasStarted] = React.useState(false); - const [trackingId, setTrackingId] = React.useState(null); - const [projectDownloadUrl, setProjectDownloadUrl] = React.useState(null); - const [trainingData, setTrainingData] = React.useState({}); - const [pollingIntervalId, setPollingIntervalId] = React.useState(null); - - const [baseUrl, setBaseUrl] = React.useState(""); - const [tracker, setTracker] = React.useState({}); - const [chatState, setChatState] = React.useState("not_trained"); - - // FIXME: once we can use `rasa-ui` outside of `rasa-x`, we can remove this - const insertChatBlockScript = () => { - if (ExecutionEnvironment.canUseDOM) { - const scriptElement = document.createElement('script'); - scriptElement.src = chatBlockScriptUrl; - document.body.appendChild(scriptElement); - } - }; - - // update tracking id when component is mounting - React.useEffect(() => { - setTrackingId(isProductionBuild() ? uuidv4() : 'the-hash'); - insertChatBlockScript(); - updateChatBlock(); - }, []); - - // update chat block when chatState or tracker changes - React.useEffect(() => { - updateChatBlock(); - }, [chatState, tracker, trainingData]); - - const clearPollingInterval = React.useCallback(() => { - if (pollingIntervalId) { - clearInterval(pollingIntervalId); - setPollingIntervalId(null); - } - }, [pollingIntervalId, setPollingIntervalId]); - - const onLiveCodeStart = React.useCallback((name, value) => { - setTrainingData((prevTrainingData) => ({...prevTrainingData, [name]: value})); - }, [setTrainingData]); - - const onLiveCodeChange = React.useCallback((name, value) => { - setTrainingData((prevTrainingData) => ({ ...prevTrainingData, [name]: value })); - - if (chatState === "ready") { - clearPollingInterval(); - setChatState("needs_to_be_retrained"); - updateChatBlock(); - } - - if (!hasStarted) { - // track the start here - setHasStarted(true); - fetch(startPrototyperApi, { - method: 'POST', - headers: jsonHeaders, - body: JSON.stringify({ - tracking_id: trackingId, - editor: 'main', - }), - }); - } - }, [ - clearPollingInterval, - hasStarted, - setHasStarted, - trackingId, - chatState, - setChatState, - setTrainingData, - jsonHeaders - ]); - - const trainModel = (trainingData) => { - setChatState("training"); - clearPollingInterval(); - - fetch(trainModelApi, { - method: 'POST', - headers: jsonHeaders, - body: JSON.stringify({ tracking_id: trackingId, ...trainingData }), - }) - .then((response) => response.json()) - .then((data) => { - setProjectDownloadUrl(data.project_download_url); - if (data.rasa_service_url) { - startFetchingTracker(data.rasa_service_url); - } - }); - }; - - const downloadProject = () => { - if (projectDownloadUrl) { - location.href = projectDownloadUrl; - } - }; - - const updateChatBlock = () => { - if (!ExecutionEnvironment.canUseDOM) { - return; - } - - if (!window.ChatBlock) { - setTimeout(() => updateChatBlock(baseUrl, tracker), 500); - return; - } - - window.ChatBlock.default.init({ - onSendMessage: (message) => { - sendMessage(baseUrl, message); - }, - onTrainClick: () => { - trainModel(trainingData); - }, - username: trackingId, - tracker: tracker, - selector: chatBlockSelector, - state: chatState, - }); - }; - - const fetchTracker = (baseUrl) => { - fetch(`${baseUrl}/conversations/${trackingId}/tracker`, { - method: 'GET', - header: 'jsonHeaders', - }) - .then((response) => response.json()) - .then((tracker) => { - setBaseUrl(baseUrl); - setTracker(tracker); - setChatState("ready"); - }); - }; - - const sendMessage = (baseUrl, message) => { - fetch(`${baseUrl}/webhooks/rest/webhook`, { - method: 'POST', - headers: jsonHeaders, - body: JSON.stringify({ - sender: trackingId, - message: message, - }), - }).then(() => { - fetchTracker(baseUrl); - }); - }; - - const startFetchingTracker = (baseUrl) => { - setChatState("deploying"); - fetchTracker(baseUrl); - - const updateIntervalId = setInterval(() => { - fetchTracker(baseUrl); - }, trackerPollingInterval); - - setPollingIntervalId(updateIntervalId); - }; - - return ( - - - {children} - - - ); -}; - -export default Prototyper; diff --git a/docs/themes/theme-custom/theme/Prototyper/train-button.jsx b/docs/themes/theme-custom/theme/Prototyper/train-button.jsx deleted file mode 100644 index 96741a004d3e..000000000000 --- a/docs/themes/theme-custom/theme/Prototyper/train-button.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; - -import RasaButton from '../RasaButton'; -import PrototyperContext from './context'; - -const TrainButton = (props) => { - const prototyperContext = React.useContext(PrototyperContext); - - return ( - - Train - - ); -}; - -export default TrainButton; diff --git a/docs/themes/theme-custom/theme/RasaButton/index.jsx b/docs/themes/theme-custom/theme/RasaButton/index.jsx deleted file mode 100644 index 7d777d2252f2..000000000000 --- a/docs/themes/theme-custom/theme/RasaButton/index.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react'; -import clsx from 'clsx'; - -import styles from './styles.module.css'; -import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; -import {faCircleNotch} from "@fortawesome/free-solid-svg-icons"; - -function Button({isLoading, ...props}) { - return ( -
-
- ) -} - -export default Button; diff --git a/docs/themes/theme-custom/theme/RasaButton/styles.module.css b/docs/themes/theme-custom/theme/RasaButton/styles.module.css deleted file mode 100644 index b3dd54238d4c..000000000000 --- a/docs/themes/theme-custom/theme/RasaButton/styles.module.css +++ /dev/null @@ -1,25 +0,0 @@ -.buttonContainer { - display: flex; - align-items: center; -} - -.button { - background-color: var(--ifm-color-primary); - border: 1px solid transparent; - color: var(--ifm-color-white); - border-radius: 8px; - padding: 8px 24px; - font-size: 15px !important; - font-weight: 600; - cursor: pointer; -} - -.button[disabled] { - background-color: var(--ifm-color-gray-500); - cursor: default; -} - -.buttonSpinner { - margin: 8px; - color: var(--ifm-color-gray-500); -} diff --git a/docs/themes/theme-custom/theme/RasaProBanner/index.jsx b/docs/themes/theme-custom/theme/RasaProBanner/index.jsx index 64b3019e4384..ef975c61942f 100644 --- a/docs/themes/theme-custom/theme/RasaProBanner/index.jsx +++ b/docs/themes/theme-custom/theme/RasaProBanner/index.jsx @@ -18,7 +18,7 @@ function RasaProBanner({isLoading, ...props}) {
-

You'll need a license to get started with Rasa Pro. +

You'll need a license to get started with Rasa Pro. {' '} Talk with Sales diff --git a/docs/themes/theme-custom/theme/ReactLiveScope/index.js b/docs/themes/theme-custom/theme/ReactLiveScope/index.js deleted file mode 100644 index e0e07d4e31eb..000000000000 --- a/docs/themes/theme-custom/theme/ReactLiveScope/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; - -// Add react-live imports you need here -const ReactLiveScope = { - React, - ...React, -}; - -export default ReactLiveScope; diff --git a/docs/yarn.lock b/docs/yarn.lock index e9b5e167147c..7b3d6d6da0e0 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -3670,21 +3670,6 @@ dependencies: "@octokit/openapi-types" "^7.3.5" -"@philpl/buble@^0.19.7": - version "0.19.7" - resolved "https://registry.yarnpkg.com/@philpl/buble/-/buble-0.19.7.tgz#27231e6391393793b64bc1c982fc7b593198b893" - integrity sha512-wKTA2DxAGEW+QffRQvOhRQ0VBiYU2h2p8Yc1oBNlqSKws48/8faxqKNIuub0q4iuyTuLwtB8EkwiKwhlfV1PBA== - dependencies: - acorn "^6.1.1" - acorn-class-fields "^0.2.1" - acorn-dynamic-import "^4.0.0" - acorn-jsx "^5.0.1" - chalk "^2.4.2" - magic-string "^0.25.2" - minimist "^1.2.0" - os-homedir "^1.0.1" - regexpu-core "^4.5.4" - "@rasahq/docusaurus-theme-tabula@^0.8.3": version "0.8.3" resolved "https://registry.yarnpkg.com/@rasahq/docusaurus-theme-tabula/-/docusaurus-theme-tabula-0.8.3.tgz#42169bbb334a8efaaafb87f3daac283fe879a0e6" @@ -4396,27 +4381,12 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -acorn-class-fields@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/acorn-class-fields/-/acorn-class-fields-0.2.1.tgz#748058bceeb0ef25164bbc671993984083f5a085" - integrity sha512-US/kqTe0H8M4LN9izoL+eykVAitE68YMuYZ3sHn3i1fjniqR7oQ3SPvuMK/VT1kjOQHrx5Q88b90TtOKgAv2hQ== - -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - -acorn-jsx@^5.0.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - acorn-walk@^7.1.1: version "7.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^6.1.1, acorn@^6.4.1: +acorn@^6.4.1: version "6.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== @@ -5319,18 +5289,6 @@ browserslist@^4.16.6: escalade "^3.1.1" node-releases "^1.1.71" -buble@0.19.6: - version "0.19.6" - resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.6.tgz#915909b6bd5b11ee03b1c885ec914a8b974d34d3" - integrity sha512-9kViM6nJA1Q548Jrd06x0geh+BG2ru2+RMDkIHHgJY/8AcyCs34lTHwra9BX7YdPrZXd5aarkpr/SY8bmPgPdg== - dependencies: - chalk "^2.4.1" - magic-string "^0.25.1" - minimist "^1.2.0" - os-homedir "^1.0.1" - regexpu-core "^4.2.0" - vlq "^1.0.0" - buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" @@ -6224,16 +6182,6 @@ component-emitter@^1.2.1: resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== -component-props@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/component-props/-/component-props-1.1.1.tgz#f9b7df9b9927b6e6d97c9bd272aa867670f34944" - integrity sha1-+bffm5kntubZfJvScqqGdnDzSUQ= - -component-xor@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/component-xor/-/component-xor-0.0.4.tgz#c55d83ccc1b94cd5089a4e93fa7891c7263e59aa" - integrity sha1-xV2DzMG5TNUImk6T+niRxyY+Wao= - compress-commons@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.1.1.tgz#df2a09a7ed17447642bad10a85cc9a19e5c42a7d" @@ -6467,7 +6415,7 @@ core-js-pure@^3.0.0: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== -core-js@^2.4.1, core-js@^2.6.5: +core-js@^2.6.5: version "2.6.11" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== @@ -7329,14 +7277,6 @@ dom-converter@^0.2: dependencies: utila "~0.4" -dom-iterator@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/dom-iterator/-/dom-iterator-1.0.0.tgz#9c09899846ec41c2d257adc4d6015e4759ef05ad" - integrity sha512-7dsMOQI07EMU98gQM8NSB3GsAiIeBYIPKpnxR3c9xOvdvBjChAcOM0iJ222I3p5xyiZO9e5oggkNaCusuTdYig== - dependencies: - component-props "1.1.1" - component-xor "0.0.4" - dom-serializer@0: version "0.2.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" @@ -11010,7 +10950,7 @@ macos-release@^2.2.0: resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.4.1.tgz#64033d0ec6a5e6375155a74b1a1eba8e509820ac" integrity sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg== -magic-string@^0.25.1, magic-string@^0.25.2, magic-string@^0.25.3, magic-string@^0.25.5, magic-string@^0.25.7: +magic-string@^0.25.3, magic-string@^0.25.5, magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== @@ -12447,11 +12387,6 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -os-homedir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" @@ -13770,7 +13705,7 @@ printj@~1.1.0: resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== -prism-react-renderer@^1.0.1, prism-react-renderer@^1.1.0: +prism-react-renderer@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.1.1.tgz#1c1be61b1eb9446a146ca7a50b7bcf36f2a70a44" integrity sha512-MgMhSdHuHymNRqD6KM3eGS0PNqgK9q4QF5P0yoQQvpB6jNjeSAi3jcSAz0Sua/t9fa4xDOMar9HJbLa08gl9ug== @@ -13822,7 +13757,7 @@ prompts@2.4.0: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.0.0, prop-types@^15.5.0, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.0.0, prop-types@^15.5.0, prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -14150,19 +14085,6 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-live@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/react-live/-/react-live-2.2.3.tgz#260f99194213799f0005e473e7a4154c699d6a7c" - integrity sha512-tpKruvfytNETuzO3o1mrQUj180GVrq35IE8F5gH1NJVPt4szYCx83/dOSCOyjgRhhc3gQvl0pQ3k/CjOjwJkKQ== - dependencies: - buble "0.19.6" - core-js "^2.4.1" - dom-iterator "^1.0.0" - prism-react-renderer "^1.0.1" - prop-types "^15.5.8" - react-simple-code-editor "^0.10.0" - unescape "^1.0.1" - react-loadable-ssr-addon@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/react-loadable-ssr-addon/-/react-loadable-ssr-addon-0.3.0.tgz#ae9b2d3b11721930f8d8255476d288c0e9f9290f" @@ -14223,11 +14145,6 @@ react-side-effect@^2.1.0: resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.0.tgz#1ce4a8b4445168c487ed24dab886421f74d380d3" integrity sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg== -react-simple-code-editor@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/react-simple-code-editor/-/react-simple-code-editor-0.10.0.tgz#73e7ac550a928069715482aeb33ccba36efe2373" - integrity sha512-bL5W5mAxSW6+cLwqqVWY47Silqgy2DKDTR4hDBrLrUqC5BXc29YVx17l2IZk5v36VcDEq1Bszu2oHm1qBwKqBA== - react-tabs@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-3.1.1.tgz#b363a239f76046bb2158875a1e5921b11064052f" @@ -14438,7 +14355,7 @@ regexp.prototype.flags@^1.2.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpu-core@^4.2.0, regexpu-core@^4.5.4, regexpu-core@^4.7.0: +regexpu-core@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938" integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ== @@ -16580,13 +16497,6 @@ unbzip2-stream@^1.0.9: buffer "^5.2.1" through "^2.3.8" -unescape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unescape/-/unescape-1.0.1.tgz#956e430f61cad8a4d57d82c518f5e6cc5d0dda96" - integrity sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ== - dependencies: - extend-shallow "^2.0.1" - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" @@ -17146,11 +17056,6 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" -vlq@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" - integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== - vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" diff --git a/examples/moodbot/domain.yml b/examples/moodbot/domain.yml index de67a502a027..55aecb6fbd9c 100644 --- a/examples/moodbot/domain.yml +++ b/examples/moodbot/domain.yml @@ -20,7 +20,7 @@ responses: utter_cheer_up: - text: "Here is something to cheer you up:" - image: "https://i.imgur.com/nGF1K8f.jpg" + image: "https://i.imgur.com/iPa8HCj.jpeg" utter_did_that_help: - text: "Did that help you?" diff --git a/poetry.lock b/poetry.lock index 1376be320001..2bcdba8915e0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1510,14 +1510,14 @@ testing = ["pre-commit"] [[package]] name = "fakeredis" -version = "2.16.0" +version = "2.18.1" description = "Python implementation of redis API, can be used for testing purposes." category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "fakeredis-2.16.0-py3-none-any.whl", hash = "sha256:188514cbd7120ff28c88f2a31e2fddd18fb1b28504478dfa3669c683134c4d82"}, - {file = "fakeredis-2.16.0.tar.gz", hash = "sha256:5abdd734de4ead9d6c7acbd3add1c4aa9b3ab35219339530472d9dd2bdf13057"}, + {file = "fakeredis-2.18.1-py3-none-any.whl", hash = "sha256:d780da2519b2e9d741056cf2b68604a4e59286bc6fde78b40a2b2b1367a51b30"}, + {file = "fakeredis-2.18.1.tar.gz", hash = "sha256:9742d6d4673df0f5f6ade4e4eee763b7f3517178ffa82508310325a6305651ec"}, ] [package.dependencies] @@ -1526,7 +1526,7 @@ sortedcontainers = ">=2,<3" [package.extras] json = ["jsonpath-ng (>=1.5,<2.0)"] -lua = ["lupa (>=1.14,<2.0)"] +lua = ["lupa (>=1.14,<3.0)"] [[package]] name = "fbmessenger" @@ -1837,14 +1837,14 @@ uritemplate = ">=3.0.0" [[package]] name = "gitpython" -version = "3.1.32" +version = "3.1.35" description = "GitPython is a Python library used to interact with Git repositories" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "GitPython-3.1.32-py3-none-any.whl", hash = "sha256:e3d59b1c2c6ebb9dfa7a184daf3b6dd4914237e7488a1730a6d8f6f5d0b4187f"}, - {file = "GitPython-3.1.32.tar.gz", hash = "sha256:8d9b8cb1e80b9735e8717c9362079d3ce4c6e5ddeebedd0361b228c3a67a62f6"}, + {file = "GitPython-3.1.35-py3-none-any.whl", hash = "sha256:c19b4292d7a1d3c0f653858db273ff8a6614100d1eb1528b014ec97286193c09"}, + {file = "GitPython-3.1.35.tar.gz", hash = "sha256:9cbefbd1789a5fe9bcf621bb34d3f441f3a90c8461d377f84eda73e721d9b06b"}, ] [package.dependencies] @@ -5309,39 +5309,42 @@ tests = ["black (>=22.3.0)", "flake8 (>=3.8.2)", "matplotlib (>=3.1.2)", "mypy ( [[package]] name = "scipy" -version = "1.8.1" -description = "SciPy: Scientific Library for Python" +version = "1.10.1" +description = "Fundamental algorithms for scientific computing in Python" category = "main" optional = false -python-versions = ">=3.8,<3.11" +python-versions = "<3.12,>=3.8" files = [ - {file = "scipy-1.8.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:65b77f20202599c51eb2771d11a6b899b97989159b7975e9b5259594f1d35ef4"}, - {file = "scipy-1.8.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:e013aed00ed776d790be4cb32826adb72799c61e318676172495383ba4570aa4"}, - {file = "scipy-1.8.1-cp310-cp310-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:02b567e722d62bddd4ac253dafb01ce7ed8742cf8031aea030a41414b86c1125"}, - {file = "scipy-1.8.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1da52b45ce1a24a4a22db6c157c38b39885a990a566748fc904ec9f03ed8c6ba"}, - {file = "scipy-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0aa8220b89b2e3748a2836fbfa116194378910f1a6e78e4675a095bcd2c762d"}, - {file = "scipy-1.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:4e53a55f6a4f22de01ffe1d2f016e30adedb67a699a310cdcac312806807ca81"}, - {file = "scipy-1.8.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:28d2cab0c6ac5aa131cc5071a3a1d8e1366dad82288d9ec2ca44df78fb50e649"}, - {file = "scipy-1.8.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:6311e3ae9cc75f77c33076cb2794fb0606f14c8f1b1c9ff8ce6005ba2c283621"}, - {file = "scipy-1.8.1-cp38-cp38-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:3b69b90c9419884efeffaac2c38376d6ef566e6e730a231e15722b0ab58f0328"}, - {file = "scipy-1.8.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6cc6b33139eb63f30725d5f7fa175763dc2df6a8f38ddf8df971f7c345b652dc"}, - {file = "scipy-1.8.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c4e3ae8a716c8b3151e16c05edb1daf4cb4d866caa385e861556aff41300c14"}, - {file = "scipy-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23b22fbeef3807966ea42d8163322366dd89da9bebdc075da7034cee3a1441ca"}, - {file = "scipy-1.8.1-cp38-cp38-win32.whl", hash = "sha256:4b93ec6f4c3c4d041b26b5f179a6aab8f5045423117ae7a45ba9710301d7e462"}, - {file = "scipy-1.8.1-cp38-cp38-win_amd64.whl", hash = "sha256:70ebc84134cf0c504ce6a5f12d6db92cb2a8a53a49437a6bb4edca0bc101f11c"}, - {file = "scipy-1.8.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f3e7a8867f307e3359cc0ed2c63b61a1e33a19080f92fe377bc7d49f646f2ec1"}, - {file = "scipy-1.8.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:2ef0fbc8bcf102c1998c1f16f15befe7cffba90895d6e84861cd6c6a33fb54f6"}, - {file = "scipy-1.8.1-cp39-cp39-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:83606129247e7610b58d0e1e93d2c5133959e9cf93555d3c27e536892f1ba1f2"}, - {file = "scipy-1.8.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:93d07494a8900d55492401917a119948ed330b8c3f1d700e0b904a578f10ead4"}, - {file = "scipy-1.8.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3b3c8924252caaffc54d4a99f1360aeec001e61267595561089f8b5900821bb"}, - {file = "scipy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70de2f11bf64ca9921fda018864c78af7147025e467ce9f4a11bc877266900a6"}, - {file = "scipy-1.8.1-cp39-cp39-win32.whl", hash = "sha256:1166514aa3bbf04cb5941027c6e294a000bba0cf00f5cdac6c77f2dad479b434"}, - {file = "scipy-1.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:9dd4012ac599a1e7eb63c114d1eee1bcfc6dc75a29b589ff0ad0bb3d9412034f"}, - {file = "scipy-1.8.1.tar.gz", hash = "sha256:9e3fb1b0e896f14a85aa9a28d5f755daaeeb54c897b746df7a55ccb02b340f33"}, -] - -[package.dependencies] -numpy = ">=1.17.3,<1.25.0" + {file = "scipy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7354fd7527a4b0377ce55f286805b34e8c54b91be865bac273f527e1b839019"}, + {file = "scipy-1.10.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:4b3f429188c66603a1a5c549fb414e4d3bdc2a24792e061ffbd607d3d75fd84e"}, + {file = "scipy-1.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1553b5dcddd64ba9a0d95355e63fe6c3fc303a8fd77c7bc91e77d61363f7433f"}, + {file = "scipy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c0ff64b06b10e35215abce517252b375e580a6125fd5fdf6421b98efbefb2d2"}, + {file = "scipy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:fae8a7b898c42dffe3f7361c40d5952b6bf32d10c4569098d276b4c547905ee1"}, + {file = "scipy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f1564ea217e82c1bbe75ddf7285ba0709ecd503f048cb1236ae9995f64217bd"}, + {file = "scipy-1.10.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:d925fa1c81b772882aa55bcc10bf88324dadb66ff85d548c71515f6689c6dac5"}, + {file = "scipy-1.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaea0a6be54462ec027de54fca511540980d1e9eea68b2d5c1dbfe084797be35"}, + {file = "scipy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15a35c4242ec5f292c3dd364a7c71a61be87a3d4ddcc693372813c0b73c9af1d"}, + {file = "scipy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:43b8e0bcb877faf0abfb613d51026cd5cc78918e9530e375727bf0625c82788f"}, + {file = "scipy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5678f88c68ea866ed9ebe3a989091088553ba12c6090244fdae3e467b1139c35"}, + {file = "scipy-1.10.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:39becb03541f9e58243f4197584286e339029e8908c46f7221abeea4b749fa88"}, + {file = "scipy-1.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bce5869c8d68cf383ce240e44c1d9ae7c06078a9396df68ce88a1230f93a30c1"}, + {file = "scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07c3457ce0b3ad5124f98a86533106b643dd811dd61b548e78cf4c8786652f6f"}, + {file = "scipy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:049a8bbf0ad95277ffba9b3b7d23e5369cc39e66406d60422c8cfef40ccc8415"}, + {file = "scipy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cd9f1027ff30d90618914a64ca9b1a77a431159df0e2a195d8a9e8a04c78abf9"}, + {file = "scipy-1.10.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:79c8e5a6c6ffaf3a2262ef1be1e108a035cf4f05c14df56057b64acc5bebffb6"}, + {file = "scipy-1.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51af417a000d2dbe1ec6c372dfe688e041a7084da4fdd350aeb139bd3fb55353"}, + {file = "scipy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b4735d6c28aad3cdcf52117e0e91d6b39acd4272f3f5cd9907c24ee931ad601"}, + {file = "scipy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:7ff7f37b1bf4417baca958d254e8e2875d0cc23aaadbe65b3d5b3077b0eb23ea"}, + {file = "scipy-1.10.1.tar.gz", hash = "sha256:2cf9dfb80a7b4589ba4c40ce7588986d6d5cebc5457cad2c2880f6bc2d42f3a5"}, +] + +[package.dependencies] +numpy = ">=1.19.5,<1.27.0" + +[package.extras] +dev = ["click", "doit (>=0.36.0)", "flake8", "mypy", "pycodestyle", "pydevtool", "rich-click", "typing_extensions"] +doc = ["matplotlib (>2)", "numpydoc", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-design (>=0.2.0)"] +test = ["asv", "gmpy2", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] [[package]] name = "sentencepiece" @@ -6758,14 +6761,14 @@ files = [ [[package]] name = "types-redis" -version = "4.6.0.2" +version = "4.6.0.5" description = "Typing stubs for redis" category = "dev" optional = false python-versions = "*" files = [ - {file = "types-redis-4.6.0.2.tar.gz", hash = "sha256:d0efcd96f65fd2036437c29d8c12566cfdc549345d73eddacb0488b81aff9f9e"}, - {file = "types_redis-4.6.0.2-py3-none-any.whl", hash = "sha256:a98f3386f44d045057696f3efc8869c53dda0060610e0fe3d8a4d391e2a8916a"}, + {file = "types-redis-4.6.0.5.tar.gz", hash = "sha256:5f179d10bd3ca995a8134aafcddfc3e12d52b208437c4529ef27e68acb301f38"}, + {file = "types_redis-4.6.0.5-py3-none-any.whl", hash = "sha256:4f662060247a2363c7a8f0b7e52915d68960870ff16a749a891eabcf87ed0be4"}, ] [package.dependencies] @@ -7467,4 +7470,4 @@ transformers = ["sentencepiece", "transformers"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "fc18a426fdee095f6db39860dad769054861b71bbe52b74666e1248fedcef825" +content-hash = "0e75fc02296707b1b066835582885f8da368da37666445cd7cf2b7ef47e5dc53" diff --git a/pyproject.toml b/pyproject.toml index 574c08ae76c8..cbe4c8b1125a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ attrs = ">=19.3,<22.2" jsonpickle = ">=1.3,<3.1" redis = ">=4.5.3, <5.0" absl-py = ">=0.9,<1.5" -apscheduler = ">=3.6,<3.10.2" +apscheduler = ">=3.6,<3.11" tqdm = "^4.31" networkx = ">=2.4,<3.2" fbmessenger = "~6.0.0" @@ -132,7 +132,7 @@ psycopg2-binary = ">=2.8.2,<2.10.0" python-dateutil = "~2.8" protobuf = ">=4.23.3,< 4.23.4" tensorflow_hub = "^0.13.0" -setuptools = ">=41.0.0" +setuptools = ">=65.5.1" ujson = ">=1.35,<6.0" regex = ">=2020.6,<2022.11" joblib = ">=0.15.1,<1.3.0" @@ -144,7 +144,7 @@ typing-utils = "^0.1.0" tarsafe = ">=0.0.3,<0.0.6" google-auth = "<3" CacheControl = "^0.12.9" -randomname = "^0.1.5" +randomname = ">=0.1.5,<0.3.0" pluggy = "^1.0.0" slack-sdk = "^3.19.2" confluent-kafka = ">=1.9.2,<3.0.0" @@ -154,7 +154,9 @@ structlog-sentry = "^2.0.2" # pin dnspython to avoid dependency incompatibility # in order to fix https://rasahq.atlassian.net/browse/ATO-1419 dnspython = "2.3.0" - +wheel = ">=0.38.1" +certifi = ">=2023.7.22" +cryptography = ">=41.0.2" [[tool.poetry.dependencies.tensorflow-io-gcs-filesystem]] version = "==0.31" markers = "sys_platform == 'win32'" @@ -193,7 +195,7 @@ version = ">=1.4.1,<1.7.3" python = "~=3.7.0" [[tool.poetry.dependencies.scipy]] -version = ">=1.4.1,<1.9.0" +version = ">=1.10.0" python = ">=3.8,<3.11" [[tool.poetry.dependencies.scikit-learn]] diff --git a/rasa/core/actions/action.py b/rasa/core/actions/action.py index 7d6344098ea1..e150114fe26c 100644 --- a/rasa/core/actions/action.py +++ b/rasa/core/actions/action.py @@ -1066,7 +1066,6 @@ async def run( metadata: Optional[Dict[Text, Any]] = None, ) -> List[Event]: """Runs action. Please see parent class for the full docstring.""" - fallback = {"text": ""} message = metadata.get("message", fallback) if metadata else fallback return [create_bot_utterance(message)] @@ -1353,7 +1352,6 @@ def extract_slot_value_from_predefined_mapping( tracker: "DialogueStateTracker", ) -> List[Any]: """Extracts slot value if slot has an applicable predefined mapping.""" - if tracker.has_bot_message_after_latest_user_message(): # TODO: this needs further validation - not sure if this breaks something!!! diff --git a/rasa/core/lock_store.py b/rasa/core/lock_store.py index ab3c539b3853..b7d495b3f1f5 100644 --- a/rasa/core/lock_store.py +++ b/rasa/core/lock_store.py @@ -173,7 +173,6 @@ def finish_serving(self, conversation_id: Text, ticket_number: int) -> None: Removes ticket from lock and saves lock. """ - lock = self.get_lock(conversation_id) if lock: lock.remove_ticket_for(ticket_number) @@ -181,7 +180,6 @@ def finish_serving(self, conversation_id: Text, ticket_number: int) -> None: def cleanup(self, conversation_id: Text, ticket_number: int) -> None: """Remove lock for `conversation_id` if no one is waiting.""" - self.finish_serving(conversation_id, ticket_number) if not self.is_someone_waiting(conversation_id): self.delete_lock(conversation_id) @@ -204,6 +202,9 @@ def __init__( db: int = 1, password: Optional[Text] = None, use_ssl: bool = False, + ssl_certfile: Optional[Text] = None, + ssl_keyfile: Optional[Text] = None, + ssl_ca_certs: Optional[Text] = None, key_prefix: Optional[Text] = None, socket_timeout: float = DEFAULT_SOCKET_TIMEOUT_IN_SECONDS, ) -> None: @@ -217,6 +218,9 @@ def __init__( password: The password which should be used for authentication with the Redis database. use_ssl: `True` if SSL should be used for the connection to Redis. + ssl_certfile: Path to the SSL certificate file. + ssl_keyfile: Path to the SSL private key file. + ssl_ca_certs: Path to the SSL CA certificate file. key_prefix: prefix to prepend to all keys used by the lock store. Must be alphanumeric. socket_timeout: Timeout in seconds after which an exception will be raised @@ -230,6 +234,9 @@ def __init__( db=int(db), password=password, ssl=use_ssl, + ssl_certfile=ssl_certfile, + ssl_keyfile=ssl_keyfile, + ssl_ca_certs=ssl_ca_certs, socket_timeout=socket_timeout, ) diff --git a/rasa/core/nlg/callback.py b/rasa/core/nlg/callback.py index a8d0e681e055..d997f6ace092 100644 --- a/rasa/core/nlg/callback.py +++ b/rasa/core/nlg/callback.py @@ -73,7 +73,7 @@ async def generate( **kwargs: Any, ) -> Dict[Text, Any]: """Retrieve a named response from the domain using an endpoint.""" - domain_responses = kwargs.pop("domain_responses") + domain_responses = kwargs.pop("domain_responses", None) response_id = self.fetch_response_id( utter_action, tracker, output_channel, domain_responses ) diff --git a/rasa/engine/graph.py b/rasa/engine/graph.py index 2e0e26f9e3f3..ad0ab228989c 100644 --- a/rasa/engine/graph.py +++ b/rasa/engine/graph.py @@ -254,6 +254,15 @@ def required_packages() -> List[Text]: """Any extra python dependencies required for this component to run.""" return [] + @classmethod + def fingerprint_addon(cls, config: Dict[str, Any]) -> Optional[str]: + """Adds additional data to the fingerprint calculation. + + This is useful if a component uses external data that is not provided + by the graph. + """ + return None + class GraphNodeHook(ABC): """Holds functionality to be run before and after a `GraphNode`.""" diff --git a/rasa/engine/training/fingerprinting.py b/rasa/engine/training/fingerprinting.py index bf286c10a438..17838a7190b9 100644 --- a/rasa/engine/training/fingerprinting.py +++ b/rasa/engine/training/fingerprinting.py @@ -50,6 +50,10 @@ def calculate_fingerprint_key( "dependency_versions": dependency_versions, } + fingerprint_addon = graph_component_class.fingerprint_addon(config) + if fingerprint_addon is not None: + fingerprint_data["addon"] = fingerprint_addon + fingerprint_key = rasa.shared.utils.io.deep_container_fingerprint(fingerprint_data) logger.debug( diff --git a/rasa/shared/core/training_data/visualization.py b/rasa/shared/core/training_data/visualization.py index 3e7049cbc9fb..109082e960b8 100644 --- a/rasa/shared/core/training_data/visualization.py +++ b/rasa/shared/core/training_data/visualization.py @@ -52,10 +52,10 @@ def __init__(self, nlu_training_data: "TrainingData") -> None: def _create_reverse_mapping( data: "TrainingData", ) -> Dict[Dict[Text, Any], List["Message"]]: - """Create a mapping from intent to messages - - This allows a faster intent lookup.""" + """Create a mapping from intent to messages. + This allows a faster intent lookup. + """ d = defaultdict(list) for example in data.training_examples: if example.get(INTENT, {}) is not None: @@ -95,8 +95,8 @@ def _fingerprint_node( remember max history number of nodes we have visited. Hence, if we randomly walk on our directed graph, always only remembering the last `max_history` nodes we have visited, we can never remember if we have visited node A or - node B if both have the same fingerprint.""" - + node B if both have the same fingerprint. + """ # the candidate list contains all node paths that haven't been # extended till `max_history` length yet. candidates: Deque = deque() @@ -140,8 +140,8 @@ def _outgoing_edges_are_similar( it doesn't matter if you are in a or b. As your path will be the same because the outgoing edges will lead you to - the same nodes anyways.""" - + the same nodes anyways. + """ ignored = {node_b, node_a} a_edges = { (target, k) @@ -177,8 +177,8 @@ def _add_edge( **kwargs: Any, ) -> None: """Adds an edge to the graph if the edge is not already present. Uses the - label as the key.""" - + label as the key. + """ if key is None: key = EDGE_NONE_LABEL @@ -197,8 +197,8 @@ def _transfer_style( ) -> Dict[Text, Any]: """Copy over class names from source to target for all special classes. - Used if a node is highlighted and merged with another node.""" - + Used if a node is highlighted and merged with another node. + """ clazzes = source.get("class", "") special_classes = {"dashed", "active"} @@ -216,7 +216,6 @@ def _transfer_style( def _merge_equivalent_nodes(graph: "networkx.MultiDiGraph", max_history: int) -> None: """Searches for equivalent nodes in the graph and merges them.""" - changed = True # every node merge changes the graph and can trigger previously # impossible node merges - we need to repeat until @@ -364,7 +363,6 @@ def _length_of_common_action_prefix(this: List[Event], other: List[Event]) -> in def _add_default_nodes(graph: "networkx.MultiDiGraph", fontsize: int = 12) -> None: """Add the standard nodes we need.""" - graph.add_node( START_NODE_ID, label="START", @@ -386,7 +384,6 @@ def _add_default_nodes(graph: "networkx.MultiDiGraph", fontsize: int = 12) -> No def _create_graph(fontsize: int = 12) -> "networkx.MultiDiGraph": """Create a graph and adds the default nodes.""" - import networkx as nx graph = nx.MultiDiGraph() @@ -402,7 +399,6 @@ def _add_message_edge( is_current: bool, ) -> None: """Create an edge based on the user message.""" - if message: message_key = message.get("intent", {}).get("name", None) message_label = message.get("text", None) @@ -530,7 +526,6 @@ def _remove_auxiliary_nodes( graph: "networkx.MultiDiGraph", special_node_idx: int ) -> None: """Remove any temporary or unused nodes.""" - graph.remove_node(TMP_NODE_ID) if not graph.predecessors(END_NODE_ID): diff --git a/tests/engine/training/test_fingerprinting.py b/tests/engine/training/test_fingerprinting.py index ee1c94205211..845f92a75036 100644 --- a/tests/engine/training/test_fingerprinting.py +++ b/tests/engine/training/test_fingerprinting.py @@ -1,8 +1,15 @@ import inspect +import os.path +import tempfile +from typing import Dict, Text, Any, Optional from unittest.mock import Mock from _pytest.monkeypatch import MonkeyPatch +import rasa.shared.utils.io from rasa.core.policies.ted_policy import TEDPolicy +from rasa.engine.graph import ExecutionContext, GraphComponent +from rasa.engine.storage.resource import Resource +from rasa.engine.storage.storage import ModelStorage from rasa.engine.training import fingerprinting from rasa.nlu.classifiers.diet_classifier import DIETClassifier from rasa.nlu.selectors.response_selector import ResponseSelector @@ -76,3 +83,44 @@ def test_fingerprint_changes_due_to_changed_source(monkeypatch: MonkeyPatch): assert key1 != key2 get_source_mock.assert_called_once_with(TEDPolicy) + + +def test_fingerprint_changes_when_external_file_changes(): + tmp_file = tempfile.mktemp() + + class MinimalComponent(GraphComponent): + @classmethod + def create( + cls, + config: Dict[Text, Any], + model_storage: ModelStorage, + resource: Resource, + execution_context: ExecutionContext, + ) -> "MinimalComponent": + return MinimalComponent() + + @classmethod + def fingerprint_addon(cls, config: Dict[str, Any]) -> Optional[str]: + if not os.path.exists(tmp_file): + return None + else: + return rasa.shared.utils.io.get_text_hash(open(tmp_file, "r").read()) + + with open(tmp_file, "w") as external_data: + external_data.write("This is a test.") + + fingerprint_1 = fingerprinting.calculate_fingerprint_key(MinimalComponent, {}, {}) + + fingerprint_2 = fingerprinting.calculate_fingerprint_key(MinimalComponent, {}, {}) + + assert fingerprint_1 == fingerprint_2 + + # overwrite the original external data + with open(tmp_file, "w") as external_data: + external_data.write("This is a test for changes in external data.") + + fingerprint_3 = fingerprinting.calculate_fingerprint_key(MinimalComponent, {}, {}) + + assert fingerprint_3 != fingerprint_1 + + os.remove(tmp_file)