Tag: watson conversation

沃森的谈话总是从根开始

我正在使用node.js开发一个项目,并使用IBM的watson对话服务。 问题是当我发送一个正确的节点文本总是从根节点开始,并忽略正确的节点。 我使用文档中提供的代码: var watson = require('watson-developer-cloud'); var conversation = watson.conversation({ username: '{username}', password: '{password}', version: 'v1', version_date: '2016-09-20' }); conversation.message({ workspace_id: '25dfa8a0-0263-471b-8980-317e68c30488', input: {'text': 'Turn on the lights'}, context: context }, function(err, response) { if (err) console.log('error:', err); else console.log(JSON.stringify(response, null, 2)); }); 感谢您的帮助。

Slack-App-Watson:Watson从之前收到的消息中泄露意图

我正在写一个简单的Slack机器人,它可以查找给定位置的天气状况。 在沃森对话框中,沃森做得很好: 我:天气请 沃森(检测到#weather_asked):你想知道天气状况? 我:巴黎 Watson(检测到@location for intent #weather_asked):查找巴黎的天气状况… 但在我的node.js应用程序(连接到Slack),似乎沃森是“ 不记住,我提供了#weather_asked意图的位置 ”: 我:天气请 Watson(检测到#weather_asked):哪里? 我:巴黎 沃森(只检测@位置和意图#location_given):我很抱歉,我不明白。 (fallback anything_else) 这就像Watson,当通过我的NodeJS应用程序使用时,忘记了最初的意图#weather_asked,并重置为其主要的对话框。 我错过了什么? 我的Watson对话对话框configuration的屏幕截图: http : //imgur.com/a/vKo8P 编辑:我发现我的应用程序发送用户的input到Watson与一个新的对话ID。 如果它已经存在,我会尝试设置这个上下文。

为什么当我在节点js中创build一个post调用时,Watson-conversation对任何请求都返回相同的默认响应

我已经在对话服务中创build了一个示例训练数据,现在我正在尝试使用节点js创build一个聊天应用程序的后期调用。我创build了一个后期调用,它正在工作,但并不如预期的那样。给我任何呼叫的默认响应。 我开始知道我们需要将响应中获得的上下文值传递给下一个调用进行stream,但不知道该怎么做。 有人可以帮助我。 以下是我的代码 var express = require('express'); var conversationV1 = require('watson-developer-cloud/conversation/v1'); var bodyParser = require('body-parser'); var app = express(); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); var conversation = new conversationV1({ username: 'xxxxxx-1a06-4a90-xxxxx-xxxxxxxxxxx', password: 'xxxxxxxxxx', version_date: conversationV1.VERSION_DATE_2016_09_20 }); const updateMessage = (input, response) => { var responseText = null; if (!response.output) { response.output = {}; } […]

如何在沃森对话中使用select选项

我正在尝试将select标记插入到对话中,以使用户更加简单。 我做到了这一点: 而在index.js中: function selected(){ switch($('#selected option:selected').val()){ case 01: alert("01"); break; case 02: alert("02"); break; } }; 但它不能识别所选的选项。 我尝试没有select的function()(只与开关的情况下),但它没有奏效..有人可以帮我吗? 非常感谢!

与谷歌环聊和ibm watson集成

有没有什么办法可以将Google Hangouts与IBM watson集成到一起?我已经通过节点j创build了一个bot,并且希望将该bot与Google环聊进行接口,其中会话将从ibm watson

方法在完成函数执行之前返回值

function rip(intent_update, output_rnr){ var headers_conv = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Basic YWFjZWU2M' }; var dataString = '{ "output": { "text": { "values": [' + output_rnr + '] } } }'; var options_conv = { url: 'https://watson-api-explorer.mybluemix.net/'+ intent_update + '?version=2017-05-26', method: 'POST', headers: headers_conv, body: dataString }; function callback_conv(error, response, body) { if (!error […]

维护上下文

我试图保持在沃森对话的上下文,但它不工作..我已经试过这个答案 ,但它没有奏效。 我正在尝试将bot整合到html中。 我在对话configuration中试过这个: var payload = { workspace_id: workspace, context: {}}; if (req.body) { if (req.body.input) { payload.input = req.body.input; } if(req.body.context) { payload.context = req.body.context; }} 而这个代码在html / javascript中: var payload = {}; var context = {}; function callWatson(){ alert("watson"); $.ajax({ type: 'POST', dataType: 'JSON', contentType: "application/json", url: '/api/message', data: JSON.stringify(payload) }).done(function (json) […]

IBM Watson对话 – 无法将node.js连接到watson对话

我有一个IBM沃森对话应用程序的问题。 我有我的应用程序设置,并尝试将其连接到我的node.js应用程序。 我正在按照这个教程在这里: https : //github.com/watson-developer-cloud/node-sdk#conversation和我使用官方node.js api ibm提供。 不幸的是,它不起作用,我得到以下错误。 { Error: Not Authorized at Request._callback (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/lib/requestwrapper.js:87:15) at Request.self.callback (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:1091:12) at IncomingMessage.g (events.js:291:16) at emitNone (events.js:91:20) code: 401, error: 'Not Authorized', description: '2017-06-01T08:57:57-04:00, Error ERCDPLTFRM-DNLKUPERR occurred when accessing […]

在watson会话中设置多个输出文本值

我在对话中有下面的节点。 我想提出的行动,并根据需要调用的API。 在成功的情况下,将显示output.text [0]和output.text [1] { "output": { "text": { "values": [ "I want to get this with success scenario", "I want to get this with error scenario" ], "selection_policy": "sequential" }, "action": "MyAction" } } 但是当我访问node.js中的这个会话节点时,它总是会给出第一个值,即'我想要成功获取这个场景',它永远不会给出像'我想得到这个错误场景'这样的输出。 如何解决这个问题?

在NodeJS上为Watson对话configurationHTTPS

这是在这个例子中提供的代码: 'use strict'; var server = require('./app'); var port = process.env.PORT || process.env.VCAP_APP_PORT || 3000; server.listen(port, function() { console.log('Server running on port: %d', port); }); 但是,当使用https而不是服务器时,它与IBM Watson会话代码无法正常工作。 以下是我使用的代码: var https = require('https'); var fs = require('fs'); var server = require('./app'); var port = process.env.PORT || process.env.VCAP_APP_PORT || 3000; var options = { key: fs.readFileSync('key.pem'), cert: […]