From b1f43ccc1acc2087bc276d1f06c4abbd82b3cbab Mon Sep 17 00:00:00 2001 From: Roberto <43567378+rasabot@users.noreply.github.com> Date: Tue, 1 Feb 2022 08:08:15 +0100 Subject: [PATCH] Merge 3.0.x into main (#10777) * Update dependencies in 3.0 to align with rasa-sdk (#10667 * bump rasa-sdk * filtering messages during training/prediction draft * remove unfeaturized messages for some nlu components * update forms docs with dynamic form example for removal of required slot * Use tf.function for model prediction in RasaModel. (#10738) * Use prompt_toolkit ^2.0 (#10761) Co-authored-by: jupyterjazz Co-authored-by: carlad Co-authored-by: Anca Lita <27920906+ancalita@users.noreply.github.com> Co-authored-by: Matthias Leimeister --- CHANGELOG.mdx | 15 ++ changelog/10519.bugfix.md | 1 - changelog/10590.removal.md | 1 - changelog/592.misc.md | 1 - docs/docs/forms.mdx | 31 ++- poetry.lock | 219 +++++++++--------- pyproject.toml | 4 +- rasa/core/actions/action.py | 3 + rasa/core/tracker_store.py | 17 ++ rasa/nlu/classifiers/diet_classifier.py | 10 + .../classifiers/sklearn_intent_classifier.py | 20 +- rasa/nlu/extractors/crf_entity_extractor.py | 14 +- rasa/utils/tensorflow/models.py | 2 +- rasa/version.py | 2 +- scripts/release.py | 3 +- tests/core/test_actions.py | 74 ++++++ tests/core/test_tracker_stores.py | 11 +- tests/nlu/classifiers/test_diet_classifier.py | 47 ++-- .../classifiers/test_sklearn_classifier.py | 36 +++ .../extractors/test_crf_entity_extractor.py | 19 +- tests/nlu/selectors/test_selectors.py | 39 +++- .../tokenizers/test_whitespace_tokenizer.py | 1 + 22 files changed, 426 insertions(+), 144 deletions(-) delete mode 100644 changelog/10519.bugfix.md delete mode 100644 changelog/10590.removal.md delete mode 100644 changelog/592.misc.md diff --git a/CHANGELOG.mdx b/CHANGELOG.mdx index 6185c71b3436..0b535baa0493 100644 --- a/CHANGELOG.mdx +++ b/CHANGELOG.mdx @@ -16,6 +16,21 @@ https://github.com/RasaHQ/rasa/tree/main/changelog/ . --> +## [3.0.6] - 2022-01-28 +### Deprecations and Removals +- [#10590](https://github.com/rasahq/rasa/issues/10590): Removed CompositionView. + +### Bugfixes +- [#10504](https://github.com/rasahq/rasa/issues/10504): Fixes a bug which was caused by `DIETClassifier` (`ResponseSelector`, `SklearnIntentClassifier` and `CRFEntityExtractor` have the same issue) trying to process message which didn't have required features. Implements removing unfeaturized messages for the above-mentioned components before training and prediction. +- [#10540](https://github.com/rasahq/rasa/issues/10540): Enable slots with `from_entity` mapping that are not part of a form's required slots to be set during active loop. +- [#10673](https://github.com/rasahq/rasa/issues/10673): Catch `ValueError` for any port values that cannot be cast to integer and re-raise as `RasaException` during the initialisation of `SQLTrackerStore`. +- [#10728](https://github.com/rasahq/rasa/issues/10728): Use `tf.function` for model prediction to improve inference speed. +- [#10761](https://github.com/rasahq/rasa/issues/10761): Tie prompt-toolkit to ^2.0 to fix `rasa-shell`. + +### Improved Documentation +- [#10536](https://github.com/rasahq/rasa/issues/10536): Update dynamic form behaviour docs section with an example on how to override `required_slots` in case of removal of a form required slot. + + ## [3.0.5] - 2022-01-19 ### Bugfixes - [#10519](https://github.com/rasahq/rasa/issues/10519): Corrects `transformer_size` parameter value (`None` by default) with a default size during loading in case `ResponseSelector` contains transformer layers. diff --git a/changelog/10519.bugfix.md b/changelog/10519.bugfix.md deleted file mode 100644 index acbda8ebf72d..000000000000 --- a/changelog/10519.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Corrects `transformer_size` parameter value (`None` by default) with a default size during loading in case `ResponseSelector` contains transformer layers. diff --git a/changelog/10590.removal.md b/changelog/10590.removal.md deleted file mode 100644 index 7be422bf06b2..000000000000 --- a/changelog/10590.removal.md +++ /dev/null @@ -1 +0,0 @@ -Removed CompositionView. diff --git a/changelog/592.misc.md b/changelog/592.misc.md deleted file mode 100644 index b8efb1de7a47..000000000000 --- a/changelog/592.misc.md +++ /dev/null @@ -1 +0,0 @@ -Update `black` version to align with version used by `rasa-sdk`. \ No newline at end of file diff --git a/docs/docs/forms.mdx b/docs/docs/forms.mdx index 37da778b15e9..6dff338073e9 100644 --- a/docs/docs/forms.mdx +++ b/docs/docs/forms.mdx @@ -350,7 +350,7 @@ By default Rasa Open Source will ask for the next empty slot from the slots listed for your form in the domain file. If you use [custom slot mappings](forms.mdx#custom-slot-mappings) and the `FormValidationAction`, it will ask for the first empty slot returned by the `required_slots` method. If all -slots in `required_slots` are filled the form will be be deactivated. +slots in `required_slots` are filled the form will be deactivated. If needed, you can update the required slots of your form dynamically. This is, for example, useful when you need further details based on how @@ -388,6 +388,35 @@ class ValidateRestaurantForm(FormValidationAction): return additional_slots + domain_slots ``` +If conversely, you want to remove a slot from the form's `required_slots` defined in the domain file under certain conditions, +you should copy the `domain_slots` over to a new variable and apply changes to that new variable instead of directly modifying +`domain_slots`. Directly modifying `domain_slots` can cause unexpected behaviour. For example: + +```python +from typing import Text, List, Optional + +from rasa_sdk.forms import FormValidationAction + +class ValidateBookingForm(FormValidationAction): + def name(self) -> Text: + return "validate_booking_form" + + async def required_slots( + self, + domain_slots: List[Text], + dispatcher: "CollectingDispatcher", + tracker: "Tracker", + domain: "DomainDict", + ) -> List[Text]: + updated_slots = domain_slots.copy() + if tracker.slots.get("existing_customer") is True: + # If the user is an existing customer, + # do not request the `email_address` slot + updated_slots.remove("email_address") + + return updated_slots +``` + ### The requested_slot slot The slot `requested_slot` is automatically added to the domain as a diff --git a/poetry.lock b/poetry.lock index 8a115ea7bec8..7e5c681635b1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,7 +11,7 @@ six = "*" [[package]] name = "aio-pika" -version = "6.8.1" +version = "6.8.2" description = "Wrapper for the aiormq for asyncio and humans." category = "main" optional = false @@ -231,11 +231,11 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "bandit" -version = "1.7.1" +version = "1.7.2" description = "Security oriented static analyser for python code." category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" [package.dependencies] colorama = {version = ">=0.3.9", markers = "platform_system == \"Windows\""} @@ -243,6 +243,11 @@ GitPython = ">=1.0.1" PyYAML = ">=5.3.1" stevedore = ">=1.20.0" +[package.extras] +test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)", "toml"] +toml = ["toml"] +yaml = ["pyyaml"] + [[package]] name = "bidict" version = "0.21.4" @@ -288,14 +293,14 @@ numpy = ">=1.15.0" [[package]] name = "boto3" -version = "1.20.41" +version = "1.20.45" description = "The AWS SDK for Python" category = "main" optional = false python-versions = ">= 3.6" [package.dependencies] -botocore = ">=1.23.41,<1.24.0" +botocore = ">=1.23.45,<1.24.0" jmespath = ">=0.7.1,<1.0.0" s3transfer = ">=0.5.0,<0.6.0" @@ -304,7 +309,7 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.23.41" +version = "1.23.45" description = "Low-level, data-driven core of boto 3." category = "main" optional = false @@ -475,11 +480,11 @@ python-versions = ">=3.6,<4.0" [[package]] name = "coverage" -version = "6.2" +version = "6.3" description = "Code coverage measurement for Python" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.extras] toml = ["tomli"] @@ -1819,7 +1824,7 @@ wcwidth = "*" [[package]] name = "protobuf" -version = "3.19.3" +version = "3.19.4" description = "Protocol Buffers" category = "main" optional = false @@ -2030,7 +2035,7 @@ python-versions = "*" [[package]] name = "pyreadline3" -version = "3.3" +version = "3.4.1" description = "A python implementation of GNU readline." category = "main" optional = false @@ -2264,14 +2269,15 @@ fire = "*" [[package]] name = "rasa-sdk" -version = "3.0.3" +version = "3.0.4" description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants" category = "main" optional = false -python-versions = ">=3.7,<3.9" +python-versions = ">=3.7,<3.10" [package.dependencies] coloredlogs = ">=10,<16" +prompt-toolkit = ">=2.0,<3.0" requests = ">=2.23,<3.0" sanic = ">=21.6.0,<22.0.0" Sanic-Cors = ">=1.0.0,<2.0.0" @@ -3420,7 +3426,7 @@ transformers = ["transformers"] [metadata] lock-version = "1.1" python-versions = ">=3.7,<3.9" -content-hash = "8febcb011ab9a8363f9cdae60ae576f50880ac9aedf5d6bb7c3b67e01f642a96" +content-hash = "f263c289c2f19eff03da5b4eda6a5efbaa8b370445e52db6e0466178492a8ace" [metadata.files] absl-py = [ @@ -3428,8 +3434,8 @@ absl-py = [ {file = "absl_py-0.13.0-py3-none-any.whl", hash = "sha256:62bd4e248ddb19d81aec8f9446b407ff37c8175c2ba88266a7afa9b4ce4a333b"}, ] aio-pika = [ - {file = "aio-pika-6.8.1.tar.gz", hash = "sha256:c2b2b46949a34252ff0e64c3bc208eef1893e5791b51aeefabf1676788d56b66"}, - {file = "aio_pika-6.8.1-py3-none-any.whl", hash = "sha256:059ab8ecc03d73997f64ed28df7269105984232174d0e6406389c4e8ed30941c"}, + {file = "aio-pika-6.8.2.tar.gz", hash = "sha256:d89658148def0d8b8d795868a753fe2906f8d8fccee53e4a1b5093ddd3d2dc5c"}, + {file = "aio_pika-6.8.2-py3-none-any.whl", hash = "sha256:4bf23e54bceb86b789d4b4a72ed65f2d83ede429d5f343de838ca72e54f00475"}, ] aiofiles = [ {file = "aiofiles-0.8.0-py3-none-any.whl", hash = "sha256:7a973fc22b29e9962d0897805ace5856e6a566ab1f0c8e5c91ff6c866519c937"}, @@ -3531,8 +3537,8 @@ backoff = [ {file = "backoff-1.10.0.tar.gz", hash = "sha256:b8fba021fac74055ac05eb7c7bfce4723aedde6cd0a504e5326bcb0bdd6d19a4"}, ] bandit = [ - {file = "bandit-1.7.1-py3-none-any.whl", hash = "sha256:f5acd838e59c038a159b5c621cf0f8270b279e884eadd7b782d7491c02add0d4"}, - {file = "bandit-1.7.1.tar.gz", hash = "sha256:a81b00b5436e6880fa8ad6799bc830e02032047713cbb143a12939ac67eb756c"}, + {file = "bandit-1.7.2-py3-none-any.whl", hash = "sha256:e20402cadfd126d85b68ed4c8862959663c8c372dbbb1fca8f8e2c9f55a067ec"}, + {file = "bandit-1.7.2.tar.gz", hash = "sha256:6d11adea0214a43813887bfe71a377b5a9955e4c826c8ffd341b494e3ab25260"}, ] bidict = [ {file = "bidict-0.21.4-py3-none-any.whl", hash = "sha256:3ac67daa353ecf853a1df9d3e924f005e729227a60a8dbada31a4c31aba7f654"}, @@ -3543,7 +3549,7 @@ black = [ {file = "black-21.7b0.tar.gz", hash = "sha256:c8373c6491de9362e39271630b65b964607bc5c79c83783547d76c839b3aa219"}, ] blis = [ - {file = "blis-0.7.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:98eba77b1e1fde7813bc0453ab78b6ae2067f5bc0fe9e3abc671b2895cfecf33"}, + {file = "blis-0.7.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5812a7c04561ae7332cf730f57d9f82cbd12c5f86a5bfad66ee244e51d06266d"}, {file = "blis-0.7.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eecfce3d8fce61dede7b0ae0dffa461c22072437b6cde85587db0c1aa75b450"}, {file = "blis-0.7.5-cp310-cp310-win_amd64.whl", hash = "sha256:0e476931f0d5703a21c77e7f69b8ebdeeea493fc7858a86f627ac2b376a12c8d"}, {file = "blis-0.7.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:5966ddf3bce84aa7bb09ce4ca059309602fa63280a5d5e5365bb2a294bd5a138"}, @@ -3561,12 +3567,12 @@ blis = [ {file = "blis-0.7.5.tar.gz", hash = "sha256:833e01e9eaff4c01aa6e049bbc1e6acb9eca6ee513d7b35b5bf135d49705ad33"}, ] boto3 = [ - {file = "boto3-1.20.41-py3-none-any.whl", hash = "sha256:aaddf6cf93568b734ad62fd96991775bccc7f016e93ff4e98dc1aa4f7586440c"}, - {file = "boto3-1.20.41.tar.gz", hash = "sha256:fb02467a6e8109c7db994ba77fa2e8381ed129ce312988d8ef23edf6e3a3c7f1"}, + {file = "boto3-1.20.45-py3-none-any.whl", hash = "sha256:2ea0e0aa1494ef87a342260da8d9381000d774e73d83ee3d7c2906fefcbe2c32"}, + {file = "boto3-1.20.45.tar.gz", hash = "sha256:3d9cb5edeff09598b7065abe5b42affb0b6e1c0c805ab57c051d0f3592a0f02b"}, ] botocore = [ - {file = "botocore-1.23.41-py3-none-any.whl", hash = "sha256:41104e1c976c9c410387b3c7d265466b314f287a1c13fd4b543768135301058a"}, - {file = "botocore-1.23.41.tar.gz", hash = "sha256:9137c59c4eb1dee60ae3c710e94f56119a1b33b0b17ff3ad878fc2f4ce77843a"}, + {file = "botocore-1.23.45-py3-none-any.whl", hash = "sha256:793a0a4b572bfb157ba17971e4d783766f59c5a0f117407bbeefeb577efa1ed1"}, + {file = "botocore-1.23.45.tar.gz", hash = "sha256:782323846dad22ea814a64bd64b89c7f04550812d3945ce77748b2bac6fe745b"}, ] cachecontrol = [ {file = "CacheControl-0.12.10-py2.py3-none-any.whl", hash = "sha256:b0d43d8f71948ef5ebdee5fe236b86c6ffc7799370453dccb0e894c20dfa487c"}, @@ -3680,53 +3686,50 @@ colorhash = [ {file = "colorhash-1.0.4.tar.gz", hash = "sha256:5460c5539b68712c97b09ba41e5200c81dce6e23f4533d0f4f8beafc3eb2fafa"}, ] coverage = [ - {file = "coverage-6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840"}, - {file = "coverage-6.2-cp310-cp310-win32.whl", hash = "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c"}, - {file = "coverage-6.2-cp310-cp310-win_amd64.whl", hash = "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f"}, - {file = "coverage-6.2-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76"}, - {file = "coverage-6.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47"}, - {file = "coverage-6.2-cp311-cp311-win_amd64.whl", hash = "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64"}, - {file = "coverage-6.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781"}, - {file = "coverage-6.2-cp36-cp36m-win32.whl", hash = "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a"}, - {file = "coverage-6.2-cp36-cp36m-win_amd64.whl", hash = "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0"}, - {file = "coverage-6.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8"}, - {file = "coverage-6.2-cp37-cp37m-win32.whl", hash = "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4"}, - {file = "coverage-6.2-cp37-cp37m-win_amd64.whl", hash = "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74"}, - {file = "coverage-6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57"}, - {file = "coverage-6.2-cp38-cp38-win32.whl", hash = "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c"}, - {file = "coverage-6.2-cp38-cp38-win_amd64.whl", hash = "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2"}, - {file = "coverage-6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3"}, - {file = "coverage-6.2-cp39-cp39-win32.whl", hash = "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282"}, - {file = "coverage-6.2-cp39-cp39-win_amd64.whl", hash = "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644"}, - {file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"}, - {file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"}, + {file = "coverage-6.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e8071e7d9ba9f457fc674afc3de054450be2c9b195c470147fbbc082468d8ff7"}, + {file = "coverage-6.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:86c91c511853dfda81c2cf2360502cb72783f4b7cebabef27869f00cbe1db07d"}, + {file = "coverage-6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c4ce3b647bd1792d4394f5690d9df6dc035b00bcdbc5595099c01282a59ae01"}, + {file = "coverage-6.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a491e159294d756e7fc8462f98175e2d2225e4dbe062cca7d3e0d5a75ba6260"}, + {file = "coverage-6.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d008e0f67ac800b0ca04d7914b8501312c8c6c00ad8c7ba17754609fae1231a"}, + {file = "coverage-6.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4578728c36de2801c1deb1c6b760d31883e62e33f33c7ba8f982e609dc95167d"}, + {file = "coverage-6.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7ee317486593193e066fc5e98ac0ce712178c21529a85c07b7cb978171f25d53"}, + {file = "coverage-6.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2bc85664b06ba42d14bb74d6ddf19d8bfc520cb660561d2d9ce5786ae72f71b5"}, + {file = "coverage-6.3-cp310-cp310-win32.whl", hash = "sha256:27a94db5dc098c25048b0aca155f5fac674f2cf1b1736c5272ba28ead2fc267e"}, + {file = "coverage-6.3-cp310-cp310-win_amd64.whl", hash = "sha256:bde4aeabc0d1b2e52c4036c54440b1ad05beeca8113f47aceb4998bb7471e2c2"}, + {file = "coverage-6.3-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:509c68c3e2015022aeda03b003dd68fa19987cdcf64e9d4edc98db41cfc45d30"}, + {file = "coverage-6.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e4ff163602c5c77e7bb4ea81ba5d3b793b4419f8acd296aae149370902cf4e92"}, + {file = "coverage-6.3-cp311-cp311-win_amd64.whl", hash = "sha256:d1675db48490e5fa0b300f6329ecb8a9a37c29b9ab64fa9c964d34111788ca2d"}, + {file = "coverage-6.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7eed8459a2b81848cafb3280b39d7d49950d5f98e403677941c752e7e7ee47cb"}, + {file = "coverage-6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b4285fde5286b946835a1a53bba3ad41ef74285ba9e8013e14b5ea93deaeafc"}, + {file = "coverage-6.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a4748349734110fd32d46ff8897b561e6300d8989a494ad5a0a2e4f0ca974fc7"}, + {file = "coverage-6.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:823f9325283dc9565ba0aa2d240471a93ca8999861779b2b6c7aded45b58ee0f"}, + {file = "coverage-6.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fff16a30fdf57b214778eff86391301c4509e327a65b877862f7c929f10a4253"}, + {file = "coverage-6.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:da1a428bdbe71f9a8c270c7baab29e9552ac9d0e0cba5e7e9a4c9ee6465d258d"}, + {file = "coverage-6.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7d82c610a2e10372e128023c5baf9ce3d270f3029fe7274ff5bc2897c68f1318"}, + {file = "coverage-6.3-cp37-cp37m-win32.whl", hash = "sha256:11e61c5548ecf74ea1f8b059730b049871f0e32b74f88bd0d670c20c819ad749"}, + {file = "coverage-6.3-cp37-cp37m-win_amd64.whl", hash = "sha256:8e0c3525b1a182c8ffc9bca7e56b521e0c2b8b3e82f033c8e16d6d721f1b54d6"}, + {file = "coverage-6.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a189036c50dcd56100746139a459f0d27540fef95b09aba03e786540b8feaa5f"}, + {file = "coverage-6.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:32168001f33025fd756884d56d01adebb34e6c8c0b3395ca8584cdcee9c7c9d2"}, + {file = "coverage-6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5d79c9af3f410a2b5acad91258b4ae179ee9c83897eb9de69151b179b0227f5"}, + {file = "coverage-6.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:85c5fc9029043cf8b07f73fbb0a7ab6d3b717510c3b5642b77058ea55d7cacde"}, + {file = "coverage-6.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a7596aa2f2b8fa5604129cfc9a27ad9beec0a96f18078cb424d029fdd707468d"}, + {file = "coverage-6.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ce443a3e6df90d692c38762f108fc4c88314bf477689f04de76b3f252e7a351c"}, + {file = "coverage-6.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:012157499ec4f135fc36cd2177e3d1a1840af9b236cbe80e9a5ccfc83d912a69"}, + {file = "coverage-6.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0a34d313105cdd0d3644c56df2d743fe467270d6ab93b5d4a347eb9fec8924d6"}, + {file = "coverage-6.3-cp38-cp38-win32.whl", hash = "sha256:6e78b1e25e5c5695dea012be473e442f7094d066925604be20b30713dbd47f89"}, + {file = "coverage-6.3-cp38-cp38-win_amd64.whl", hash = "sha256:433b99f7b0613bdcdc0b00cc3d39ed6d756797e3b078d2c43f8a38288520aec6"}, + {file = "coverage-6.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9ed3244b415725f08ca3bdf02ed681089fd95e9465099a21c8e2d9c5d6ca2606"}, + {file = "coverage-6.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab4fc4b866b279740e0d917402f0e9a08683e002f43fa408e9655818ed392196"}, + {file = "coverage-6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c8582e9280f8d0f38114fe95a92ae8d0790b56b099d728cc4f8a2e14b1c4a18c"}, + {file = "coverage-6.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c72bb4679283c6737f452eeb9b2a0e570acaef2197ad255fb20162adc80bea76"}, + {file = "coverage-6.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca29c352389ea27a24c79acd117abdd8a865c6eb01576b6f0990cd9a4e9c9f48"}, + {file = "coverage-6.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:152cc2624381df4e4e604e21bd8e95eb8059535f7b768c1fb8b8ae0b26f47ab0"}, + {file = "coverage-6.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:51372e24b1f7143ee2df6b45cff6a721f3abe93b1e506196f3ffa4155c2497f7"}, + {file = "coverage-6.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:72d9d186508325a456475dd05b1756f9a204c7086b07fffb227ef8cee03b1dc2"}, + {file = "coverage-6.3-cp39-cp39-win32.whl", hash = "sha256:649df3641eb351cdfd0d5533c92fc9df507b6b2bf48a7ef8c71ab63cbc7b5c3c"}, + {file = "coverage-6.3-cp39-cp39-win_amd64.whl", hash = "sha256:e67ccd53da5958ea1ec833a160b96357f90859c220a00150de011b787c27b98d"}, + {file = "coverage-6.3-pp36.pp37.pp38-none-any.whl", hash = "sha256:27ac7cb84538e278e07569ceaaa6f807a029dc194b1c819a9820b9bb5dbf63ab"}, + {file = "coverage-6.3.tar.gz", hash = "sha256:987a84ff98a309994ca77ed3cc4b92424f824278e48e4bf7d1bb79a63cfe2099"}, ] coveralls = [ {file = "coveralls-3.3.1-py2.py3-none-any.whl", hash = "sha256:f42015f31d386b351d4226389b387ae173207058832fbf5c8ec4b40e27b16026"}, @@ -3758,7 +3761,7 @@ cycler = [ {file = "cycler-0.11.0.tar.gz", hash = "sha256:9c87405839a19696e837b3b818fed3f5f69f16f1eec1a1ad77e043dcea9c772f"}, ] cymem = [ - {file = "cymem-2.0.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2b4e27e739f09f16c7c0190f962ffe60dab39cb6a229d5c13e274d16f46a17e8"}, + {file = "cymem-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:700540b68e96a7056d0691d467df2bbaaf0934a3e6fe2383669998cbee19580a"}, {file = "cymem-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:971cf0a8437dfb4185c3049c086e463612fe849efadc0f5cc153fc81c501da7d"}, {file = "cymem-2.0.6-cp310-cp310-win_amd64.whl", hash = "sha256:6b0d1a6b0a1296f31fa9e4b7ae5ea49394084ecc883b1ae6fec4844403c43468"}, {file = "cymem-2.0.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b8e1c18bb00800425576710468299153caad20c64ddb6819d40a6a34e21ee21c"}, @@ -4478,7 +4481,7 @@ multidict = [ {file = "multidict-5.2.0.tar.gz", hash = "sha256:0dd1c93edb444b33ba2274b66f63def8a327d607c6c790772f448a53b6ea59ce"}, ] murmurhash = [ - {file = "murmurhash-1.0.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a814d559afe2a97ad40accf21ce96e8b04a3ff5a08f80c02b7acd427dbb7d567"}, + {file = "murmurhash-1.0.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1431d817e1fff1ed35f8dc54dd5b4d70165ec98076de8aca351805f8037293f3"}, {file = "murmurhash-1.0.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c7b8cc4a8db1c821b80f8ca70a25c3166b14d68ecef8693a117c6a0b1d74ace"}, {file = "murmurhash-1.0.6-cp310-cp310-win_amd64.whl", hash = "sha256:e40790fdaf65213d70da4ed9229f16f6d6376310dc8fc23eacc98e6151c6ae7e"}, {file = "murmurhash-1.0.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a78d53f047c3410ce4c589d9b47090f628f844ed5694418144e63cfe7f3da7e9"}, @@ -4678,7 +4681,7 @@ pluggy = [ {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] preshed = [ - {file = "preshed-3.0.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a9683730127658b531120b4ed5cff1f2a567318ab75e9ab0f22cc84ae1486c23"}, + {file = "preshed-3.0.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:66a71ced487516cf81fd0431a3a843514262ae2f33e9a7688b87562258fa75d5"}, {file = "preshed-3.0.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c98f725d8478f3ade4ab1ea00f50a92d2d9406d37276bc46fd8bab1d47452c4"}, {file = "preshed-3.0.6-cp310-cp310-win_amd64.whl", hash = "sha256:ea8aa9610837e907e8442e79300df0a861bfdb4dcaf026a5d9642a688ad04815"}, {file = "preshed-3.0.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e03ae3eee961106a517fcd827b5a7c51f7317236b3e665c989054ab8dc381d28"}, @@ -4701,32 +4704,32 @@ prompt-toolkit = [ {file = "prompt_toolkit-2.0.10.tar.gz", hash = "sha256:f15af68f66e664eaa559d4ac8a928111eebd5feda0c11738b5998045224829db"}, ] protobuf = [ - {file = "protobuf-3.19.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:1cb2ed66aac593adbf6dca4f07cd7ee7e2958b17bbc85b2cc8bc564ebeb258ec"}, - {file = "protobuf-3.19.3-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:898bda9cd37ec0c781b598891e86435de80c3bfa53eb483a9dac5a11ec93e942"}, - {file = "protobuf-3.19.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ad761ef3be34c8bdc7285bec4b40372a8dad9e70cfbdc1793cd3cf4c1a4ce74"}, - {file = "protobuf-3.19.3-cp310-cp310-win32.whl", hash = "sha256:2cddcbcc222f3144765ccccdb35d3621dc1544da57a9aca7e1944c1a4fe3db11"}, - {file = "protobuf-3.19.3-cp310-cp310-win_amd64.whl", hash = "sha256:6202df8ee8457cb00810c6e76ced480f22a1e4e02c899a14e7b6e6e1de09f938"}, - {file = "protobuf-3.19.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:397d82f1c58b76445469c8c06b8dee1ff67b3053639d054f52599a458fac9bc6"}, - {file = "protobuf-3.19.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e54b8650e849ee8e95e481024bff92cf98f5ec61c7650cb838d928a140adcb63"}, - {file = "protobuf-3.19.3-cp36-cp36m-win32.whl", hash = "sha256:3bf3a07d17ba3511fe5fa916afb7351f482ab5dbab5afe71a7a384274a2cd550"}, - {file = "protobuf-3.19.3-cp36-cp36m-win_amd64.whl", hash = "sha256:afa8122de8064fd577f49ae9eef433561c8ace97a0a7b969d56e8b1d39b5d177"}, - {file = "protobuf-3.19.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18c40a1b8721026a85187640f1786d52407dc9c1ba8ec38accb57a46e84015f6"}, - {file = "protobuf-3.19.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:af7238849fa79285d448a24db686517570099739527a03c9c2971cce99cc5ae2"}, - {file = "protobuf-3.19.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e765e6dfbbb02c55e4d6d1145743401a84fc0b508f5a81b2c5a738cf86353139"}, - {file = "protobuf-3.19.3-cp37-cp37m-win32.whl", hash = "sha256:c781402ed5396ab56358d7b866d78c03a77cbc26ba0598d8bb0ac32084b1a257"}, - {file = "protobuf-3.19.3-cp37-cp37m-win_amd64.whl", hash = "sha256:544fe9705189b249380fae07952d220c97f5c6c9372a6f936cc83a79601dcb70"}, - {file = "protobuf-3.19.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:84bf3aa3efb00dbe1c7ed55da0f20800b0662541e582d7e62b3e1464d61ed365"}, - {file = "protobuf-3.19.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:3f80a3491eaca767cdd86cb8660dc778f634b44abdb0dffc9b2a8e8d0cd617d0"}, - {file = "protobuf-3.19.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9401d96552befcc7311f5ef8f0fa7dba0ef5fd805466b158b141606cd0ab6a8"}, - {file = "protobuf-3.19.3-cp38-cp38-win32.whl", hash = "sha256:ef02d112c025e83db5d1188a847e358beab3e4bbfbbaf10eaf69e67359af51b2"}, - {file = "protobuf-3.19.3-cp38-cp38-win_amd64.whl", hash = "sha256:1291a0a7db7d792745c99d4657b4c5c4942695c8b1ac1bfb993a34035ec123f7"}, - {file = "protobuf-3.19.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:49677e5e9c7ea1245a90c2e8a00d304598f22ea3aa0628f0e0a530a9e70665fa"}, - {file = "protobuf-3.19.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:df2ba379ee42427e8fcc6a0a76843bff6efb34ef5266b17f95043939b5e25b69"}, - {file = "protobuf-3.19.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2acd7ca329be544d1a603d5f13a4e34a3791c90d651ebaf130ba2e43ae5397c6"}, - {file = "protobuf-3.19.3-cp39-cp39-win32.whl", hash = "sha256:b53519b2ebec70cfe24b4ddda21e9843f0918d7c3627a785393fb35d402ab8ad"}, - {file = "protobuf-3.19.3-cp39-cp39-win_amd64.whl", hash = "sha256:8ceaf5fdb72c8e1fcb7be9f2b3b07482ce058a3548180c0bdd5c7e4ac5e14165"}, - {file = "protobuf-3.19.3-py2.py3-none-any.whl", hash = "sha256:f6d4b5b7595a57e69eb7314c67bef4a3c745b4caf91accaf72913d8e0635111b"}, - {file = "protobuf-3.19.3.tar.gz", hash = "sha256:d975a6314fbf5c524d4981e24294739216b5fb81ef3c14b86fb4b045d6690907"}, + {file = "protobuf-3.19.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f51d5a9f137f7a2cec2d326a74b6e3fc79d635d69ffe1b036d39fc7d75430d37"}, + {file = "protobuf-3.19.4-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:09297b7972da685ce269ec52af761743714996b4381c085205914c41fcab59fb"}, + {file = "protobuf-3.19.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:072fbc78d705d3edc7ccac58a62c4c8e0cec856987da7df8aca86e647be4e35c"}, + {file = "protobuf-3.19.4-cp310-cp310-win32.whl", hash = "sha256:7bb03bc2873a2842e5ebb4801f5c7ff1bfbdf426f85d0172f7644fcda0671ae0"}, + {file = "protobuf-3.19.4-cp310-cp310-win_amd64.whl", hash = "sha256:f358aa33e03b7a84e0d91270a4d4d8f5df6921abe99a377828839e8ed0c04e07"}, + {file = "protobuf-3.19.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:1c91ef4110fdd2c590effb5dca8fdbdcb3bf563eece99287019c4204f53d81a4"}, + {file = "protobuf-3.19.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c438268eebb8cf039552897d78f402d734a404f1360592fef55297285f7f953f"}, + {file = "protobuf-3.19.4-cp36-cp36m-win32.whl", hash = "sha256:835a9c949dc193953c319603b2961c5c8f4327957fe23d914ca80d982665e8ee"}, + {file = "protobuf-3.19.4-cp36-cp36m-win_amd64.whl", hash = "sha256:4276cdec4447bd5015453e41bdc0c0c1234eda08420b7c9a18b8d647add51e4b"}, + {file = "protobuf-3.19.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6cbc312be5e71869d9d5ea25147cdf652a6781cf4d906497ca7690b7b9b5df13"}, + {file = "protobuf-3.19.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:54a1473077f3b616779ce31f477351a45b4fef8c9fd7892d6d87e287a38df368"}, + {file = "protobuf-3.19.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:435bb78b37fc386f9275a7035fe4fb1364484e38980d0dd91bc834a02c5ec909"}, + {file = "protobuf-3.19.4-cp37-cp37m-win32.whl", hash = "sha256:16f519de1313f1b7139ad70772e7db515b1420d208cb16c6d7858ea989fc64a9"}, + {file = "protobuf-3.19.4-cp37-cp37m-win_amd64.whl", hash = "sha256:cdc076c03381f5c1d9bb1abdcc5503d9ca8b53cf0a9d31a9f6754ec9e6c8af0f"}, + {file = "protobuf-3.19.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:69da7d39e39942bd52848438462674c463e23963a1fdaa84d88df7fbd7e749b2"}, + {file = "protobuf-3.19.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:48ed3877fa43e22bcacc852ca76d4775741f9709dd9575881a373bd3e85e54b2"}, + {file = "protobuf-3.19.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd95d1dfb9c4f4563e6093a9aa19d9c186bf98fa54da5252531cc0d3a07977e7"}, + {file = "protobuf-3.19.4-cp38-cp38-win32.whl", hash = "sha256:b38057450a0c566cbd04890a40edf916db890f2818e8682221611d78dc32ae26"}, + {file = "protobuf-3.19.4-cp38-cp38-win_amd64.whl", hash = "sha256:7ca7da9c339ca8890d66958f5462beabd611eca6c958691a8fe6eccbd1eb0c6e"}, + {file = "protobuf-3.19.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:36cecbabbda242915529b8ff364f2263cd4de7c46bbe361418b5ed859677ba58"}, + {file = "protobuf-3.19.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:c1068287025f8ea025103e37d62ffd63fec8e9e636246b89c341aeda8a67c934"}, + {file = "protobuf-3.19.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96bd766831596d6014ca88d86dc8fe0fb2e428c0b02432fd9db3943202bf8c5e"}, + {file = "protobuf-3.19.4-cp39-cp39-win32.whl", hash = "sha256:84123274d982b9e248a143dadd1b9815049f4477dc783bf84efe6250eb4b836a"}, + {file = "protobuf-3.19.4-cp39-cp39-win_amd64.whl", hash = "sha256:3112b58aac3bac9c8be2b60a9daf6b558ca3f7681c130dcdd788ade7c9ffbdca"}, + {file = "protobuf-3.19.4-py2.py3-none-any.whl", hash = "sha256:8961c3a78ebfcd000920c9060a262f082f29838682b1f7201889300c1fbe0616"}, + {file = "protobuf-3.19.4.tar.gz", hash = "sha256:9df0c10adf3e83015ced42a9a7bd64e13d06c4cf45c340d2c63020ea04499d0a"}, ] psutil = [ {file = "psutil-5.9.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:55ce319452e3d139e25d6c3f85a1acf12d1607ddedea5e35fb47a552c051161b"}, @@ -4740,6 +4743,11 @@ psutil = [ {file = "psutil-5.9.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:742c34fff804f34f62659279ed5c5b723bb0195e9d7bd9907591de9f8f6558e2"}, {file = "psutil-5.9.0-cp310-cp310-win32.whl", hash = "sha256:8293942e4ce0c5689821f65ce6522ce4786d02af57f13c0195b40e1edb1db61d"}, {file = "psutil-5.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:9b51917c1af3fa35a3f2dabd7ba96a2a4f19df3dec911da73875e1edaf22a40b"}, + {file = "psutil-5.9.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e9805fed4f2a81de98ae5fe38b75a74c6e6ad2df8a5c479594c7629a1fe35f56"}, + {file = "psutil-5.9.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c51f1af02334e4b516ec221ee26b8fdf105032418ca5a5ab9737e8c87dafe203"}, + {file = "psutil-5.9.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32acf55cb9a8cbfb29167cd005951df81b567099295291bcfd1027365b36591d"}, + {file = "psutil-5.9.0-cp36-cp36m-win32.whl", hash = "sha256:e5c783d0b1ad6ca8a5d3e7b680468c9c926b804be83a3a8e95141b05c39c9f64"}, + {file = "psutil-5.9.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d62a2796e08dd024b8179bd441cb714e0f81226c352c802fca0fd3f89eeacd94"}, {file = "psutil-5.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3d00a664e31921009a84367266b35ba0aac04a2a6cad09c550a89041034d19a0"}, {file = "psutil-5.9.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7779be4025c540d1d65a2de3f30caeacc49ae7a2152108adeaf42c7534a115ce"}, {file = "psutil-5.9.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:072664401ae6e7c1bfb878c65d7282d4b4391f1bc9a56d5e03b5a490403271b5"}, @@ -4973,8 +4981,8 @@ pyreadline = [ {file = "pyreadline-2.1.zip", hash = "sha256:4530592fc2e85b25b1a9f79664433da09237c1a270e4d78ea5aa3a2c7229e2d1"}, ] pyreadline3 = [ - {file = "pyreadline3-3.3-py3-none-any.whl", hash = "sha256:0003fd0079d152ecbd8111202c5a7dfa6a5569ffd65b235e45f3c2ecbee337b4"}, - {file = "pyreadline3-3.3.tar.gz", hash = "sha256:ff3b5a1ac0010d0967869f723e687d42cabc7dccf33b14934c92aa5168d260b3"}, + {file = "pyreadline3-3.4.1-py3-none-any.whl", hash = "sha256:b0efb6516fd4fb07b45949053826a62fa4cb353db5be2bbb4a7aa1fdd1e345fb"}, + {file = "pyreadline3-3.4.1.tar.gz", hash = "sha256:6f3d1f7b8a31ba32b73917cefc1f28cc660562f39aea8646d30bd6eff21f7bae"}, ] pyrsistent = [ {file = "pyrsistent-0.18.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:df46c854f490f81210870e509818b729db4488e1f30f2a1ce1698b2295a878d1"}, @@ -5115,8 +5123,8 @@ randomname = [ {file = "randomname-0.1.5.tar.gz", hash = "sha256:e10d14ea10895ee5bc417bdcc6d955e0b586f3bc67094ab87afcf8dcac23ab92"}, ] rasa-sdk = [ - {file = "rasa-sdk-3.0.3.tar.gz", hash = "sha256:1dfb7f54a33f81800854e3823032a1cfef57e9e9da2f07bc9273aa9c678a26cb"}, - {file = "rasa_sdk-3.0.3-py3-none-any.whl", hash = "sha256:ef6145f33752ce9d263d1f0663122b5ef1221c64f9afaf7a9a42572ab0523120"}, + {file = "rasa-sdk-3.0.4.tar.gz", hash = "sha256:36c5d7928e4f98b4966a11973a8b5798ecfa628619fcec01dcc8b56680bb9fa5"}, + {file = "rasa_sdk-3.0.4-py3-none-any.whl", hash = "sha256:0f0ff23ac7650d4ec98b6b26694babdfa7286da4c85d481ebd5aa44710e2f39a"}, ] redis = [ {file = "redis-3.5.3-py2.py3-none-any.whl", hash = "sha256:432b788c4530cfe16d8d943a09d40ca6c16149727e4afe8c2c9d5580c59d9f24"}, @@ -5288,9 +5296,6 @@ scikit-learn = [ {file = "scikit_learn-0.24.2-cp39-cp39-win_amd64.whl", hash = "sha256:40556bea1ef26ef54bc678d00cf138a63069144a0b5f3a436eecd8f3468b903e"}, ] scipy = [ - {file = "scipy-1.7.3-1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:c9e04d7e9b03a8a6ac2045f7c5ef741be86727d8f49c45db45f244bdd2bcff17"}, - {file = "scipy-1.7.3-1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:b0e0aeb061a1d7dcd2ed59ea57ee56c9b23dd60100825f98238c06ee5cc4467e"}, - {file = "scipy-1.7.3-1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:b78a35c5c74d336f42f44106174b9851c783184a85a3fe3e68857259b37b9ffb"}, {file = "scipy-1.7.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:173308efba2270dcd61cd45a30dfded6ec0085b4b6eb33b5eb11ab443005e088"}, {file = "scipy-1.7.3-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:21b66200cf44b1c3e86495e3a436fc7a26608f92b8d43d344457c54f1c024cbc"}, {file = "scipy-1.7.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceebc3c4f6a109777c0053dfa0282fddb8893eddfb0d598574acfb734a926168"}, @@ -5466,7 +5471,7 @@ sqlalchemy = [ {file = "SQLAlchemy-1.4.31.tar.gz", hash = "sha256:582b59d1e5780a447aada22b461e50b404a9dc05768da1d87368ad8190468418"}, ] srsly = [ - {file = "srsly-2.4.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:834229df7377386e9990fd245e1ae12a72152997fd159a782a798b638721a7b2"}, + {file = "srsly-2.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5e22bbc1a20abf749fa53adf101c36bc369ec63f496c7a44bf4f5f287d724900"}, {file = "srsly-2.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004d29a5abc0fe632434359c0be170490a69c4dce2c3de8a769944c37da7bb4b"}, {file = "srsly-2.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7ced7ec4993b4d4ad73cc442f8f7a518368348054d510864b1aa149e8d71654d"}, {file = "srsly-2.4.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:801c7e6e32c6a4721ab78ab7dafd01074fdb144f4876c09b25305c98f95c470f"}, @@ -5565,7 +5570,7 @@ terminaltables = [ {file = "terminaltables-3.1.10.tar.gz", hash = "sha256:ba6eca5cb5ba02bba4c9f4f985af80c54ec3dccf94cfcd190154386255e47543"}, ] thinc = [ - {file = "thinc-8.0.13-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ad8794a76725b85847528fd1a56471d5ac00f4104da8efb065ba572238e381a2"}, + {file = "thinc-8.0.13-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f818b9f012169a11beb3561c43dc52080588e50cf495733e492efab8b9b4135e"}, {file = "thinc-8.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f520daf45b7f42a04363852df43be1b423ae42d9327709d74f6c3279b3f73778"}, {file = "thinc-8.0.13-cp310-cp310-win_amd64.whl", hash = "sha256:2b217059c9e126220b77e7d6c9da56912c4e1eb4e8a11af14f17752e198e88cc"}, {file = "thinc-8.0.13-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:0f956c693d180209075703072fd226a24408cbe80eb67bd3b6eea407f61cb283"}, diff --git a/pyproject.toml b/pyproject.toml index 03814fc7c6b2..37e60b0dcb60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .pytest_cache | build | dist))" [tool.poetry] name = "rasa" -version = "3.0.5" +version = "3.0.6" description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants" authors = [ "Rasa Technologies GmbH ",] maintainers = [ "Tom Bocklisch ",] @@ -90,7 +90,7 @@ colorhash = "~1.0.2" jsonschema = "~3.2" packaging = ">=20.0,<21.0" pytz = ">=2019.1,<2022.0" -rasa-sdk = ">=3.0.3" +rasa-sdk = "~3.0.4" colorclass = "~2.2" terminaltables = "~3.1.0" sanic = "^21.6.0" diff --git a/rasa/core/actions/action.py b/rasa/core/actions/action.py index 257d6ccaba6b..fcf621d10db2 100644 --- a/rasa/core/actions/action.py +++ b/rasa/core/actions/action.py @@ -1142,6 +1142,9 @@ def _fails_unique_entity_mapping_check( form = FormAction(form_name, self._action_endpoint) + if slot_name not in form.required_slots(domain): + return False + if form.entity_mapping_is_unique(mapping, domain): return False diff --git a/rasa/core/tracker_store.py b/rasa/core/tracker_store.py index 8a0ea09d476a..2867d3e5eaf6 100644 --- a/rasa/core/tracker_store.py +++ b/rasa/core/tracker_store.py @@ -751,6 +751,21 @@ def ensure_schema_exists(session: "Session") -> None: raise ValueError(schema_name) +def validate_port(port: Any) -> Optional[int]: + """Ensure that port can be converted to integer. + + Raises: + RasaException if port cannot be cast to integer. + """ + if port is not None and not isinstance(port, int): + try: + port = int(port) + except ValueError as e: + raise RasaException(f"The port '{port}' cannot be cast to integer.") from e + + return port + + class SQLTrackerStore(TrackerStore): """Store which can save and retrieve trackers from an SQL database.""" @@ -787,6 +802,8 @@ def __init__( ) -> None: import sqlalchemy.exc + port = validate_port(port) + engine_url = self.get_db_url( dialect, host, port, db, username, password, login_db, query ) diff --git a/rasa/nlu/classifiers/diet_classifier.py b/rasa/nlu/classifiers/diet_classifier.py index 9eb96dc6d98f..0bc1765d2005 100644 --- a/rasa/nlu/classifiers/diet_classifier.py +++ b/rasa/nlu/classifiers/diet_classifier.py @@ -706,6 +706,14 @@ def _create_model_data( example for example in training_data if label_attribute in example.data ] + training_data = [ + message + for message in training_data + if message.features_present( + attribute=TEXT, featurizers=self.component_config.get(FEATURIZERS) + ) + ] + if not training_data: # no training data are present to train return RasaModelData() @@ -929,6 +937,8 @@ def _predict( # create session data from message and convert it into a batch of 1 model_data = self._create_model_data([message], training=False) + if model_data.is_empty(): + return None return self.model.run_inference(model_data) def _predict_label( diff --git a/rasa/nlu/classifiers/sklearn_intent_classifier.py b/rasa/nlu/classifiers/sklearn_intent_classifier.py index 771d0c1046f2..087aae9826f6 100644 --- a/rasa/nlu/classifiers/sklearn_intent_classifier.py +++ b/rasa/nlu/classifiers/sklearn_intent_classifier.py @@ -19,6 +19,7 @@ from rasa.nlu.classifiers.classifier import IntentClassifier from rasa.shared.nlu.training_data.training_data import TrainingData from rasa.shared.nlu.training_data.message import Message +from rasa.utils.tensorflow.constants import FEATURIZERS logger = logging.getLogger(__name__) @@ -124,11 +125,15 @@ def train(self, training_data: TrainingData) -> Resource: return self._resource y = self.transform_labels_str2num(labels) + training_examples = [ + message + for message in training_data.intent_examples + if message.features_present( + attribute=TEXT, featurizers=self.component_config.get(FEATURIZERS) + ) + ] X = np.stack( - [ - self._get_sentence_features(example) - for example in training_data.intent_examples - ] + [self._get_sentence_features(example) for example in training_examples] ) # reduce dimensionality X = np.reshape(X, (len(X), -1)) @@ -190,9 +195,12 @@ def _create_classifier( def process(self, messages: List[Message]) -> List[Message]: """Return the most likely intent and its probability for a message.""" for message in messages: - if not self.clf: + if not self.clf or not message.features_present( + attribute=TEXT, featurizers=self.component_config.get(FEATURIZERS) + ): # component is either not trained or didn't - # receive enough training data + # receive enough training data or the input doesn't + # have required features. intent = None intent_ranking = [] else: diff --git a/rasa/nlu/extractors/crf_entity_extractor.py b/rasa/nlu/extractors/crf_entity_extractor.py index e5f12d6d6155..fc6f5bcf65d3 100644 --- a/rasa/nlu/extractors/crf_entity_extractor.py +++ b/rasa/nlu/extractors/crf_entity_extractor.py @@ -33,7 +33,7 @@ SPLIT_ENTITIES_BY_COMMA_DEFAULT_VALUE, ) from rasa.shared.constants import DOCS_URL_COMPONENTS -from rasa.utils.tensorflow.constants import BILOU_FLAG +from rasa.utils.tensorflow.constants import BILOU_FLAG, FEATURIZERS logger = logging.getLogger(__name__) @@ -242,7 +242,13 @@ def train(self, training_data: TrainingData) -> Resource: # filter out pre-trained entity examples entity_examples = self.filter_trainable_entities(training_data.nlu_examples) - + entity_examples = [ + message + for message in entity_examples + if message.features_present( + attribute=TEXT, featurizers=self.component_config.get(FEATURIZERS) + ) + ] dataset = [self._convert_to_crf_tokens(example) for example in entity_examples] self._train_model(dataset) @@ -278,7 +284,9 @@ def process(self, messages: List[Message]) -> List[Message]: def extract_entities(self, message: Message) -> List[Dict[Text, Any]]: """Extract entities from the given message using the trained model(s).""" - if self.entity_taggers is None: + if self.entity_taggers is None or not message.features_present( + attribute=TEXT, featurizers=self.component_config.get(FEATURIZERS) + ): return [] tokens = message.get(TOKENS_NAMES[TEXT]) diff --git a/rasa/utils/tensorflow/models.py b/rasa/utils/tensorflow/models.py index 1ad55cba6f7c..8ff79763c099 100644 --- a/rasa/utils/tensorflow/models.py +++ b/rasa/utils/tensorflow/models.py @@ -269,7 +269,7 @@ def _rasa_predict( # Once we take advantage of TF's distributed training, this is where # scheduled functions will be forced to execute and return actual values. - outputs = tf_utils.sync_to_numpy_or_python_type(self.predict_step(batch_in)) + outputs = tf_utils.sync_to_numpy_or_python_type(self._tf_predict_step(batch_in)) if DIAGNOSTIC_DATA in outputs: outputs[DIAGNOSTIC_DATA] = self._empty_lists_to_none_in_dict( outputs[DIAGNOSTIC_DATA] diff --git a/rasa/version.py b/rasa/version.py index aa320dff93b7..f4fe55bc7e18 100644 --- a/rasa/version.py +++ b/rasa/version.py @@ -1,3 +1,3 @@ # this file will automatically be changed, # do not add anything but the version number here! -__version__ = "3.0.5" +__version__ = "3.0.6" diff --git a/scripts/release.py b/scripts/release.py index 8358210bdde1..f23f06152d46 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -160,7 +160,7 @@ def is_valid_version_number(v: Text) -> bool: str(current_version.next_release_candidate("major")), ] version = questionary.select( - f"Which {version} do you want to release?", choices=choices, + f"Which {version} do you want to release?", choices=choices ).ask() if version: @@ -175,7 +175,6 @@ def get_rasa_sdk_version() -> Text: dependencies_filename = "pyproject.toml" toml_data = toml.load(project_root() / dependencies_filename) - try: sdk_version = toml_data["tool"]["poetry"]["dependencies"]["rasa-sdk"] return sdk_version[1:].strip() diff --git a/tests/core/test_actions.py b/tests/core/test_actions.py index d82e81e89bbb..f5832dca7810 100644 --- a/tests/core/test_actions.py +++ b/tests/core/test_actions.py @@ -2586,3 +2586,77 @@ async def test_action_extract_slots_does_not_raise_disallowed_warning_for_slot_e SlotSet("custom_slot_b", "test_B"), SlotSet("custom_slot_a", "test_A"), ] + + +async def test_action_extract_slots_non_required_form_slot_with_from_entity_mapping(): + domain_yaml = textwrap.dedent( + """ + version: "3.0" + + intents: + - form_start + - intent1 + - intent2 + + entities: + - form1_info1 + - form1_slot1 + - form1_slot2 + + slots: + form1_info1: + type: text + mappings: + - type: from_entity + entity: form1_info1 + + form1_slot1: + type: text + influence_conversation: false + mappings: + - type: from_intent + value: Filled + intent: intent1 + conditions: + - active_loop: form1 + requested_slot: form1_slot1 + + form1_slot2: + type: text + influence_conversation: false + mappings: + - type: from_intent + value: Filled + intent: intent2 + conditions: + - active_loop: form1 + requested_slot: form1_slot2 + forms: + form1: + required_slots: + - form1_slot1 + - form1_slot2 + """ + ) + domain = Domain.from_yaml(domain_yaml) + initial_events = [ + UserUttered("Start form."), + ActiveLoop("form1"), + SlotSet(REQUESTED_SLOT, "form1_slot1"), + UserUttered( + "Hi", + intent={"name": "intent1"}, + entities=[{"entity": "form1_info1", "value": "info1"}], + ), + ] + tracker = DialogueStateTracker.from_events(sender_id="test_id", evts=initial_events) + + action_extract_slots = ActionExtractSlots(None) + + events = await action_extract_slots.run( + CollectingOutputChannel(), + TemplatedNaturalLanguageGenerator(domain.responses), + tracker, + domain, + ) + assert events == [SlotSet("form1_info1", "info1"), SlotSet("form1_slot1", "Filled")] diff --git a/tests/core/test_tracker_stores.py b/tests/core/test_tracker_stores.py index c08b4eeb8047..d40e8e1818e1 100644 --- a/tests/core/test_tracker_stores.py +++ b/tests/core/test_tracker_stores.py @@ -35,7 +35,7 @@ BotUttered, Event, ) -from rasa.shared.exceptions import ConnectionException +from rasa.shared.exceptions import ConnectionException, RasaException from rasa.core.tracker_store import ( TrackerStore, InMemoryTrackerStore, @@ -925,3 +925,12 @@ def test_sql_tracker_store_with_token_serialisation( ): tracker_store = SQLTrackerStore(domain, **{"host": "sqlite:///"}) prepare_token_serialisation(tracker_store, response_selector_agent, "sql") + + +def test_sql_tracker_store_creation_with_invalid_port(domain: Domain): + with pytest.raises(RasaException) as error: + TrackerStore.create( + EndpointConfig(port="$DB_PORT", type="sql"), + domain, + ) + assert "port '$DB_PORT' cannot be cast to integer." in str(error.value) diff --git a/tests/nlu/classifiers/test_diet_classifier.py b/tests/nlu/classifiers/test_diet_classifier.py index 99f9d69cf39a..5b0401fca051 100644 --- a/tests/nlu/classifiers/test_diet_classifier.py +++ b/tests/nlu/classifiers/test_diet_classifier.py @@ -18,6 +18,8 @@ ENTITIES, FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE, + PREDICTED_CONFIDENCE_KEY, + INTENT_NAME_KEY, ) from rasa.utils.tensorflow.constants import ( LOSS_TYPE, @@ -152,7 +154,8 @@ def inner( classified_message2 = loaded_diet.process([message2])[0] assert classified_message2.fingerprint() == classified_message.fingerprint() - return classified_message + + return loaded_diet, classified_message return inner @@ -269,16 +272,20 @@ def test_model_data_signature_with_entities( messages: List[Message], entity_expected: bool, create_diet: Callable[..., DIETClassifier], - whitespace_tokenizer: WhitespaceTokenizer, + train_and_preprocess: Callable[..., Tuple[TrainingData, List[GraphComponent]]], ): classifier = create_diet({"BILOU_flag": False}) training_data = TrainingData(messages) - # create tokens for entity parsing inside DIET - whitespace_tokenizer.process_training_data(training_data) - + # create tokens and features for entity parsing inside DIET + pipeline = [ + {"component": WhitespaceTokenizer}, + {"component": CountVectorsFeaturizer}, + ] + training_data, loaded_pipeline = train_and_preprocess(pipeline, training_data) model_data = classifier.preprocess_train_data(training_data) entity_exists = "entities" in model_data.get_signature().keys() + assert entity_exists == entity_expected @@ -404,7 +411,7 @@ async def test_softmax_normalization( classifier_params[EPOCHS] = 1 classifier_params[EVAL_NUM_EPOCHS] = 1 - parsed_message = create_train_load_and_process_diet( + _, parsed_message = create_train_load_and_process_diet( classifier_params, training_data=data_path ) parse_data = parsed_message.data @@ -426,7 +433,7 @@ async def test_margin_loss_is_not_normalized( create_train_load_and_process_diet: Callable[..., Message] ): - parsed_message = create_train_load_and_process_diet( + _, parsed_message = create_train_load_and_process_diet( {LOSS_TYPE: "margin", RANDOM_SEED: 42, EPOCHS: 1, EVAL_NUM_EPOCHS: 1}, training_data="data/test/many_intents.yml", ) @@ -449,16 +456,16 @@ async def test_set_random_seed( ): """test if train result is the same for two runs of tf embedding""" - parsed_message1 = create_train_load_and_process_diet( + _, parsed_message1 = create_train_load_and_process_diet( {ENTITY_RECOGNITION: False, RANDOM_SEED: 1, EPOCHS: 1} ) - parsed_message2 = create_train_load_and_process_diet( + _, parsed_message2 = create_train_load_and_process_diet( {ENTITY_RECOGNITION: False, RANDOM_SEED: 1, EPOCHS: 1} ) # Different random seed - parsed_message3 = create_train_load_and_process_diet( + _, parsed_message3 = create_train_load_and_process_diet( {ENTITY_RECOGNITION: False, RANDOM_SEED: 2, EPOCHS: 1} ) @@ -539,6 +546,20 @@ async def test_train_model_checkpointing( assert len(all_files) > 4 +async def test_process_unfeaturized_input( + create_train_load_and_process_diet: Callable[..., Message], +): + classifier, _ = create_train_load_and_process_diet(diet_config={EPOCHS: 1}) + message_text = "message text" + unfeaturized_message = Message(data={TEXT: message_text}) + classified_message = classifier.process([unfeaturized_message])[0] + + assert classified_message.get(TEXT) == message_text + assert not classified_message.get(INTENT)[INTENT_NAME_KEY] + assert classified_message.get(INTENT)[PREDICTED_CONFIDENCE_KEY] == 0.0 + assert not classified_message.get(ENTITIES) + + async def test_train_model_not_checkpointing( default_model_storage: ModelStorage, default_diet_resource: Resource, @@ -631,7 +652,7 @@ async def test_process_gives_diagnostic_data( ): default_execution_context.should_add_diagnostic_data = should_add_diagnostic_data default_execution_context.node_name = "DIETClassifier_node_name" - processed_message = create_train_load_and_process_diet({EPOCHS: 1}) + _, processed_message = create_train_load_and_process_diet({EPOCHS: 1}) if should_add_diagnostic_data: # Tests if processing a message returns attention weights as numpy array. @@ -708,7 +729,7 @@ async def test_adjusting_layers_incremental_training( }, ] classifier = create_diet({EPOCHS: 1}) - processed_message = train_load_and_process_diet( + _, processed_message = train_load_and_process_diet( classifier, pipeline=pipeline, training_data=iter1_data_path ) @@ -738,7 +759,7 @@ async def test_adjusting_layers_incremental_training( finetune_classifier = create_diet({EPOCHS: 1}, load=True, finetune=True) assert finetune_classifier.finetune_mode - processed_message_finetuned = train_load_and_process_diet( + _, processed_message_finetuned = train_load_and_process_diet( finetune_classifier, pipeline=pipeline, training_data=iter2_data_path ) diff --git a/tests/nlu/classifiers/test_sklearn_classifier.py b/tests/nlu/classifiers/test_sklearn_classifier.py index 3233de4c4730..dba66b107f88 100644 --- a/tests/nlu/classifiers/test_sklearn_classifier.py +++ b/tests/nlu/classifiers/test_sklearn_classifier.py @@ -14,6 +14,8 @@ from rasa.engine.storage.storage import ModelStorage from rasa.nlu.classifiers.sklearn_intent_classifier import SklearnIntentClassifier from rasa.shared.nlu.training_data.training_data import TrainingData +from rasa.shared.nlu.constants import TEXT, INTENT +from rasa.shared.nlu.training_data.message import Message @pytest.fixture() @@ -88,3 +90,37 @@ def test_loading_from_storage_fail( assert any( "Resource 'test' doesn't exist." in message for message in caplog.messages ) + + +def test_process_unfeaturized_input( + training_data: TrainingData, + default_sklearn_intent_classifier: SklearnIntentClassifier, + default_model_storage: ModelStorage, + default_execution_context: ExecutionContext, + train_and_preprocess: Callable[..., Tuple[TrainingData, List[GraphComponent]]], + spacy_nlp_component: SpacyNLP, + spacy_model: SpacyModel, +): + training_data = spacy_nlp_component.process_training_data( + training_data, spacy_model + ) + training_data, loaded_pipeline = train_and_preprocess( + pipeline=[ + {"component": SpacyTokenizer}, + {"component": SpacyFeaturizer}, + ], + training_data=training_data, + ) + default_sklearn_intent_classifier.train(training_data) + classifier = SklearnIntentClassifier.load( + SklearnIntentClassifier.get_default_config(), + default_model_storage, + Resource("sklearn"), + default_execution_context, + ) + message_text = "message text" + message = Message(data={TEXT: message_text}) + processed_message = classifier.process([message])[0] + + assert processed_message.get(TEXT) == message_text + assert not processed_message.get(INTENT) diff --git a/tests/nlu/extractors/test_crf_entity_extractor.py b/tests/nlu/extractors/test_crf_entity_extractor.py index 2fc6368e3edd..b2342ab30fb7 100644 --- a/tests/nlu/extractors/test_crf_entity_extractor.py +++ b/tests/nlu/extractors/test_crf_entity_extractor.py @@ -128,6 +128,7 @@ async def test_train_persist_with_different_configurations( default_model_storage: ModelStorage, default_execution_context: ExecutionContext, spacy_tokenizer: SpacyTokenizer, + spacy_featurizer: SpacyFeaturizer, spacy_nlp_component: SpacyNLP, spacy_model: SpacyModel, ): @@ -141,13 +142,13 @@ async def test_train_persist_with_different_configurations( training_data, spacy_model ) training_data = spacy_tokenizer.process_training_data(training_data) - + training_data = spacy_featurizer.process_training_data(training_data) crf_extractor.train(training_data) message = Message(data={TEXT: "I am looking for an italian restaurant"}) messages = spacy_nlp_component.process([message], spacy_model) - message = spacy_tokenizer.process(messages)[0] - + messages = spacy_tokenizer.process(messages) + message = spacy_featurizer.process(messages)[0] message2 = copy.deepcopy(message) processed_message = crf_extractor.process([message])[0] @@ -236,3 +237,15 @@ def test_most_likely_entity( assert actual_label == expected_label assert actual_confidence == expected_confidence + + +def test_process_unfeaturized_input( + crf_entity_extractor: Callable[[Dict[Text, Any]], CRFEntityExtractor], +): + crf_extractor = crf_entity_extractor({}) + message_text = "message text" + message = Message(data={TEXT: message_text}) + processed_message = crf_extractor.process([message])[0] + + assert processed_message.get(TEXT) == message_text + assert processed_message.get(ENTITIES) == [] diff --git a/tests/nlu/selectors/test_selectors.py b/tests/nlu/selectors/test_selectors.py index 6d28026278b8..4f3a87b66e47 100644 --- a/tests/nlu/selectors/test_selectors.py +++ b/tests/nlu/selectors/test_selectors.py @@ -41,6 +41,7 @@ FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE, INTENT_RESPONSE_KEY, + PREDICTED_CONFIDENCE_KEY, ) from rasa.utils.tensorflow.model_data_utils import FeatureArray from rasa.shared.nlu.training_data.loading import load_data @@ -48,7 +49,13 @@ from rasa.nlu.selectors.response_selector import ResponseSelector from rasa.shared.nlu.training_data.message import Message from rasa.shared.nlu.training_data.training_data import TrainingData -from rasa.nlu.constants import DEFAULT_TRANSFORMER_SIZE +from rasa.nlu.constants import ( + DEFAULT_TRANSFORMER_SIZE, + RESPONSE_SELECTOR_PROPERTY_NAME, + RESPONSE_SELECTOR_DEFAULT_INTENT, + RESPONSE_SELECTOR_PREDICTION_KEY, + RESPONSE_SELECTOR_RESPONSES_KEY, +) @pytest.fixture() @@ -611,6 +618,36 @@ def test_transformer_size_gets_corrected(train_persist_load_with_different_setti assert selector.component_config[TRANSFORMER_SIZE] == DEFAULT_TRANSFORMER_SIZE +async def test_process_unfeaturized_input( + create_response_selector: Callable[[Dict[Text, Any]], ResponseSelector], + train_and_preprocess: Callable[..., Tuple[TrainingData, List[GraphComponent]]], + process_message: Callable[..., Message], +): + pipeline = [ + {"component": WhitespaceTokenizer}, + {"component": CountVectorsFeaturizer}, + ] + training_data, loaded_pipeline = train_and_preprocess( + pipeline, "data/test_selectors" + ) + response_selector = create_response_selector({EPOCHS: 1}) + response_selector.train(training_data=training_data) + + message_text = "message text" + unfeaturized_message = Message(data={TEXT: message_text}) + classified_message = response_selector.process([unfeaturized_message])[0] + output = ( + classified_message.get(RESPONSE_SELECTOR_PROPERTY_NAME) + .get(RESPONSE_SELECTOR_DEFAULT_INTENT) + .get(RESPONSE_SELECTOR_PREDICTION_KEY) + ) + + assert classified_message.get(TEXT) == message_text + assert not output.get(RESPONSE_SELECTOR_RESPONSES_KEY) + assert output.get(PREDICTED_CONFIDENCE_KEY) == 0.0 + assert not output.get(INTENT_RESPONSE_KEY) + + @pytest.mark.timeout(120) async def test_adjusting_layers_incremental_training( create_response_selector: Callable[[Dict[Text, Any]], ResponseSelector], diff --git a/tests/nlu/tokenizers/test_whitespace_tokenizer.py b/tests/nlu/tokenizers/test_whitespace_tokenizer.py index b01274ad779d..bffc1b0c3bd4 100644 --- a/tests/nlu/tokenizers/test_whitespace_tokenizer.py +++ b/tests/nlu/tokenizers/test_whitespace_tokenizer.py @@ -76,6 +76,7 @@ def create_whitespace_tokenizer(config: Optional[Dict] = None) -> WhitespaceToke (":)", [":)"], [(0, 2)]), ("Hi :-)", ["Hi"], [(0, 2)]), ("👍", ["👍"], [(0, 1)]), + ("", [""], [(0, 0)]), ], ) def test_whitespace(text, expected_tokens, expected_indices):