Prerequisites
This workflow requires that you already have a Rasa CALM project initialized. Please see the Rasa installation guide for more details.Step 1: Implement Your Custom Action
Add your custom action by creating or modifying the actions/actions.py file. Below is an example of a custom action that validates sufficient funds:actions.py
Step 2: Run the Action Server
Start the action server locally using the Rasa CLI:http://localhost:5055 by default.
Step 3: Expose the Action Server
For Rasa Studio to connect to your custom action server during testing, expose your local server to the public internet. You can use a tool like ngrok for this purpose. Run the following command:Optional: Deploy to a Cloud Environment
If you want to avoid using ngrok for repeated testing or need a more robust setup, see more details on the action server reference to deploy your development action server to a cloud environment of your choice. Ensure the public URL of your deployed action server is accessible and provide it to Rasa Studio for integration.Step 4: Connect to Studio
- Open Rasa Studio and load your assistant project.
- Navigate to the Settings section in Rasa Studio.
- Go to the Endpoints tab and locate the Action Server URL field.
- Enter the URL of your action server:
- Option 1 (Using ngrok): Paste the public URL generated by the
ngrok http 5055command (e.g.,https://<your-ngrok-subdomain>.ngrok.io). - Option 2 (Local Server): If you are running the action server locally and testing on the same machine, use
http://localhost:5055.
- Option 1 (Using ngrok): Paste the public URL generated by the
- Click Save to apply the configuration.
- Train your assistant by clicking the Train button to ensure the new custom action is included in the training process.
- Use the Interactive Learning or Conversations tools to test your assistant and confirm that the custom action is executed as expected.
Troubleshooting Tips
If the assistant cannot connect to the action server:- Ensure the action server is running (
rasa run actions). - If using
ngrok, verify the public URL is still active and hasn’t expired. - Confirm the URL matches what is specified in the Action Server URL field.