id | sidebar_label | title |
---|---|---|
rasa-sdk-changelog |
Rasa SDK Change Log |
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.8.0 (2024-04-03)
- #1072: Add an
--endpoint
flag to the rasa_sdk CLI to enable tracing configuration. - #1073: Instrument
ActionExecutor.run
method. - #1074: Instrument
ValidationAction.run
method and extract attributesclass_name
,sender_id
,action_name
andslots_to_validate
. - #1075: Implement functionality that enables creating additional spans within custom actions.
- #1076: Instrument
ActionExecutor._create_api_response
and extractslots
,events
,utters
andmessage_count
attributes. - #1077: Instrument
ValidationAction._extract_validation_events
andFormValidationAction._extract_validation_events
and extractvalidated_events
andslots
attributes. - #1078: Add a
stack
property to theTracker
class which corresponds to the dialogue stack.
- #1054: Upgrade
Certifi
to fix Improper Following of a Certificate's Chain of Trust.
Rasa_Sdk 3.7.0 (2023-11-22)
- #1016: Added tracing functionality to the Rasa SDK, bringing enhanced monitoring, execution profiling and debugging capabilities to the Rasa Actions Server. See Rasa Documentation on Tracing to know more about configuring a tracing backend or collector.
Rasa_Sdk 3.6.1 (2023-07-11)
- #1219: The logger for rasa_sdk plugin will not throw traceback when no plugins are found since plugins are optional. It will be only available in debug mode, however the action server will continue to run.
Rasa_Sdk 3.6.0 (2023-06-13)
- #975: Drop support for Python 3.7 as it is approaching its end of life in June 2023.
- #970: Add pluggy to provide ability to create sanic extensions in rasa-sdk
-
#922: ## Problem Rasa knowledge base actions cannot infer the object type of an object directly from the user message without the user first asking to list all objects related to that object type. This prevents action_query_knowledge from providing a suitable response when a user asks for a certain attribute of an object even though the knowledge base has the relevant information. That is, the knowledge base actions require the slot
object_type
to be set to one of the primary key values in the knowledge base for it to search through the objects. Here is an example:Your input -> what is the price range of Berlin Burrito Company? Sorry, I'm not sure I understand. Can you rephrase? Your input -> list some restaurants Found the following objects of type 'restaurant': 1: Gong Gan 2: I due forni 3: Pfefferberg 4: Lụa Restaurant 5: Donath Your input -> what is the price range of Berlin Burrito Company? 'Berlin Burrito Company' has the value 'cheap' for attribute 'price-range'.
- The improvement requires changes to the classes ActionQueryKnowledgeBase and InMemoryKnowledgeBase under rasa-sdk.
- The
object_type
can be inferred by utilizing the entity extraction (DIET) where object types are used as entities to annotate object names. This also requires changes to be made to slot management to enable dynamic inference ofobject_type
. - The scope of the suggested solution is limited to user queries where they ask for an attribute of a given object without mentioning the object type and without needing to first ask for a list of options of the corresponding object type.
- E.g.: If the user asks for ‘price range of Berlin Burrito Company’, then rasa will extract and set attribute slot value to ‘price-range’ and hotel slot value to ‘Berlin Burrito Company’. From this, it can be inferred that the user is talking about the object type ‘hotel’.
- To enable the inference of
object_type
using the entities the following changes were made to the existing code base:- Extract the list of object_types from our knowledge base using a new method
get_object_types()
instorage.py
for theInMemoryKnowledgeBase
class. - A new method named
match_extracted_entities_to_object_type()
was added inutils.py
to infer the object type of a given object using the entities and list of object types - The relevant logic was added in
actions.py
to infer the object type using the above functionalities when the object type slot is not set. - To enable dynamic inference of
object_type
, changes to slot management are also required. Currently, the change is to reset theobject_type
slot toNone
after every conversation turn.
- Extract the list of object_types from our knowledge base using a new method
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-file
to 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_slots
key 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_HOST
instead of listening on all host interfaces by default- Corrected url which is logged at action server startup
-
#419: Missing
typing_extensions
module addedMinor dependency updates
-
#8223:
utter_message
inCollectingDispatcher
now explicitly takes in bothresponse
andtemplate
. Note that the parametertemplate
will 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
uvloop
dependency for non-Windows systems asuvloop
is not available for Windows.
-
#306: Added command line argument option
--log-file
for 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
FormValidationAction
which immediately deactivated the form.
- #329: Extend
FormValidationAction
with support for extracting slots. If you want to extract an additional slot, add the slot's name to the list ofrequired_slots
and 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_message
to theTracker
allowing easier access to the user's latest intent in case of annlu_fallback
.
-
#246: Using the
Form
event is deprecated. Please use the newActiveLoop
event instead. Using theactive_form
property of theTracker
object is now deprecated. Please use theactive_loop
property instead.The usage of the
FormAction
is deprecated. Please see the migration guide for Rasa Open Source 2.0 for instructions how to migrate yourFormAction
s. -
#250: Removed support for the
rasa_core_sdk
python module: useimport rasa_sdk
syntax instead. -
#6463: The
FormValidation
event was renamed toLoopInterrupted
as part of Rasa Open Source 2.0. Using theFormValidation
is now deprecated and will be removed in the future. Please useLoopInterrupted
instead.
-
#238: Added the method
slots_to_validate
toTracker
. 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_validate
only 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
Form
event toActiveLoop
. TheActiveLoop
event was added to the SDK and support for theactive_loop
field in JSON payloads was added. -
#267: The
actions
package in a Rasa project may contain multiple files containing custom action code. The Rasa SDK Docker container now loads the entireactions
package. -
#288: Add the
FormValidationAction
abstract 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
LoopInterrupted
event.
- #280:
tracker.applied_events
now 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 running
log that was removed in Rasa SDK 1.6.0.
- #212: Fix
ActionExecutor
sometimes not loading user-defined actions that inherit from other user-defined ones.
-
#164: Added new
--auto-reload
CLI argument. When specified, modules containingAction
subclasses 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_entity
in 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
pyyaml
dependency to5.3.1
to fix CVE-2020-1747
- #110: Exit program (
python -m rasa_sdk --actions actions
orrasa run actions --actions actions
) if a requested module under the--actions
command-line option cannot be found.
- #153: Make it possible to use the
requests
library inside the default Rasa SDK container.
-
#130: Copied over instance methods
last_executed_action_has()
,get_last_event_for()
andapplied_events
from the RasaDialogueStateTracker
class to the SDKTracker
class. -
#145: Add
poetry
for dependency management and reduce the size of Docker image.
- #148, #149
-
ReminderScheduled
andReminderCancelled
now takeintent
andentities
as options, instead ofaction
. This is because starting with Rasa 1.7 reminders trigger intents (with entities) instead of actions. -
The following
FormAction
methods are nowasync
by default:validate_slots
,validate
,submit
andrun
. User-defined classes inheriting fromFormAction
should be adapted to useasync
for these methods. Existing synchronous implementations will continue to work as normal, but this behaviour will be deprecated in the future. -
The following
ActionQueryKnowledgeBase
methods are nowasync
:utter_objects
andrun
. -
The following
KnowledgeBase
methods are nowasync
:get_attributes_of_object
,get_key_attribute_of_object
,get_representation_function_of_object
,get_objects
andget_object
. Same warning forFormAction
applies here - user-defined classes should be updated to useasync
, but will continue to work for the moment. -
The following
InMemoryKnowledgeBase
methods are nowasync
:get_attributes_of_object
,get_objects
andget_object
.
- Pinned
sanic~=19.9.0
to fix breaking changes introduced in sanic 19.9.12.
- Added
SessionStarted
event for compatibility with conversation sessions in Rasa 1.6.0.
- Pinned
multidict
dependency to 4.6.1 to prevent sanic from breaking, see sanic-org/sanic#1729
- Added
LOG_LEVEL_LIBRARIES
environment variable to set log level of libraries, such assanic
-
DeprecationWarning
s are nowFutureWarning
s, as they should be seen by end users -
text
is now the first positional argument inutter_message
instead ofimage
- The deprecated
utter_elements
now correctly usesutter_message
-
Add support for multiple sanic workers (configurable with the
ACTION_SERVER_SANIC_WORKERS
environment variable). -
Add support for async
run
methods in theAction
class. -
Return status code
404
in case requested action was not found. -
Return status code
400
in case an empty request body was sent to the/webhook
endpoint.
-
Replace
flask
server framework withsanic
. -
Replace
flask_cors
withsanic-cors
. -
CollectingDispatcher.utter_message
can now do anything that other dispatcher methods can do. -
The
CollectingDispatcher
methodsutter_custom_message
,utter_elements
,utter_button_message
,utter_attachment
,utter_button_template
,utter_template
,utter_custom_json
andutter_image_url
were deprecated in favor ofutter_message
. -
Updated format strings to f-strings where appropriate.
-
Remove
requests
dependency -
Remove
gevent
dependency
- 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_slot
method ofFormAction
class
- undid Removed unused
tracker
argument fromutter_template
andutter_button_template
methods as it resulted in compatibility issues
Compatibility release for Rasa 1.3.0.
-
add
InMemoryKnowledgeBase
implementation as a defaultKnowledgeBase
-
add
ActionQueryKnowledgeBase
as a default action to interact with a knowledge base
- Removed unused
tracker
argument fromutter_template
andutter_button_template
methods
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_sdk
torasa_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_intent
allows slot extraction from message triggering the FormAction -
Tracker.active_form
now includestrigger_message
attribute 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 theFormAction
class 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_form
andlatest_action_name
properties 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
-
FormAction
class 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
FormField
class and its subclasses
- current state call in tracker
- wrong event name for the
AgentUttered
event - due to the wrong name, rasa core would deserialise the wrong event.