-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move actions.py -> actions/actions.py in rasa init #6611
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long overdue (by my fault!) -- thanks for moving forward with this!
Start by creating the custom actions in a directory `actions` in your working directory: | ||
|
||
```bash | ||
mkdir actions | ||
mv actions.py actions/actions.py | ||
# Rasa SDK expects a python module. | ||
# Therefore, make sure that you have this file in the directory. | ||
touch actions/__init__.py | ||
``` | ||
|
||
Then build a custom action using the Rasa SDK by editing `actions/actions.py`, for example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, beautiful 🙌
|
||
The `rasa/rasa-sdk` image will automatically look for the actions in `actions/actions.py`. | ||
1. Make sure your actions are defined in `actions/actions.py`. The `rasa/rasa-sdk` | ||
image will automatically look for the actions in this file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, can you provide multiple actions files? If so it probably makes sense to update rasa sdk to pass the directory instead of that specific path to the module 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we're using DEFAULT_ACTIONS_PATH
which is just actions
, so Rasa SDK will by default load the whole actions
package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, should have clarified, i meant in the dockerfile: https://github.com/RasaHQ/rasa-sdk/blob/master/Dockerfile#L40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah got it, good point! we should change that
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)