我已经尝试了一个通过Node.js连接到LUIS的bot生成器示例.我无法连接到LUIS

I have tried a sample example of bot builder connection to LUIS through Node.js. I am not able to connect to the LUIS

本文关键字:LUIS 连接 bot js Node 一个      更新时间:2023-09-26

我已经尝试通过URL将bot连接到LUIS引擎,

var builder = require('botbuilder');
// Create bot and bind to console
var connector = new builder.ConsoleConnector().listen();
var bot = new builder.UniversalBot(connector);
// Create LUIS recognizer that points at our model and add it as the root '/' dialog for our Cortana Bot.
var model = 'https://api.projectoxford.ai/luis/v1/application?id=c413b2ef-382c-45bd-8ff0-f76d60e2a821&subscription-key=[REMOVED SUBSCRIPTION KEY]&q=';
var recognizer = new builder.LuisRecognizer(model);
var dialog = new builder.IntentDialog({ recognizers: [recognizer] });
bot.dialog('/', dialog);
// Add intent handlers
dialog.matches('builtin.intent.alarm.set_alarm', builder.DialogAction.send('Creating Alarm'));
dialog.matches('builtin.intent.alarm.delete_alarm', builder.DialogAction.send('Deleting Alarm'));
dialog.onDefault(builder.DialogAction.send("I'm sorry I didn't understand. I can only create & delete alarms."));

我得到一个错误,像

D: ' SID ' Bot_Frame ' LUIS_BOT1 app.js>节点我想创建闹钟

default_error
Error: getaddrinfo EAI_AGAIN api.projectoxford.ai:443
 at Object.exports._errnoException (util.js:1007:11)
 at errnoException (dns.js:33:15)
 at GetAddrInfoReqWrap.on lookup [as oncomplete] (dns.js:79:26)

这似乎是一个短暂的错误,所以首先尝试再次运行应用程序。如果错误仍然存在,请检查网络设置。如果您使用代理;确保node和NPM都配置好了

从http://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html

EAI_AGAIN实际上表示名称解析中的临时失败,或者只是名称服务器返回临时失败指示

EAI_AGAIN实际上是一个DNS查找超时错误,意味着它是网络连接错误或代理相关错误。试一试解决您的代理设置,并检查您有一个体面的互联网是否连接。

你也可以尝试运行LUIS Node.js样本,但我不认为你的代码中有错误,而且你得到的错误信息不在你的代码中