Skip to content

Latest commit

 

History

History
91 lines (50 loc) · 2.75 KB

README.md

File metadata and controls

91 lines (50 loc) · 2.75 KB

QnA Maker

Bot Framework v4 QnA Maker bot sample

This bot has been created using Bot Framework, it shows how to create a bot that uses the QnA Maker Cognitive AI service.

The QnA Maker Service enables you to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes. In this sample, we demonstrate how to use the QnA Maker service to answer questions based on a FAQ text file used as input.

Prerequisites

This samples requires prerequisites in order to run.

Overview

This bot uses QnA Maker Service, an AI based cognitive service, to implement simple Question and Answer conversational patterns.

We will be creating knowledge base for digia 112 FAQs using URL https://digia.com/en/112-suomi/frequently-asked-questions/.

Please refer manual about how to make QnA KB using URL.

  • Node.js version 10.14 or higher

    # determine node version
    node --version

To try this sample

  • Clone the repository OR download as zip from dropdown.

    git clone https://github.com/SureshG02/QnAMaker_FAQs.git
  • In a terminal, navigate to /QnAMaker_FAQs folder

  • Install modules

    npm install
  • Setup QnAMaker

    Please refer manual to set up QnA for 112 digia FAQs.

  • Run the sample

    Update MicrosoftAppId, MicrosoftAppPassword, QnAKnowledgebaseId, QnAEndpointKey and QnAEndpointHostName in .env file and run below command.

    npm start

Testing the bot using Bot Framework Emulator

Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator version 4.3.0 or greater from here

Connect to the bot using Bot Framework Emulator

  • Launch Bot Framework Emulator
  • File -> Open Bot
  • Enter a Bot URL of http://localhost:3978/api/messages

Deploy the bot to Azure

Prerequisites

Install Azure CLI

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Use below commands to deploy to cloud.

az login

az account set --subscription "subscription-id"

Go to QnAMaker_FAQs directory and run below command

az bot prepare-deploy --code-dir "." --lang Javascript

Go to QnAMaker_FAQs folder and zip all files present there. Run below command from directory where zip file exists.

az webapp deployment source config-zip --resource-group "" --name "" --src "code.zip"