Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
botbuilder-qna-maker
Advanced tools
Readme
###Short sample
const QnA = require('botbuilder-qna-maker');
// Send request to QnA maker, get an answer
const serviceGuid = '<INSERT SERVICE ID>';
const subscriptionKey = '<INSERT SUBSCRIPTION KEY>';
const qna = new QnA(serviceGuid, subscriptionKey);
const answer = await qna.answer('hi!');
console.log(answer);
###What's it for?
This package provides a shortcut to call the Microsoft QnA Maker service and get a response. It works with bots written in Node.js using Microsoft Bot Framework (see the botbuilder
package), but actually can be used in any code, not just in a bot.
###Methods and Static Members
The constructor takes two required and one optional parameter:
const qna = new QnA(serviceGuid, subscriptionKey, host);
You can get all of them from the Settings page at qnamaker.ai.
As for the host
, by default we're using the West US server ( https://westus.api.cognitive.microsoft.com/qnamaker/v2.0
) but you can change it if the service becomes available in another region.
Methods:
async answer(question)
- retrieves an answer and returns it as string, without any metadata.async getRawAnswer(question)
- retrieves an answer together with some metadata like the original question and the confidence score. Returns an object.Static Members:
QnA.FAILED_ANSWER = 'No good match found in the KB';
This is the answer returned by QnA maker when there is no suitable answer found. You can use it to output your own message:
if (answer === QnA.FAILED_ANSWER) {
console.log('Oops, no answer found.');
} else {
console.log(answer);
}
###Comments and suggestions If you have any comments, contact me here: https://github.com/catcher-in-the-try/
FAQs
Calls Microsoft's QnA Maker service and returns an answer from that service. This can be used to build a bot whose logic is partially based on the QnA maker responses.
The npm package botbuilder-qna-maker receives a total of 0 weekly downloads. As such, botbuilder-qna-maker popularity was classified as not popular.
We found that botbuilder-qna-maker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.