Creating actions for the Rasa chatbot
In this recipe, we will add a custom action and greet the user by name.
Getting ready
In order to create custom actions, we will need to install the rasa_core_sdk
package:
pip install rasa_core_sdk
How to do it…
We will first edit the configuration files, adding necessary information. Then, we will edit the actions.py
file, which programs the necessary actions. We will then start the actions
server and test the chatbot:
- First, in the
domain.yml
file, add a special intent calledinform
that may contain entities. The section will now look like this:intents: - greet - goodbye - affirm - deny - mood_great - mood_unhappy - bot_challenge - hours - address - thanks - inform
- In the same file, add a new section called
entities
wherename
is the entity:entities: - name
- Add a...