繁体   English   中英

我通过Node.js尝试了一个bot架构连接到LUIS的示例。 我无法连接到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

我试图通过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)

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

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

EAI_AGAIN实际上意味着名称解析暂时失败,或者只是名称服务器返回临时故障指示

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

您也可以尝试运行LUIS Node.js示例,但我不认为您的代码中存在错误,并且您获得的错误消息不在您的代码周围。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM