0
    `Hi this my code i am working on LUIS and QNA Services together but when i am sending message on Emulator i am getting some error msg
    1)The bot encountered an error or bug.
    2)To continue to run this bot, please fix the bot source code. `

const dispatchRecognizer = new LuisRecognizer({ 在此处输入图像描述 applicationId: process.env.LuisAppId, endpointKey: process.env.LuisAPIKey, endpoint: https://${ process.env.LuisAPIHostName }.api.cognitive.microsoft.com }, { includeAllIntents: false, includeInstanceData: false }, true);

this.onMessage(async (context, next) => {
    console.log('Processing Message Activity.');
    let con:any=context;
    console.log(context);
    // First, we use the dispatch model to determine which cognitive service (LUIS or QnA) to use.
    const recognizerResult = await dispatchRecognizer.recognize(con);
    console.log("recogResult- ",recognizerResult);
    // Top intent tell us which cognitive service to use.
    const intent = LuisRecognizer.topIntent(recognizerResult);
    console.log("Intent -",intent);
    // Next, we call the dispatcher with the top intent.
    await this.dispatchToTopIntentAsync(context, intent, recognizerResult);

    await next();
});
4

1 回答 1

0

开源 Bot Framework SDK 提供了 40 多个常见的可重用构建块和示例,可用于 .net、JavaScript(es5、es6)、Python 和 Java。这些示例从简单的回声构建到用于对话、状态管理和身份验证的示例。这些可以结合起来创建更复杂的解决方案,这些解决方案也用于虚拟助手解决方案。

以下是部分样本列表。查看整个列表https://github.com/Microsoft/BotBuilder-Samples

NLP-with-dispatch:演示如何跨 LUIS 和 QnA Maker 进行调度。

于 2020-12-31T06:31:25.543 回答