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”
actions folder contains
version: '3.0' services: opn_bot_ga: image: rasa/rasa:latest volumes: - ./:/app ports: - 3001:5004 command: # - train - run - --enable-api - -p - "5004" action_server: image: rasa/rasa-sdk:latest ports: - 5055:5055 volumes: - ./actions:/app/actions
action_endpoint: url: 'http://action_server:5055/webhook'
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