Tag: watson conversation

使用Node.js从代理服务器后面调用Watson Conversation API

我正在使用Watson Node.js SDK https://www.npmjs.com/package/watson-developer-cloud向Watson Conversation服务发送消息,但是我在http代理的后面,无法访问到Watson服务。 我们如何configuration代理细节(在Node.js的内部或外部),以便可以进行出站API调用? var Watson = require( 'watson-developer-cloud/conversation/v1' ); // watson sdk // Create the service wrapper var conversation = new Watson( { username: '<username>', password: '<password>', url: 'https://gateway.watsonplatform.net/conversation/api', version_date: '2016-09-20', version: 'v1' }); conversation.message( payload, function(err, data) { … });

如何排除周日从沃森谈话

我在编码和沃森谈话新手,我试图做一个chatbot安排星期一到星期六约会。 我使用@ sys-date实体,它工作正常,但我不知道如何排除星期日。例如: 沃森 :什么是你最好的日子? 用户 :星期天 华生 :在这一天build立closures 我在工作区尝试:(condition)if: action =='sunday'like this: workspace 并在nodejs中这样编码 // Send the input to the conversation service conversation.message(payload, function (err, data) { if (err) { return res.status(err.code || 500).json(err) }else if(data.output.action==='sunday'){ var date = new Date(); if(!(date.getDay() % 6)){ return res.json(payload,data.output.text["On this day the establishment is closed"]); }}else{ return […]

chatbot Watson对话服务超时

目前,我正在开发一些聊天机器人,我想知道如何用超时的方式完成对话。 示例I: if(callback.error){ data.output.text = "The server is offline now. Please try again later. Goodbye!"; return res.json(data); //send the message exit(); //example (I did with sucess) } 例二: if(userInputText == false && data.context.time === 120){ //time = seconds data.output.text = "Are you still there?"; return res.json(data); //send the message exit(); //example if user did not […]

Watson对话服务+将对话推送到HTML中

我正在使用基于示例应用程序的Watson对话服务,使用NodeJS服务器和HTML客户端实现。 我有一个单独的事件触发器应用程序与NodeJS通信。 给定一个特定的事件触发器,我想在HTML客户端显示Watson的输出文本。 由于它不会有任何的HTML请求,我想知道如何能够显示或进行conversation.message api。

npm ELIFECYCLE错误

我在ibm watson上部署了testing机器人( https://github.com/eciggaar/text-bot) ,当我尝试在本地使用CLI代码部署代码时,它会得到以下错误。 我正在使用Nodejs版本6.10.3和npm版本5.0.4 有人可以帮助我这个。 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! text-bot@0.1.2 start: `node server.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the text-bot@0.1.2 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A […]