A bot designed to allow for rapid deployment of a question and answer service with support for multiple languages and accessible over web and SMS.
Disaster response scenarios require time-critical response to provide relief to affected individuals. Inspired by the aftermath of Hurricane Harvey, this project serves as a disaster response question and answer service to provide assistance for victims of natural disaster. The service allows for an operator to quickly plug in question and answer responses into a knowledge base which become auto-translated to end users of the service. The project also provides out of box support for Web and SMS allowing for increased availability to individuals who may not have internet access.
Try a live demonstration of the Emergency Services Bot by visiting https://emergencyservicesbot-test.azurewebsites.net/ or texting "hi" to +1-484-552-4268
- An active Microsoft Azure Subscription
- A registered bot at botframework.com
- An active QnA Service from qnamaker.ai
- An active Translator Text API Key
In some steps you will be asked to obtain and save a key value pair. Please be aware of this as you go through the steps and keep these values in a safe place.
-
Create or use an existing Azure Subscription
Free subscriptions can be obtained @ https://azure.microsoft.com/en-us/free/
-
Create an active QnA Service at qnamaker.ai
You may now begin adding questions to your knowledge base
Save / Retrain, and Publish your changes when you are ready
Obtain and save the following from values from Settings => Deployment Details
(top value is for "QnAKnowledgebaseId", bottom is "QnASubscriptionKey")
-
Create a Translator Text API Service @ http://azure.com
Obtain and save the value for the "TranslatorApiKey"
-
Create a bot channel registration within your Azure subscription
Within the Bot Channel Registration, click Settings to obtain and Save the value in "Bot handle" as "BotName" and the value in "Microsoft App Id" as "MicrosoftAppId"
Near the "Microsoft App Id" click "Manage" then "Generate New Password" to obtain and Save as "MicrosoftAppPassword"
Select "Channels", then add a DirectLine Channel and obtain and save one of the secret keys as "DirectLineSecret"
-
Verify that you have a saved value for "QnAKnowledgebaseId", "QnASubscriptionKey", "BotName", "MicrosoftAppId", "MicrosoftAppPassword", and "DirectLineSecret"
Once you have all of these values, click the "Deploy to Azure" Button below and supply the values where indicated:
Ensure that deployment is successful
Head back to the bot channel from step 4, click Settings and update the value for Messaging Endpoint to your newly deployed url + "/api/messages"
Reload your deployed website and you should see the bot operating using the configured knowledgebase:
If you do not have success, verify that the appropriate values are being supplied for the website's AppSettings
To enable SMS messaging with the bot, follow the instructions @ https://docs.microsoft.com/en-us/bot-framework/bot-service-channel-connect-twilio
For other channels, see: https://docs.microsoft.com/en-us/bot-framework/bot-service-manage-channels
- Clone this repo
- Open EmergencyServicesBot.sln in Visual Studio
- Add appropriate keypairs from the QuickStart steps into "Web.config" (Note: Local development does not require use of "MicrosoftAppId" and "MicrosoftAppPassword")
- Build and run the bot
- Download and run botframework-emulator
- Connect the emulator to http://localhost:{deploymentPort}
In Visual Studio, right click on EmergencyServicesBot and select 'Publish'
Within the include default.htm, there is an example of a landing page for the bot:
- Custom styling of the bot's look and feel are controlled by "/Content/botchat.css"
- Custom bot behavior is controlled by "/Scripts/botchat.js"
By modifying these files, you can give the bot a custom look and feel to accommodate your use case.