IKH

`Chatbot Deployment-Rasa

hatIn this segment, you’ll learn how to connect your chatbot to the outside world. Rasa provides support to implement chatbots through the command line as well as through Slack, Facebook Messenger, Telegram and a few other platforms. To connect to any public channel, you need a webhook.

 In the next video, Aiana will demonstrate how you can connect your bot to Slack through ngrok as the webhook. Note that you will deploy your bot on Slack in this project.

 Ngrok is a command-line application with which you can connect your chatbot to the Internet. Basically, ngrok connects your local server (on which you have built your chatbot) to a public URL securely so that you can share your bot over the Internet. 

You can get ngrok here. Download and unzip it.

In this project, you will use ngrok to generate a public URL that you can use to deploy the bot on Slack. 

If you haven’t used Slack before, then you can create a new workspace using your personal email id. You can go here to know how to do that.

You can check the official documentation to know how to connect with Slack.

NOTE:  Slack have updated their platform and because of it, the steps mentioned in the above video have been changed to integrate RASA with Slack.

The ‘Bot User’ tab has been changed, you can find this feature in a new place – App Home. You need to add scopes before adding Bot user . Once you have added the scopes, you can provide the ‘Display name’ & ‘Default username’ as mentioned in the video.

In order to avoid confusion with these updated changes, kindly refer to the following instructions to deploy the model on slack:

  • The first step as mentioned in the video is the same. You have to create the app on the slack API, After that, you need to provide the app name and development slack workspace.
  • After this step, under the ‘Basic features’ tab click on the ‘Add features’ tab and then ‘Event subscription’.

  • Once it is open, enable the ‘event subscription’ and add the webhook  URL in the ‘Request URL’ space provided as mentioned in the video. If the connection is established properly, you will get a verified tick above the field.
  • In the same tab, you can see the ‘Subscribe to bot events’ field. You need to click it and add some events by clicking the ‘Add Bot User Event’ button. The events which need to be added re message.channelmessage.groupmessage.im & message.mpim. Once these events are provided, click on ‘save changes‘.
  • Now, click on the ‘Interactivity and shortcuts’ tab, enable the interactivity and again paste the webhook URL in the request URL box provided and click on ‘save changes’.
  • Once saved, go to the ‘OAuth and permissions’ tab and click on the ‘Install app on workspace’ to install your app. Provide the needed permissions when prompted.
  • After that, you will get a ‘Bot User OAuth Access token’. Copy and paste that in the ‘slack token’ in the credentials.yml file and pass the bot name as the ‘slack channel’.
  • Now, go back to the slack.api . Click on the ‘OAuth and permissions’ tab and go to Scope feature, in the ‘add permissions by scope’  field you need to add ‘chat.write’ scope.
  • Once added, it will prompt you to reinstall app. Click on the ‘Reinstall app’, give the permissions when prompted, and then go back to the slack channel to test the bot.
  • You can then go to ‘App Home’ and provide the ‘Display name’ & ‘Default username’ as mentioned in the video. Once that is done, turn on ‘Always Show My Bot as Online’  to make your bot always online. 
  • Now, the bot can be tested in the same way as shown in the video.

You are now ready to build your chatbot. The next session explains the problem statement, deliverables, deadlines, etc., of the project.