aimpress-chatbot/node_modules/botbuilder-core/lib/recognizerResult.js
“SamoilenkoVadym” 55445dbc86
Some checks failed
Build and deploy Node.js app to Azure Web App - ChatBot2222 / build (push) Has been cancelled
Build and deploy Node.js app to Azure Web App - ChatBot2222 / deploy (push) Has been cancelled
Deploy bot to Azure
2025-04-27 19:55:19 +01:00

31 lines
No EOL
888 B
JavaScript

"use strict";
/**
* @module botbuilder
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTopScoringIntent = void 0;
const getTopScoringIntent = (result) => {
var _a;
if (!result || !result.intents) {
throw new Error('result is empty');
}
let topIntent = '';
let topScore = -1;
for (const [intentName, intent] of Object.entries(result.intents)) {
const score = (_a = intent.score) !== null && _a !== void 0 ? _a : -1;
if (!topIntent || score > topScore) {
topIntent = intentName;
topScore = score;
}
}
return {
intent: topIntent,
score: topScore,
};
};
exports.getTopScoringIntent = getTopScoringIntent;
//# sourceMappingURL=recognizerResult.js.map