Writing Custom Actions in Separate .py files

Personally, I’ve organized them into four different files by function:

  1. ask.py for action_ask_slot_name
  2. validate.py for for validation
  3. main.py for regular action classes
  4. submission.py for action_submit_form_name actions

You can break them down as much as you like as long as you keep them mounted inside the actions directory in the right place in your docker container if you are using docker.

In other words, it’s safe to break down these functions to as many files as you like, and it’s safe to place them wherever your current actions.py file is.

1 Like