Retrieve stored Entities inside the custom action method

Let’s see the below command which will help us to retrieve the stored entities present inside the local bot memory:

variable_name = tracker.latest_message['entities']

The “tracker” keeps the record of the recent conversations and the stored entity. The above command will return an array of stored entities. We will have to Iterate through this array to get our desired entity value. 

How to send Custom Json Response from Rasa Chatbot’s Custom Action?

Rasa is an open-source Machine Learning framework to automate contextual text-voice-based Assistant. Rasa NLU understands the correct Intent with the help of its pre-trained nlu data. Rasa Core decides what to do next and reply according to in sync with the training stories. It also has the capability to store Entities (Noun type-specific Information stored for future use).  By default, it can respond with texts, image links, button objects etc.

Similar Reads

Installation

To get started with your own contextual assistant, just simply install Rasa with the help of below mentioned command:...

Creating a Rasa project

Creating a rasa project is very simple, rasa gives you an inbuilt command to create a sample project for you....

Custom Actions

Rasa provides its user with a lot of capabilities, it can perform any task just by writing a python class with some methods to fulfill the requirements. These functions are written in the actions.py file. Each function is attached with a specific action name starting with the “action_” keyword which should be mentioned accurately in the domain.yml file as well as in the user stories written in the stories.yml file. This custom action is triggered after a specific intent is captured by the nlu, it will perform the coded tasks and then will return the required responses....

Retrieve stored Entities inside the custom action method

Let’s see the below command which will help us to retrieve the stored entities present inside the local bot memory:...

Sending Custom JSON Response

Normally a bot sends a text message (string) as a response (Refer to the above-given screenshot) but the challenge comes when we have to send some custom response in the form of JSON data to satisfy the needs of the end-users of the bot....

Contact Us