/** * @module botbuilder-ai */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { TurnContext } from 'botbuilder-core'; import { QnAMakerResult } from '../qnamaker-interfaces/qnamakerResult'; import { QnAMakerResults } from '../qnamaker-interfaces/qnamakerResults'; import { QnAMakerEndpoint } from '../qnamaker-interfaces/qnamakerEndpoint'; import { QnAMakerOptions } from '../qnamaker-interfaces/qnamakerOptions'; import { HttpRequestUtils } from './httpRequestUtils'; import { FeedbackRecords } from '..'; /** * Utilities for using Query Knowledge Base and Add Active Learning feedback APIs of language service. * * @summary * This class is helper class for query-knowledgebases api, used to make queries to a Language service project and returns the knowledgebase answers. */ export declare class LanguageServiceUtils { _options: QnAMakerOptions; readonly endpoint: QnAMakerEndpoint; httpRequestUtils: HttpRequestUtils; /** * Creates new Language Service utils. * * @param {QnAMakerOptions} _options Settings used to configure the instance. * @param {QnAMakerEndpoint} endpoint The endpoint of the knowledge base to query. */ constructor(_options: QnAMakerOptions, endpoint: QnAMakerEndpoint); /** * Adds feedback to the knowledge base. * * @param feedbackRecords A list of Feedback Records for Active Learning. * @returns {Promise} A promise representing the async operation. */ addFeedback(feedbackRecords: FeedbackRecords): Promise; /** * Called to query the Language service. * * @param {string} question Question which need to be queried. * @param {QnAMakerOptions} options (Optional) The options for the QnA Maker knowledge base. If null, constructor option is used for this instance. * @returns {Promise} a promise that resolves to the raw query results */ queryKnowledgebaseRaw(question: string, options?: QnAMakerOptions): Promise; /** * Emits a trace event detailing a Custom Question Answering call and its results. * * @param {TurnContext} turnContext Turn Context for the current turn of conversation with the user. * @param {QnAMakerResult[]} answers Answers returned by Language Service. * @param {QnAMakerOptions} queryOptions (Optional) The options for the Custom Question Answering knowledge base. If null, constructor option is used for this instance. * @returns {Promise} a promise representing the async operation */ emitTraceInfo(turnContext: TurnContext, answers: QnAMakerResult[], queryOptions?: QnAMakerOptions): Promise; /** * Validate qna maker options * * @param {QnAMakerOptions} options The options for the Custom Question Answering knowledge base. If null, constructor option is used for this instance. */ validateOptions(options: QnAMakerOptions): void; private formatQnaResult; private validateScoreThreshold; private validateTop; private getFilters; private addFeedbackRecordsToKnowledgebase; } //# sourceMappingURL=languageServiceUtils.d.ts.map