| id | rasa-sdk-changelog |
|---|---|
| sidebar_label | Rasa SDK Change Log |
| title | Rasa SDK Change Log |
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning starting with version 0.11.0.
Rasa_Sdk 3.5.1 (2023-04-11)
Rasa_Sdk 3.5.0 (2023-03-17)
No significant changes.
Rasa_Sdk 3.4.1 (2023-03-06)
No significant changes.
Rasa_Sdk 3.4.0 (2022-11-23)
- #877: Added CLI option
--logging-config-fileto enable configuration of custom logs formatting. - #888: Add support for Python 3.10 version.
Rasa_Sdk 3.3.0 (2022-10-06) No significant changes.
- #719: Remove no longer necessary dependency pin for
uvloop.
No significant changes.
No significant changes.
No significant changes.
No significant changes.
- #501: Removed Python 3.6 support
- #529: Support for global slot mappings.
- #912: Added the ability to decompress deflate encoded json payloads for the webhook endpoint of the action server.
- #836: Return a json response when encountering action execution exceptions. Log exceptions using logger rather than sanic default print.
- #810: Removed Python 3.6 support.
Updated several dependencies:
sanic,httpx,websockets.
-
#441: Slots will be validated in order they are requested. Previously, they were validated in reverse order.
Already extracted slots are now immediately visible during extraction of subsequent slots. Same goes for validation.
No significant changes.
- #261: Adding support for forms with the
required_slotskey which is introduced as part of Rasa Open Source 2.6. - #434: - The action server can now listen on a specific network address using the environment variable
SANIC_HOSTinstead of listening on all host interfaces by default- Corrected url which is logged at action server startup
-
#419: Missing
typing_extensionsmodule addedMinor dependency updates
-
#8223:
utter_messageinCollectingDispatchernow explicitly takes in bothresponseandtemplate. Note that the parametertemplatewill be deprecated in Rasa SDK 3.0.0. Please usedispatcher.utter_message(response=...)instead.
-
#406: Fix bug where ActionQueryKnowledgeBase incorrectly issues a template message with the string representation of the function for getting the string representation of the knowledge base item and not the actual string representation of the knowledge base item.
For example, before the fix, the query knowledge base demo bot would utter this
'<function ActionMyKB.init.. at 0x7fb23b7fddd0>' has the value 'True' for attribute 'breakfast-included'.instead of this:
'Hilton (Berlin)' has the value 'True' for attribute 'breakfast-included'.
- #404: Only pin the
uvloopdependency for non-Windows systems asuvloopis not available for Windows.
-
#306: Added command line argument option
--log-filefor the action server to save logs to a log file.Usage :
rasa run actions --log-file log_file.log
No significant changes.
No significant changes.
- #344: Fix a bug in the
FormValidationActionwhich immediately deactivated the form.
- #329: Extend
FormValidationActionwith support for extracting slots. If you want to extract an additional slot, add the slot's name to the list ofrequired_slotsand add a methodextract_<slot name>to your action:
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.
- #7078: Adds the method
get_intent_of_latest_messageto theTrackerallowing easier access to the user's latest intent in case of annlu_fallback.
-
#246: Using the
Formevent is deprecated. Please use the newActiveLoopevent instead. Using theactive_formproperty of theTrackerobject is now deprecated. Please use theactive_loopproperty instead.The usage of the
FormActionis deprecated. Please see the migration guide for Rasa Open Source 2.0 for instructions how to migrate yourFormActions. -
#250: Removed support for the
rasa_core_sdkpython module: useimport rasa_sdksyntax instead. -
#6463: The
FormValidationevent was renamed toLoopInterruptedas part of Rasa Open Source 2.0. Using theFormValidationis now deprecated and will be removed in the future. Please useLoopInterruptedinstead.
-
#238: Added the method
slots_to_validatetoTracker. This method is helpful when using a custom action to validate slots which were extracted by a form as shown by the following example.from typing import Text, Dict, List, Any from rasa_sdk import Action, Tracker from rasa_sdk.events import EventType, SlotSet from rasa_sdk.types import DomainDict from rasa_sdk.executor import CollectingDispatcher class ValidateSlots(Action): def name(self) -> Text: return "validate_your_form" def run( self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: DomainDict ) -> List[EventType]: extracted_slots: Dict[Text, Any] = tracker.slots_to_validate() validation_events = [] for slot_name, slot_value in extracted_slots.items(): # Check if slot is valid. if self.is_valid(slot_value): validation_events.append(SlotSet(slot_name, slot_value)) else: # Return a `SlotSet` event with value `None` to indicate that this # slot still needs to be filled. validation_events.append(SlotSet(slot_name, None)) return validation_events def is_valid(self, slot_value: Any) -> bool: # Implementation of the validate function. return True
Please note that
tracker.form_slots_to_validateonly works with Rasa Open Source 2.
-
#239: Validate user input during form activation even if there is an action in between.
-
#246: Rasa Open Source 2.0 renamed the
Formevent toActiveLoop. TheActiveLoopevent was added to the SDK and support for theactive_loopfield in JSON payloads was added. -
#267: The
actionspackage in a Rasa project may contain multiple files containing custom action code. The Rasa SDK Docker container now loads the entireactionspackage. -
#288: Add the
FormValidationActionabstract class that can be used to validate slots which were extracted by a Form.Example:
from typing import Text, Any, Dict
from rasa_sdk import FormValidationAction, Tracker
from rasa_sdk.types import DomainDict
from rasa_sdk.executor import CollectingDispatcher
class MyFormValidationAction(FormValidationAction):
def name(self) -> Text:
return "some_form"
def validate_slot1(
self,
slot_value: Any,
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: "DomainDict",
) -> Dict[Text, Any]:
if slot_value == "correct_value":
return {
"slot1": "validated_value",
}
return {
"slot1": None,
}- #6463: Added support for the
LoopInterruptedevent.
- #280:
tracker.applied_eventsnow correctly deals with restart, undo, and rewind events
- #273: Only fill other slots if slot mapping contains a role or group restriction and the entity type matches.
- #220: Re-added an
Action endpoint is up and runninglog that was removed in Rasa SDK 1.6.0.
- #212: Fix
ActionExecutorsometimes not loading user-defined actions that inherit from other user-defined ones.
-
#164: Added new
--auto-reloadCLI argument. When specified, modules containingActionsubclasses will be automatically reloaded if they have been modified since the last HTTP request. By using this, one can avoid having to re-start the actions server when developing new actions. -
#3765: Add support for entities with role and group labels.
If you use
from_entityin your custom slot mapping, you can now also specify a role and group label. If you set a role or group label, the slot is only filled if the entity has the specific role or group label set. If you don’t specify a role or group label, the function behaves as before.
- #176: The Rasa SDK image now uses Python 3.7 instead of Python 3.6.
- #176: Updated
pyyamldependency to5.3.1to fix CVE-2020-1747
- #110: Exit program (
python -m rasa_sdk --actions actionsorrasa run actions --actions actions) if a requested module under the--actionscommand-line option cannot be found.
- #153: Make it possible to use the
requestslibrary inside the default Rasa SDK container.
-
#130: Copied over instance methods
last_executed_action_has(),get_last_event_for()andapplied_eventsfrom the RasaDialogueStateTrackerclass to the SDKTrackerclass. -
#145: Add
poetryfor dependency management and reduce the size of Docker image.
- #148, #149
-
ReminderScheduledandReminderCancellednow takeintentandentitiesas options, instead ofaction. This is because starting with Rasa 1.7 reminders trigger intents (with entities) instead of actions. -
The following
FormActionmethods are nowasyncby default:validate_slots,validate,submitandrun. User-defined classes inheriting fromFormActionshould be adapted to useasyncfor these methods. Existing synchronous implementations will continue to work as normal, but this behaviour will be deprecated in the future. -
The following
ActionQueryKnowledgeBasemethods are nowasync:utter_objectsandrun. -
The following
KnowledgeBasemethods are nowasync:get_attributes_of_object,get_key_attribute_of_object,get_representation_function_of_object,get_objectsandget_object. Same warning forFormActionapplies here - user-defined classes should be updated to useasync, but will continue to work for the moment. -
The following
InMemoryKnowledgeBasemethods are nowasync:get_attributes_of_object,get_objectsandget_object.
- Pinned
sanic~=19.9.0to fix breaking changes introduced in sanic 19.9.12.
- Added
SessionStartedevent for compatibility with conversation sessions in Rasa 1.6.0.
- Pinned
multidictdependency to 4.6.1 to prevent sanic from breaking, see sanic-org/sanic#1729
- Added
LOG_LEVEL_LIBRARIESenvironment variable to set log level of libraries, such assanic
-
DeprecationWarnings are nowFutureWarnings, as they should be seen by end users -
textis now the first positional argument inutter_messageinstead ofimage
- The deprecated
utter_elementsnow correctly usesutter_message
-
Add support for multiple sanic workers (configurable with the
ACTION_SERVER_SANIC_WORKERSenvironment variable). -
Add support for async
runmethods in theActionclass. -
Return status code
404in case requested action was not found. -
Return status code
400in case an empty request body was sent to the/webhookendpoint.
-
Replace
flaskserver framework withsanic. -
Replace
flask_corswithsanic-cors. -
CollectingDispatcher.utter_messagecan now do anything that other dispatcher methods can do. -
The
CollectingDispatchermethodsutter_custom_message,utter_elements,utter_button_message,utter_attachment,utter_button_template,utter_template,utter_custom_jsonandutter_image_urlwere deprecated in favor ofutter_message. -
Updated format strings to f-strings where appropriate.
-
Remove
requestsdependency -
Remove
geventdependency
- Added Python 3.7 support.
-
Removed Python 2.7 support.
-
Removed Python 3.5 support.
- SSL support, certificates can be passed with –ssl-certificate and –ssl-keyfile
- fixed TypeError on
request_next_slotmethod ofFormActionclass
- undid Removed unused
trackerargument fromutter_templateandutter_button_templatemethods as it resulted in compatibility issues
Compatibility release for Rasa 1.3.0.
-
add
InMemoryKnowledgeBaseimplementation as a defaultKnowledgeBase -
add
ActionQueryKnowledgeBaseas a default action to interact with a knowledge base
- Removed unused
trackerargument fromutter_templateandutter_button_templatemethods
Compatibility release for Rasa 1.2.0. There have not been any additional changes.
dispatcher.utter_image_url()to dispatch images from custom actions
- correct slots print in debug mode before submitting a form
Compatibility release for Rasa 1.1.0. There have not been any additional changes.
-
validate events returned from action - checks for sanity
-
endpoint to retrieve all registered actions at
/actions
- package renamed from
rasa_core_sdktorasa_sdk- please make sure to update your imports accordingly
Compatibility release for Rasa Core 0.14.0. There have not been any
additional changes when compared to 0.13.1.
-
add formatter ‘black’
-
Slots filled before the start of a form are now validated upon form start
-
In debug mode, the values of required slots for a form are now printed before submitting
- validate_{} functions for slots now return dictionaries of form {slot: value} instead of value
- Slots extracted from entities in user input upon calling form activation are now correctly validated
-
Abstract Actions can now be subclassed
-
add warning in case of mismatched version of rasa_core and rasa_core_sdk
-
FormAction.from_trigger_intentallows slot extraction from message triggering the FormAction -
Tracker.active_formnow includestrigger_messageattribute to allow access to message triggering the form
-
add optional validate_{slot} methods to FormAction
-
forms can now be deactivated during the validation function by returning self.deactivate()
-
Function to get latest input channel from the tracker with
tracker.get_latest_input_channel()
-
self._deactivate()method from theFormActionclass has been renamed toself.deactivate() -
changed endpoint function so that it is now accessible with Python as well
- doc formatting preventing successful rasa core travis build
-
added Dockerfile for rasa_core_sdk
-
add
active_formandlatest_action_nameproperties toTracker -
add
FormAction.slot_mapping()method to specify the mapping between user input and requested slot in the form -
add helper methods
FormAction.from_entity(...),FormAction.from_intent(...)andFormAction.from_text(...) -
add
FormAction.validate(...)method to validate user input -
add warning in case of mismatched version of rasa_core and rasa_core_sdk
-
FormActionclass was completely refactored -
required_fields()is changed torequired_slots(tracker) -
moved
FormAction.get_other_slots(...)functionality toFormAction.extract_other_slots(...) -
moved
FormAction.get_requested_slot(...)functionality toFormAction.extract_requested_slot(...) -
logic of requesting next slot can be customized in
FormAction.request_next_slot(...)method
FormFieldclass and its subclasses
- current state call in tracker
- wrong event name for the
AgentUtteredevent - due to the wrong name, rasa core would deserialise the wrong event.