https://github.com/codeforequity-at/botium-connector-qnamaker
Botium Connector for QnA Maker
https://github.com/codeforequity-at/botium-connector-qnamaker
Last synced: about 1 year ago
JSON representation
Botium Connector for QnA Maker
- Host: GitHub
- URL: https://github.com/codeforequity-at/botium-connector-qnamaker
- Owner: codeforequity-at
- License: mit
- Created: 2019-09-22T18:55:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-28T11:21:37.000Z (over 1 year ago)
- Last Synced: 2025-04-13T10:07:42.639Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.botium.at
- Size: 88.9 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Botium Connector for QnA Maker
[](https://nodei.co/npm/botium-connector-qnamaker/)
[](https://app.codeship.com/projects/365788)
[](https://badge.fury.io/js/botium-connector-qnamaker)
[]()
This is a [Botium](https://github.com/codeforequity-at/botium-core) connector for testing your [QnA Maker](https://www.qnamaker.ai) knowledge base.
__Did you read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) articles? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__
## How it works
Botium connects to the [QnA Maker API](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/).
It can be used as any other Botium connector with all Botium Stack components:
* [Botium CLI](https://github.com/codeforequity-at/botium-cli/)
* [Botium Bindings](https://github.com/codeforequity-at/botium-bindings/)
* [Botium Box](https://www.botium.at)
This connector processes info about NLP intent confidence. So the [intent confidence asserter](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/17334319/NLP+Asserter+Intents+Entities+Confidence) can be used.
## Requirements
* **Node.js and NPM**
* a **published QnA maker knowledge base**
* a **project directory** on your workstation to hold test cases and Botium configuration
## Install Botium and QnA Maker Connector
When using __Botium CLI__:
```
> npm install -g botium-cli
> npm install -g botium-connector-qnamaker
> botium-cli init
> botium-cli run
```
When using __Botium Bindings__:
```
> npm install -g botium-bindings
> npm install -g botium-connector-qnamaker
> botium-bindings init mocha
> npm install && npm run mocha
```
When using __Botium Box__:
_Already integrated into Botium Box, no setup required_
## Connecting QnA Maker to Botium
You can find everything you need to connect Botium to your QnA Maker knowledge base on the [_My knowledge bases_](https://www.qnamaker.ai/Home/MyServices) screen. Click on _View Code_ to bring up a sample HTTP request to your knowledge base. It looks like this:
```
POST /knowledgebases/xxxxxxxxxxxxx/generateAnswer
Host: https://yyyyyyyyyyy.azurewebsites.net/qnamaker
Authorization: EndpointKey zzzzzzzzzzzzzzzzzzzzz
Content-Type: application/json
{"question":""}
```
The botium.json file should look something like this:
```
{
"botium": {
"Capabilities": {
"PROJECTNAME": "",
"CONTAINERMODE": "qnamaker",
"QNAMAKER_KNOWLEDGEBASE_ID": "xxxxxxxxxxxxx",
"QNAMAKER_RESOURCE_NAME": "yyyyyyyyyyy",
"QNAMAKER_ENDPOINT_KEY": "zzzzzzzzzzzzzzzzzzzzz"
}
}
}
```
To check the configuration, run the emulator (Botium CLI required) to bring up a chat interface in your terminal window:
```
> botium-cli emulator
```
Botium setup is ready, you can begin to write your [BotiumScript](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/491664/Botium+Scripting+-+BotiumScript) files.
## Supported Capabilities
Set the capability __CONTAINERMODE__ to __qnamaker__ to activate this connector.
### QNAMAKER_KNOWLEDGEBASE_ID
QnA Maker Knowledgebase ID
### QNAMAKER_RESOURCE_NAME
QnA Maker Resource Name
### QNAMAKER_RESOURCE_ENDPOINT
QnA Maker Resource Endpoint
To specify a custom endpoint Url, like https://xxxxxxxxxxxx.azurewebsites.net
### QNAMAKER_ENDPOINT_KEY
QnA Maker Runtime Key
### QNAMAKER_RESOURCE_KEY
QnA Maker Authoring/Subscription Key
### COGNITIVE_SERVICES_RESOURCE_NAME
Cognitive Services Resource Name (for Model Downloader)
### COGNITIVE_SERVICES_RESOURCE_ENDPOINT
Cognitive Services Resource Endpoint
To specify a custom endpoint Url, like https://xxxxxxxxxxxx.cognitiveservices.azure.com