0

I want to deploy my rasa chatbot into my own live website. Rasa worked in my localhost server but, as a beginner into a web development, I didn't understand the RASA's official guide in the link bellow: https://rasa.com/docs/rasa/user-guide/connectors/your-own-website/

In the official guide of RASA,they mentioned that I have to supply a credentials.yml with the following content:

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

Or I can use REST Channels with running a script: run rasa but they didn't mentioned if I have to copy the project's folder to my website, and how I can copy the VENV, or at least how I can run the script: "rasa run" from my website.

Here is what I did in my local environment:

  1. I modified the credentials.yml with the code bellow : socketio: user_message_evt: user_uttered bot_message_evt: bot_uttered session_persistence: true rasa: url: "http://localhost:5002/api"
  2. activate the Venv which called vvv by : conda activate vvv
  3. I'm running the command: rasa run -m models --enable-api --cors "*" --debug (inside the project's folder)

here is the screenshot

  1. in my index.html file , I insert "http://localhost:5005" in the value of socketUrl

screenshot

and it worked as you see below:

screenshot

How can I deploy this in my own website? I tried to copy this folder to my own website but it doesn't work! How I can call this command from my website: rasa run -m models --enable-api --cors "*" --debug

Can I know if it's about a simple JavaScript code to call the assistant, or it's about complex steps?

Dharman
  • 30,962
  • 25
  • 85
  • 135
yassine
  • 31
  • 3

2 Answers2

0

on your web site the solution is to include the Rasa Web Chat plugin which provides a chat widget.
See the documentation but the idea is that you configure the Javascript necessary to create the chat widget and enable the connectivity with the Rasa server

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
<script>
 WebChat.default.init({
 selector: "#webchat",
 initPayload: "/get_started",
 socketUrl: "http://localhost:5500",
 socketPath: "/socket.io/",
 title: "My Chatbot John",
 subtitle: "Ask me",
})

See an example here of Rasa assistant deployed on a static site (github)

Beppe C
  • 11,256
  • 2
  • 19
  • 41
  • I think that this in not the answer about how Can I migrate my local server to a live server! I found that I have to use some servers like Heroku, But it's not working because of the large size of instaling my dependancies. here is the message that I receive: Compiled slug size: 671.3M is too large (max is 500M). – yassine May 15 '20 at 20:14
  • ok, it wasnt very clear as you mentioned your own web site. I deployed as Docker image so you can control better what you package, see the link in my answer – Beppe C May 16 '20 at 16:03
  • To migrate your local server to a live server, pick a deployment method from the docs here: https://rasa.com/docs/rasa/user-guide/how-to-deploy/#deploying-your-rasa-assistant – Ella Rohm-Ensing May 20 '20 at 13:26
  • @EllaRohm-Ensing , As I mentioned in my question, I already saw the official guide that you sent me. The problem is that guide need some knowledge about DOCKER, OR others technologies, Unfortunately, I worked More than one month to develop a chatbot with RASA, and when I tried to deploy it to show it to my Manager, I didn't find a support from RASA Team! I had to use Dialogflow that have a simple guide and so clear to deploy your chatbot in amazon cloud. Thank you anyway Ella for your help. – yassine Jun 07 '20 at 09:07
0

You'll have to deploy Rasa Chatbot somewhere and then with the help of rest api you can call it.

If you are deploying on Heroku using docker then multi-stage docker build and using slim build of python may help.

  • Thank you for your help, yes this is what I'm looking for, but , I didn't yet knew how to use REST API. in , HEROKU, I found a problem that the size of my package is bigger than 500 MB, so I couldn't use it. Do you have an alternative solution to deploy my package? if yes, how to link between this cloud and my own site with REST API? – yassine May 19 '20 at 14:04