I want to run both Rasa shell and Rasa custom action server on Google colab. Here are my settings, and part of code.
In the endpoints.yml.
action_endpoint:
url: "http://localhost:5055/webhook"
actions.py
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
class ActionHelloWorld(Action):
def name(self) -> Text:
return "action_hello_world"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
dispatcher.utter_message(text="Hello World from action!")
return []
After running Action server in the background using nohup.
!nohup /usr/bin/python3 -m rasa_sdk.endpoint --actions actions &
I trained the Rasa model using :
model_path = rasa.train(domain, config, [training_files] , output)
Then, I run the Rasa shell in colab cell using :
from rasa.jupyter import chat
endpoints = "endpoints.yml"
chat(model_path, endpoints)
This method somehow doesn’t connect with the Rasa action server, it will work for non-action replies. it just doesn’t work for getting custom replies.
But if I run the Rasa shell using !rasa shell --endpoints endpoints.yml
. Both part can be seen interacting but they won’t if chat(model_path, endpoints)
is used ?