I’ve been working on a custom bot which connects to Google Assistant, based on this tutorial: Going beyond hey Google. I have it up and running on Docker with my own domain data. However, when I tried to implement a custom action server in another container, the server is available, but dispatcher.utter_message() doesn’t return the message back to RASA to be forwarded to Google and close the loop.
As shown in the code, I also tried dispatcher.utter_template("utter_dummy", tracker) to check if that returns anything, but no luck. I believe the issue is that I’m not starting the action server correctly, as I don’t call rasa run actions, but when I tried to add this command in docker-compose I get:
“./entrypoint.sh: line 17: exec: actions: cannot execute: Is a directory”
The actions folder contains __init__.py and actions.py
import requests
import json
from rasa_sdk import Action
class ActionTest(Action):
def name(self):
# define the name of the action
return "action_joke"
def run(self, dispatcher, tracker, domain):
request = requests.get('http://api.icndb.com/jokes/random').json() # make an api call
joke = request['value']['joke'] # extract a joke from returned json response
dispatcher.utter_message(joke)
# dispatcher.utter_template("utter_dummy", tracker)
return []
I am having this same issue. I have set up a minimal Rasa stack using Docker Compose (I overwrote the rasa entrypoint on the rasa/rasa:latest-full image so I could use the commands within the container, since the official Rasa image has rasa as its ENTRYPOINT).
The current versions being pulled from Docker Hub are:
Rasa 1.5.0
rasa-sdk 1.5.0
After running rasa init to get a base project up and running, I changed the bot_challenge intent to run the custom hello world example action. I added a log statement to the run method of the hello world action. I know that a connection is being made between Rasa Core and the Actions Server, since I get the following output in the Action Server logs when triggering the bot_challenge intent.
However, there is no reply from dispatcher.utter_message. I am using rasa shell to chat with the bot.
2019-11-26 14:32:21 INFO rasa_sdk.endpoint - Starting action endpoint server...
2019-11-26 14:32:21 INFO rasa_sdk.executor - Registered function for 'action_hello_world'.
2019-11-26 14:32:21 INFO sanic.root - Goin' Fast @ http://0.0.0.0:5055
2019-11-26 14:32:21 INFO sanic.root - Starting worker [1]
2019-11-26 14:32:33 INFO actions.actions - Hello world executed!
2019-11-26 14:32:33 INFO sanic.access -
Any idea why this isn’t working? I can get the bot to respond outside of custom actions.