npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qnamaker

v1.3.3

Published

Tooling for connectivity with the QnA Maker APIs

Downloads

121

Readme

The new BF CLI replaces legacy standalone tools

The Bot Framework SDK team is happy to announce the General Availability of the consolidated bot framework CLI tool bf-cli. The new BF CLI tool will replace legacy standalone tools to manage Bot Framework bots and related services. The old tools will be ported over in phases and all new features, bug fixes, and further investments will focus on the new BF CLI. Old tools will still work for the time being, but they are going to be deprecated in future releases.

Upon the release of Bot Framework SDK version 4.6 the following legacy tools have been ported: Chatdown, QnAMaker, LuisGen, and LuDown.

To learn more about the BF CLI please visit the BF CLI github repository.

The following page is about a legacy tool.

QnAMaker

npm version

QnAMaker is a command line tool and a library for interacting with QnAMaker service using the QnAMaker REST API.

Prerequisite

Installation

As a CLI

Make sure you have Node.js >=8.5 and npm installed on your machine, then use:

npm install -g qnamaker

As a library

The QnAMaker APIs can be installed and used as a library in any Node.js or JavaScript UI projects for the browser:

npm install -s qnamaker

You can then import and use service classes specific to the endpoint and operation you wish to call.

Command line usage

| Command | Description | |----------------------------------------------------------|-----------------------------------------------------------------------------------------------------| | Alterations | | | qnamaker list alterations | Download all word alterations (synonyms) that have been automatically mined or added by the user. | | qnamaker replace alterations --in wordAlterations.json | Replace word alterations (synonyms) for the KB with the give records. | | Endpointkeys | | | qnamaker list endpointkeys | List all the currently valid endpointKeys for querying your private endpoint. | | qnamaker refresh endpointkeys --keyType <string> | Re-generate an endpoint key, in case you suspect your keys have been compromised. | | KB | | | qnamaker create kb --in createKbPayload.json | Create a new knowledge base. | | qnamaker delete kb --kbId <string> | Delete a knowledge base by id. | | qnamaker export kb --kbId <string> --environment <string> | Export a knowledge base by ID. | | qnamaker get kb --kbId <string> | Get metadata about a knowledge base. | | qnamaker publish kb --kbId <string> | Publish all unpublished in the knowledge base to the prod endpoint. | | qnamaker replace kb --in replaceKb.json --kbId <string>| Replace knowledge base contents with new contents. | | qnamaker update kb --in updateKb.json --kbId <string> | Add or delete QnA pairs and / or URLs to an existing knowledge base. | | KBs | | | qnamaker list kbs | List all of your knowledge bases. | | Legacykb | | | qnamaker export legacykb --kbId <legacyKB> | Export legacy knowledge base (requires legacy --kbid and --subscriptionKey to be passed in). | | Operationdetails | | | qnamaker get operationdetails --operationId <string> | Get details of a specific long running operation. | | Query | | | qnamaker query --question "how do I turn it on" --top 5| Return the list of answers for the given question sorted in descending order of ranking score. |

Configuration

A configuration object is required to provide the endpoint base path, app ID, version ID and the authoring key to each outbound call. There are 3 ways to provide this information to the CLI:

  1. As a .qnamakerrc file in the cwd. The JSON format for the .qnamakerrc file:
{
  "subscriptionKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "kbId": "xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx",
  "hostname": "https://xxxxxx.azurewebsites.net",
  "endpointKey": "xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx"
}

NOTE: Simply run qnamaker init to answer simple questions to create your .qnamakerrc file

  1. As arguments to the CLI: --kbId <string> --subscriptionKey <string>

  2. As environment variables: QNAMAKER_KBID, QNAMAKER_SUBSCRIPTION_KEY, QNAMAKER_ENDPOINTKEY, QNAMAKER_HOSTNAME

The CLI will first look for these named configuration variables in the arguments list, then inside the .qnamakerrc file, then fallback to the environment variables.

Securing Your Access Key

To better secure your access key, it is recommended to omit the key from the .qnamakerrc file and instead pass it in to the --subscriptionKey argument or store it as the QNAMAKER_SUBSCRIPTION_KEY environment variable. If security is not a concern for your particular case, all configuration items can be stored in the .qnamakerrc for convenience.

Overriding Configurations

Since configuration items can be passed as arguments to the CLI, using arguments to specify the configuration will override the .qnamakerrc and any environment variables that may have been specified.

Nightly builds

Nightly builds are based on the latest development code which means they may or may not be stable and probably won't be documented. These builds are better suited for more experienced users and developers although everyone is welcome to give them a shot and provide feedback.

You can get the latest nightly build of QnAMaker from the BotBuilder MyGet feed. To install the nightly -

npm config set registry https://botbuilder.myget.org/F/botbuilder-tools-daily/npm/

Install using npm:

npm i -g qnamaker

To reset registry:

npm config set registry https://registry.npmjs.org/