Connecting to HTML UI

@tmbo @akelad @Juste

Hi,

I have migrated from RASA v7 to v12 and am having difficulties in figuring out how to host my dialouge model and interpreter on a server that can interface with my HTML front end.

My earlier approach for custom actions was to use Klein to create a Python API wrapper for each custom action and then serve the app on a designated IP and port that I could connect to via Java Script on the Front End. The run code is shown below:

if name == “main”: server = Server(“models/dialogue”, RasaNLUInterpreter("./models/nlu/default/nlu_model")) server.app.run(“0.0.0.0”, 8080)

I am currently using JustinaPetr’s WeatherBot (GitHub - JustinaPetr/Weatherbot_Tutorial) tutorial as a guide.

Any help would be much appreciated.

Thanks & Regards, Leon

Hey @LeonPaul237. You should be able to spin up the server for your Rasa assistant using python or command line. If you use command line you can use the following commands to load your assistant on server (make sure to update the paths to your dialogue and nlu models):

    --enable_api \
    -d models/dialogue \
    -u models/nlu/current \
    --endpoints my_endpoints.yaml \
    -o out.log 

Inside the my_endpoints.yml you can specify the webhook for you custom actions. For example:

action_endpoint:
  url: "http://localhost:5055/webhook/"

Make sure that the action server is up and running when the bot server is up as well. To spin up the server for the custom actions run:

python -m rasa_core_sdk.endpoint --actions actions

Once you have it all up and running, your should be able to send requests to the Rasa Core server.

If you prefer using python, I actually have an updated version of the weatherbot assistant which will run with the latest versions of the Rasa NLU and Core. Check out the file run_app.py to see an example on how to achieve the same using Python scripts. Instead of using Slack as an input channel, you can write a custom connector to connect your Rasa assistant with your custom UI.

1 Like