3.0.0 • Published 5 years ago

@datafire/azure_cognitiveservices_qnamakerruntime v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@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

ErrorCode

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

ErrorResponse

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

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.