A Simple Static Bot/Agent which will act as a guide for self assessment of probable risks from corona virus and increase awareness about the pandemic.
It's a Simple Bot/Agent which will act as a guide for self assessment of probable risks from corona virus and increase awareness about the pandemic. It answers any type of questions related to the pandemic and also tells you about the pandemic's statistics when asked for. The Bot can be also be asked about myths and rumours related and it also has the capability to mail a detailed report regarding the pandemic to the user.
This project is made using Google Dialogflow and the Language and Framework used for Backend Fulfillment is Python.
For Front-End Development: Dialogflow Console.
For Back-End Development: Python, Flask, Ngrok, Postman, Restful API, HTML, Javascript, CSS, Bootstrap, Pivotal Web Services, Kommunicate.io integration, Google Colab, Heroku, Git, SMTP services.
If you're working on a Local Machine, install the dependencies from your terminal with -
pip install -r requirements.txt
For developmental purposes and local hosting I've used ngrok
framework and flask
api. The Coder Editor in which I've developed the code is VS Code
.
For Front-End Development,
1.Use the Dialogflow console to develop and design all the neccessary intents and entities according to your purpose.
For Back-End Development and webhook connection,
- Open your terminal, and then run your Flask app as
python app.py
. - It will now get hosted in your local system with the IP as
127.0.0.1/5000
ie hosted on port 5000. (you can explicitely specify the port number though). - Now, run
ngrok http [port-number]
. In my case, port-number = 5000. - If your deployment is successful, it will provide you with an IP address. Feed that IP address as
ip-address/webhook
into your dialogflow fulfillment console. - Now, test the API using
POSTMAN
. If it's alright, we're good to go. - Set-up all necessary developments required such as STMP Server, fulfillment texts etc.
- After sucessfull completion of steps 1-6, deploy the
CovidBot
to a cloud services platform. I've used Pivotal Web Services here. In your terminal, after install of pivotal-cli typecf login
to login into your credentials and thencf push
to push your local repository. After sucessful deployment, a valid IP address of the deployment will be given and then update the fulfillment link in the Dialogflow console as[ip-address]/webhook
.
Telegram Link: https://t.me/r07_CovidBot
Web Deployment: https://rahulbordoloi.me/CovidBot/
Dialogflow Web Demo: https://bot.dialogflow.com/CovidBot
Fb Messenger: http://m.me/CovidBot (development phase)
Twitter Bot: http://twitter.com/DevR07 (development phase)
If you want to run this on your dialogflow console, download CovidBot.zip
file and export it in your Dialogflow Console.
Refer /docs
directory for the Web-Deployment Files.
For a Brief Descriptive Tour of the Bot, Refer here -> Video
To integrate this bot in your webpage, copy the following Javascript code from below and paste it just above the closing of <body>
tag on every page you want the chat widget to appear.
Using kommunicate.io -
<!--Chatbot Script-->
<script type="text/javascript">
/* NOTE : Use web server to view HTML files as real-time update will not work if you directly open the HTML file in the browser. */
(function(d, m)
{
var kommunicateSettings = {"appId":"22939516c2430abab558304c3773ef935","popupWidget":true,"automaticChatOpenOnNavigation":true};
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
var h = document.getElementsByTagName("head")[0];
h.appendChild(s);
window.kommunicate = m;
m._globals = kommunicateSettings;
}
)(document, window.kommunicate || {});
</script>
Refer kommunicate if you want to host your own chatbot.
Using Dialogflow Messenger -
<df-messenger
chat-icon="https://storage.googleapis.com/cloudprod-apiai/8d81cb42-c711-46b5-aaa1-6ca8be92b8b3_x.png"
intent="WELCOME"
chat-title="CovidBot"
agent-id="8ccaee6e-900c-4418-a3c9-a57f231925bb"
language-code="en"
></df-messenger>
- kommunicate for chatbot integration.
- rapid-api for corona-stats api.
If you are the helping and contributing one, your efforts and suggestion are always welcomed.