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

@datafire/azure_cognitiveservices_qnamakerruntime

v3.0.0

Published

DataFire integration for QnAMaker Runtime Client

Downloads

5

Readme

@datafire/azure_cognitiveservices_qnamakerruntime

Client library for QnAMaker Runtime Client

Installation and Usage

npm install --save @datafire/azure_cognitiveservices_qnamakerruntime
let azure_cognitiveservices_qnamakerruntime = require('@datafire/azure_cognitiveservices_qnamakerruntime').create({
  auth_key: ""
});

.then(data => {
  console.log(data);
});

Description

An API for QnAMaker runtime

Actions

Runtime_GenerateAnswer

GenerateAnswer call to query the knowledgebase.

azure_cognitiveservices_qnamakerruntime.Runtime_GenerateAnswer({
  "kbId": "",
  "generateAnswerPayload": {}
}, context)

Input

  • input object
    • kbId required string: Knowledgebase id.
    • generateAnswerPayload required QueryDTO

Output

Runtime_Train

Train call to add suggestions to the knowledgebase.

azure_cognitiveservices_qnamakerruntime.Runtime_Train({
  "kbId": "",
  "trainPayload": {}
}, context)

Input

  • input object

Output

Output schema unknown

Definitions

ContextDTO

  • ContextDTO object: Context associated with Qna.
    • isContextOnly boolean: To mark if a prompt is relevant only with a previous question or not.
    • prompts array: List of prompts associated with the answer.

Error

  • Error object: The error object. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
    • code required ErrorCode
    • details array: An array of details about specific errors that led to this reported error.
    • innerError InnerErrorModel
    • message string: A human-readable representation of the error.
    • target string: The target of the error.

ErrorCode

  • ErrorCode string (values: BadArgument, Forbidden, NotFound, KbNotFound, Unauthorized, Unspecified, EndpointKeysError, QuotaExceeded, QnaRuntimeError, SKULimitExceeded, OperationNotFound, ServiceError, ValidationFailure, ExtractionFailure): Human readable error code.

ErrorResponse

  • ErrorResponse object: Error response. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
    • error: The error object.
      • code required ErrorCode
      • details array: An array of details about specific errors that led to this reported error.
      • innerError InnerErrorModel
      • message string: A human-readable representation of the error.
      • target string: The target of the error.

FeedbackRecordDTO

  • FeedbackRecordDTO object: Active learning feedback record.
    • qnaId integer: The qnaId for which the suggested question is provided as feedback.
    • userId string: Unique identifier for the user.
    • userQuestion string: The suggested question being provided as feedback.

FeedbackRecordsDTO

  • FeedbackRecordsDTO object: Active learning feedback records.

InnerErrorModel

  • InnerErrorModel object: An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
    • code string: A more specific error code than was provided by the containing error.
    • innerError InnerErrorModel

MetadataDTO

  • MetadataDTO object: Name - value pair of metadata.
    • name required string: Metadata name.
    • value required string: Metadata value.

PromptDTO

  • PromptDTO object: Prompt for an answer.
    • displayOrder integer: Index of the prompt - used in ordering of the prompts
    • displayText string: Text displayed to represent a follow up question prompt
    • qna: QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object
      • answer required string: Answer text
      • context: Context of a QnA
        • isContextOnly boolean: To mark if a prompt is relevant only with a previous question or not.
        • prompts array: List of prompts associated with the answer.
      • id integer: Unique id for the Q-A.
      • metadata array: List of metadata associated with the answer.
      • questions required array: List of questions associated with the answer.
        • items string
      • source string: Source from which Q-A was indexed. eg. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
    • qnaId integer: Qna id corresponding to the prompt - if QnaId is present, QnADTO object is ignored.

QnADTO

  • QnADTO object: Q-A object.
    • answer required string: Answer text
    • context: Context of a QnA
      • isContextOnly boolean: To mark if a prompt is relevant only with a previous question or not.
      • prompts array: List of prompts associated with the answer.
    • id integer: Unique id for the Q-A.
    • metadata array: List of metadata associated with the answer.
    • questions required array: List of questions associated with the answer.
      • items string
    • source string: Source from which Q-A was indexed. eg. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs

QnASearchResult

  • QnASearchResult object: Represents Search Result.
    • answer string: Answer.
    • context object: Context object of the QnA
      • isContextOnly boolean: To mark if a prompt is relevant only with a previous question or not.
      • prompts array: List of prompts associated with the answer.
    • id integer: Id of the QnA result.
    • metadata array: List of metadata.
    • questions array: List of questions.
      • items string
    • score number: Search result score.
    • source string: Source of QnA result.

QnASearchResultList

  • QnASearchResultList object: Represents List of Question Answers.

QueryContextDTO

  • QueryContextDTO object: Context object with previous QnA's information.
    • previousQnaId string: Previous QnA Id - qnaId of the top result.
    • previousUserQuery string: Previous user query.

QueryDTO

  • QueryDTO object: POST body schema to query the knowledgebase.
    • context: Context object with previous QnA's information.
      • previousQnaId string: Previous QnA Id - qnaId of the top result.
      • previousUserQuery string: Previous user query.
    • isTest boolean: Query against the test index.
    • qnaId string: Exact qnaId to fetch from the knowledgebase, this field takes priority over question.
    • question string: User question to query against the knowledge base.
    • rankerType string: Optional field. Set to 'QuestionOnly' for using a question only Ranker.
    • scoreThreshold number: Threshold for answers returned based on score.
    • strictFilters array: Find only answers that contain these metadata.
    • top integer: Max number of answers to be returned for the question.
    • userId string: Unique identifier for the user.