From 87e4d398fceb1acd52705b95ffad69824bb45978 Mon Sep 17 00:00:00 2001 From: Tobias Wochinger Date: Tue, 17 Nov 2020 12:06:29 +0100 Subject: [PATCH] prepared release of version 2.1.0 --- CHANGELOG.mdx | 47 +++++++++++++++++++++++++++++++++++ changelog/329.feature.md | 37 --------------------------- changelog/7078.improvement.md | 2 -- pyproject.toml | 2 +- rasa_sdk/version.py | 2 +- 5 files changed, 49 insertions(+), 41 deletions(-) delete mode 100644 changelog/329.feature.md delete mode 100644 changelog/7078.improvement.md diff --git a/CHANGELOG.mdx b/CHANGELOG.mdx index 212669b53..9da15bfcf 100644 --- a/CHANGELOG.mdx +++ b/CHANGELOG.mdx @@ -17,6 +17,53 @@ https://github.com/RasaHQ/rasa/tree/master/changelog/ . --> +## [2.1.0] - 2020-11-17 + + +### Features +- [#329](https://github.com/rasahq/rasa/issues/329): Extend `FormValidationAction` with support for extracting slots. If you + want to extract an additional slot, add the slot's name to the list of `required_slots` + and add a method `extract_` to your action: + + ```python + from typing import Text, Dict, Any, List, Optional + + from rasa_sdk.forms import ( + FormValidationAction, + ) + + class FormWithSlotExtractions(FormValidationAction): + def name(self) -> Text: + return "some_form" + + async def required_slots( + self, + slots_mapped_in_domain: List[Text], + dispatcher: "CollectingDispatcher", + tracker: "Tracker", + domain: "DomainDict", + ) -> Optional[List[Text]]: + return slots_mapped_in_domain + ["my_slot"] + + async def extract_my_slot( + self, + dispatcher: "CollectingDispatcher", + tracker: "Tracker", + domain: "DomainDict", + ) -> Dict[Text, Any]: + return {"my_slot": "some value"} + ``` + + If all slots returned by `required_slots` are filled, + the action will automatically return an event to disable the form. + If not all required slots are filled, the SDK will return an event + to Rasa Open Source to fill the first missing slot next. + +### Improvements +- [#7078](https://github.com/rasahq/rasa/issues/7078): Adds the method `get_intent_of_latest_message` to the `Tracker` allowing easier + access to the user's latest intent in case of an `nlu_fallback`. + + ## [2.0.0] - 2020-10-07 diff --git a/changelog/329.feature.md b/changelog/329.feature.md deleted file mode 100644 index e372e0ef1..000000000 --- a/changelog/329.feature.md +++ /dev/null @@ -1,37 +0,0 @@ -Extend `FormValidationAction` with support for extracting slots. If you -want to extract an additional slot, add the slot's name to the list of `required_slots` -and add a method `extract_` to your action: - -```python -from typing import Text, Dict, Any, List, Optional - -from rasa_sdk.forms import ( - FormValidationAction, -) - -class FormWithSlotExtractions(FormValidationAction): - def name(self) -> Text: - return "some_form" - - async def required_slots( - self, - slots_mapped_in_domain: List[Text], - dispatcher: "CollectingDispatcher", - tracker: "Tracker", - domain: "DomainDict", - ) -> Optional[List[Text]]: - return slots_mapped_in_domain + ["my_slot"] - - async def extract_my_slot( - self, - dispatcher: "CollectingDispatcher", - tracker: "Tracker", - domain: "DomainDict", - ) -> Dict[Text, Any]: - return {"my_slot": "some value"} -``` - -If all slots returned by `required_slots` are filled, -the action will automatically return an event to disable the form. -If not all required slots are filled, the SDK will return an event -to Rasa Open Source to fill the first missing slot next. diff --git a/changelog/7078.improvement.md b/changelog/7078.improvement.md deleted file mode 100644 index 12ea13c6f..000000000 --- a/changelog/7078.improvement.md +++ /dev/null @@ -1,2 +0,0 @@ -Adds the method `get_intent_of_latest_message` to the `Tracker` allowing easier -access to the user's latest intent in case of an `nlu_fallback`. diff --git a/pyproject.toml b/pyproject.toml index d7d2d2c4f..10f17c091 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .mypy_cache | .pytest_cache | build | dist))" [tool.poetry] name = "rasa-sdk" -version = "2.0.0" +version = "2.1.0" description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants" authors = [ "Rasa Technologies GmbH ",] maintainers = [ "Tom Bocklisch ",] diff --git a/rasa_sdk/version.py b/rasa_sdk/version.py index 84d85f8b5..d9203cbc7 100644 --- a/rasa_sdk/version.py +++ b/rasa_sdk/version.py @@ -1,3 +1,3 @@ # this file will automatically be changed, # do not add anything but the version number here! -__version__ = "2.0.0" +__version__ = "2.1.0"