botbuilder LuisRecognizer不支持代理

时间:2017-08-02 11:48:19

标签: node.js bots botframework luis

我写了一个自定义识别器。

hey there

当我在模拟器中输入“Hello”时,它会回复"Sorry couldn't understand".。有用。

但是当我尝试使用Luis API时它不起作用。它回复const model = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/**?subscription-key=***&verbose=true"; var recognizer = new builder.LuisRecognizer(model); bot.recognizer(recognizer)

var builder = require('botbuilder');
var model = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/***?subscription-key=***&verbose=true&timezoneOffset=330&spellCheck=false";
var recognizer = new builder.LuisRecognizer(model);
recognizer.recognize(
  "hello",
   model,
  function (err, intents, entities) {
    console.log(intents);
  }
)

我在终端(节点>)中尝试以下操作它不起作用。 here is the doc I followed

SELECT 
FROM users 
INNER JOIN user_information ON users.id = user_information.user_id 
ORDER BY user_information.room_count DESC
LIMIT 2

Luis模型网址完美无缺,返回正确的意图,在浏览器中进行测试。

如何调试?

1 个答案:

答案 0 :(得分:0)

import globalTunnel from 'global-tunnel';

process.env.http_proxy = 'http://proxy:80';
process.env.https_proxy = 'http://proxy:80';
globalTunnel.initialize();
添加识别器globalTunnel.end()

后,

添加bot.recognizer(recognizer)

它有效。