Search code examples
c#botframeworkchatbotazure-language-understandingazure-qna-maker

How to Add QnA Maker service to a chatbot which has LUIS


I have a chatbot that is already integrated with Luis. I am using .NetCore 2.0 with sdk v4.

I have created a knowledge base in QnA Maker. Now I am ready to add QnA Maker to my chatbot. I am kind a stuck at adding QnA Maker service in my bot.

This is my .bot file

{
  "name": "Bot",
  "description": "",
  "services": [
    {
      "type": "abs",
      "appId": "",
      "id": "1",
      "name": "Bot",
      "resourceGroup": "",
      "serviceName": "",
      "subscriptionId": "",
      "tenantId": ""
    },
    {
      "type": "blob",
      "connectionString": "",
      "id": "",
      "resourceGroup": "",
      "serviceName": "",
      "subscriptionId": "",
      "tenantId": ""
    },
    {
      "type": "luis",
      "appId": "",
      "authoringKey": "",
      "id": "5",
      "name": "BotwithAgent",
      "region": "westus",
      "version": "0.1"
    },
    {
      "type": "QnA",
      "KnowledgeBaseId": "",
      "EndpointKey": "",
      " Host": "",
      "id": "5",
      "name": "DevChatbotKB"
    },
    {
      "type": "endpoint",
      "endpoint": "http://localhost:3978/api/messages",
      "name": "development",
      "id": "7"
    }
  ],
  "padlock": "",
  "version": "2.0",
  "path": "C:\\Users\\snaeem\\Desktop\\Work\\bot\\cafe-bot.bot",
  "overrides": null
}

And this is the part where the bot loads configurations:

enter image description here

I do not see my QnA Maker service being loaded. Is there any other way to load it?

Secondly, can someone guide me to a post/github repo that has luis+qna maker in .NetCore using C#.


Solution

  • Regarding your .bot file:

    • This method of providing settings to a bot has been deprecated in version 4.3 and above of the SDK as per this documentation.
    • The type for your QnA entry should be "qna" as per the source here and snapshot of the code for the Startup file before it was migrated to use an appSettings.json file is available here.

    The sample you are after for integrating LUIS and QnA Maker is this one (nlp-with dispatch). There is a guide available here which will step you through how it all works and getting it up and running.