Ways to interact with your Chatbot

Ana Jessica
featurepreneur
Published in
3 min readAug 20, 2021

Have you tried building your own Chatbot !?

If not, refer this article to build your own chatbot.

So, Rasa is an open source that provides an advanced and smooth way to build your own chatbot and gives a satisfactory interaction.

There are 2 ways to interact with the Rasa Chatbot.

  1. With Rasa X
  2. By integrating our bot in a webpage

Rasa X interactive bot UI

Rasa X is the GUI provided by Rasa to try our chatbot on browser and also to support further development and analysis of our chatbot.

Installing Rasa X

  • The following requirements will allow you to install Rasa X without any errors.
pip install --upgrade pip==20.2pip install SQLAlchemy==1.3.22
  • To install Rasa X
pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple
  • To run Rasa X
rasa x
Rasa x

RASA X can be used as a UI for testing our bot results. We can also share the link from our bot and give it to users before deploying it, to get their feedback with which we can improve its performance and its accuracy.

Integrating Rasa Bot in a web application

To view it in a webpage, we have to integrate the trained the model in a webpage.

For this, we will use this repo https://github.com/scalableminds/chatroom.

  • Create index.html to the project directory ‘rasa-bot’ and copy the below code.
<div class="chat-container"></div>  

<script src="https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/dist/Chatroom.js"/
</script>

<script type="text/javascript">

var chatroom = new window.Chatroom
({
host: "http://localhost:5005",
title: "Featurepreneur Chat Bot",
container: document.querySelector(".chat-container"), welcomeMessage: "Hi. Nice to meet you! what do you want to know ?", speechRecognition: "en-US",
voiceLang: "en-US"
});

chatroom.openChat();
</script>
  • To make this HTML page working, we have to add the below code in the credentials.yml file, present in the project directory.
callback:  url: "http://localhost:5034/bot"
  • After that, open the terminal from the project directory and run the following command.
rasa run --credentials ./credentials.yml --enable-api --auth-token XYZ123 --model ./models --endpoints ./endpoints.yml --cors "*"
  • Open index.html with live server and interact with the chatbot.

Customize the UI of the chatbot, by adding css.

Hope you had fun creating your Own Personal Chatbot.

Keep Exploring !

--

--