Skip to content
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

Merged
merged 12 commits into from
Sep 10, 2020

Conversation

ricwo
Copy link
Contributor

@ricwo ricwo commented Sep 9, 2020

Proposed changes:

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@ricwo ricwo added this to the 2.0rc1 Rasa Open Source milestone Sep 9, 2020
Copy link
Contributor

@erohmensing erohmensing left a 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!

Comment on lines -169 to -179
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:
Copy link
Contributor

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.
Copy link
Contributor

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 🤔

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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

@rasabot rasabot merged commit 348c4e8 into master Sep 10, 2020
@rasabot rasabot deleted the update-actions-scaffold branch September 10, 2020 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency in initial project setup for actions running via rasa or via sdk
3 participants