… You other users can’t deny
That when a bot loads up with a big knowledgebase
and throw questions in its face
You get answers …
OK, enough of that. I saw a tweet by James Marshall (@jamesbmarshall) which he followed up with a blog post where he spoke about building a bot using in less than an hour with zero code. His jamesbmarshallbot (a chat bot to handle out of office queries) piqued my interest and I wanted to have a go myself to see if the claims were true.
I used the QNAMaker website which is heavily wizard based and will either take a FAQ from a page, allow you to upload questions and answers in a tab separated text file or you can manually enter the questions and answers on the page. Following the instructions on James’ blog page I quite quickly was able to create StuartRidoutBot which, similarly to James’ bot, would answer queries if I was out of the office. You can interact with StuartRidoutBot in the following ways:
I was happy with the bot but not the standard welcome (Welcome You!) or the response if it couldn’t find an answer (the rather abrupt No match found!)
Customising the welcome message
- In the Azure Bot Service, go to your bot and ensure you’re in the Develop tab.
- Select the run.csx file
- Find the code highlighted below and edit the message to suit
Edit the error message
In the Azure Bot Service select the BasicQnAMakerDialog.csx file and find the code highlighted below.
public BasicQnAMakerDialog() : base(new QnAMakerService(new QnAMakerAttribute(Utils.GetAppSetting("QnASubscriptionKey"), Utils.GetAppSetting("QnAKnowledgebaseId"),"Sorry but I can't find an answer. Could you please rephrase your question?")))
The code highlighted above should be added in (including the comma) as an extra parameter to the QnAMaker definition.
Other useful resources