It states that “The rasa/rasa-sdk image will automatically look for the actions in actions/actions.py .”
However, I have multiple actions python scripts which are put in the same folder named “actions” and no one named “actions.py”. What can I do for this situation?
EDIT: I just published an article on how to do this
Sure thing.
Couple of basic instructions first so it all makes sense.
The first thing to do is create an actions folder off of your project root
Then create a file in that actions folder with the name __init.py__ (that’s 2 underscores before and after) This tells the system this directory is a “package” and everything in here gets loaded.
Then move your actions.py file into your new actions folder
Now you can split up your actions.py file up.
To do this
Create a new file - say action_file_1.py (the filename is arbitrary, name it whatever makes sense to you).
Copy all of your import and from statements from the main actions.py file and paste them into your new file.
Cut / paste however many classes you want to move from your main actions.py file to your new one.
Save the file
repeat as necessary
I’m working on an in-depth article explaining this and how I organized mine, etc, but that’s the general idea.
Here’s a screenshot of my actions folder:
And here’s an example of the top of one of these new action files with my import and from statements and the beginning of the Class I moved here.