I have been trying to deploy my rasa bot to a Google Cloud, but while I generally don’t have trouble getting the core bot uploaded. And even action server runs locally, I cannot ever get my custom action server to respond when it’s uploaded (I’ve also tried on Heroku as well with the same problem).
Action Server Running Locally
Action Server Running in Cloud Just hangs
My endpoints.yml
# This file contains the different endpoints your bot can use.
# Server where the models are pulled from.
# https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server
#models:
# url: http://my-server.com/models/default_core@latest
# wait_time_between_pulls: 10 # [optional](default: 100)
# Server which runs your custom actions.
# https://rasa.com/docs/rasa/custom-actions
action_endpoint:
url: "http://localhost:5055/webhook"
My Dockerfile
# Extend the official Rasa SDK image
FROM rasa/rasa-sdk:latest
# Use subdirectory as working directory
WORKDIR /app
# Copy any additional custom requirements
COPY actions/requirements-actions.txt ./
COPY weather.py ./
COPY airtable.py ./
# Change back to root user to install dependencies
USER root
# Install extra requirements for actions code, if necessary (otherwise comment this out)
RUN pip install -r requirements-actions.txt
# Copy actions folder to working directory
COPY ./actions /app/actions
# By best practices, don't run the code with root user
USER 1001
CMD $(echo "rasa run actions -p $PORT --debug" | sed 's/=//')
I’ve tried creating a custom action server in nodeJS [from [Lykos94's rasa-node-action-server git](https://github.com/Lykos94/rasa-node-action-server)
]
const { RasaNodeActionServer, RasaActionEvent } = require("rasa-node-action-server");
const rnas = new RasaNodeActionServer();
rnas.define("action_hello_world", (action, res) => {
res
.addEvent(RasaActionEvent.bot("Hello world, from your action server"))
.send();
});
rnas.define("action_weather_test", async (action, res) => {
var weatherdata;
const { zipcode } = action.getSlots();
try{
weatherdata = await axios.get(`https://api.openweathermap.org/data/2.5/weather?q=${zipcode}&units=imperial&appid=${process.env.WEATHER_KEY}`);
console.log(weatherdata);
} catch (err){ console.error(err);}
res
.addEvent(RasaActionEvent.bot("Here's the weather for "+zipcode+": "+weatherdata['data']['weather'][0]['description']+ " with a temperature of "+((weatherdata['data']['main']['temp']).toFixed(1)+ "F")))
.send();
});
rnas.define("action_test_airtable", (action, res) => {
res
.addEvent(RasaActionEvent.bot("Hello world, from your action server"))
.send();
});
rnas.start();
But whenever I submit a POST to the action server (on port 5055 or 80), I never get a response. I don’t know what I’m doing wrong as I’ve tried using the rasa sdk on both heroku and google cloud, and even developing a custom action server in node and not a single one ever responds. What am I missing?