watson-assistant

Node js execute function before complete multiple lines of code

十年热恋 提交于 2020-01-25 07:19:29
问题 This function: function print(){ console.log('num 1') setTimeout(() => { global.name = 'max' console.log('num 2') },9000); console.log('num 3'); } print(); console.log(global.name) is priting this: num 1 num 3 undefined num 2 And I need to: print num 1 wait untill the 9 seconds set the global.name = max print num 2 print num 3 console.log(global.name) print max and not undefined I wrote this code in python and it executese line by line because there is nothing called sync and async. I need

IBM Watson Assistant: How can Skill gain access to session_id using V2 of WA API's

房东的猫 提交于 2020-01-06 05:39:07
问题 The V2 APIs for IBM Watson Assistant ask that you get a session_id and then use it in subsequent calls to the Assistant in order for global context values to be preserved across calls. Looking at the Preview link webpage we associated with our Assistant, it appears the request contains both a value object containing all the expected parts of the payload for a Skill, and a session_id. I would like to access this session_id in my skill to pass it along to cloud functions that may want to

IBM Watson Assistant: How to set a 'jump to' target node dynamically (i.e. using context variables)

青春壹個敷衍的年華 提交于 2019-12-24 07:16:16
问题 I want to jump from a dialog node to a node the ID of which is stored in a context variable. I'm trying to solve a problem that has to do with a digression and which has been described here: Conditionally return from digression in watson assistant Especially this chart visualizes the problem: In my opinion, A.H. posed a very reasonable and relevant question that has got no viable answer. As far as I can see the problem can not be solved by digression settings. Either the root level node

How do I add an action to watson conversation response?

帅比萌擦擦* 提交于 2019-12-17 07:55:32
问题 I've created intent, entity and dialog without a problem. But right now I'm trying to make it so when the user send "goodbye", the application would close. According to the doc, I'll have to name an action that goes along with an intent. How do I do that? Is it through code or through the conversation workspace platform? 回答1: You can use context variables or action variables for that. How to use context variables? Add in your Advance response the "context" and the values, check my example. I

How do I add an action to watson conversation response?

非 Y 不嫁゛ 提交于 2019-12-17 07:55:12
问题 I've created intent, entity and dialog without a problem. But right now I'm trying to make it so when the user send "goodbye", the application would close. According to the doc, I'll have to name an action that goes along with an intent. How do I do that? Is it through code or through the conversation workspace platform? 回答1: You can use context variables or action variables for that. How to use context variables? Add in your Advance response the "context" and the values, check my example. I

IBM Action not returning anything after GET request

雨燕双飞 提交于 2019-12-13 03:11:03
问题 First of all, I am a beginner in Javascript, so if there are any uncertainities or unclarities in my message, please feel free to correct me. I try to create an action to support my IBM Watson Assistant. Once called, the action should get some info from a http and give some answer back. The "get" action was part of a Webhook, successfully deployed via Heroku as support for Dialogflow. I just changed it a little bit, to make the answer easier. function main(req){ const http = require('http');

Conditionally return from digression in watson assistant

白昼怎懂夜的黑 提交于 2019-12-11 13:25:12
问题 I have been reading through the documentation and cannot find the answer to this question for Watson Assistant. I have a digression that I only sometimes want to return back to the previous place in the dialog. Specifically, after the user enters the digression, if the user responds "Yes" then I do not want the digression to return back, but if the user responds "No" then I do want the digression to return to the previous place. Is there a way to do this? Perhaps by manually editing the JSON

How can I get Watson to recognize two different dates upon user input?

China☆狼群 提交于 2019-12-11 07:27:33
问题 If a user asks the following sentence: For some reason Watson uses the first date for the both $checkin and $checkout variables even though it detects the second date. You can refer to the "dialog node" screenshot to see how the nodes are setup. How can I get Watson to recognize the first date is the checkin date and the second one is the checkout date. Is there a way I could tell Watson after the first date is used if a second one is detected use it to fill the next slot? I've found

Save user input (string) in Watson assistant

巧了我就是萌 提交于 2019-12-11 06:07:40
问题 I'm building a chat-bot application based on IBM Watson. I need to save the user input into a variable. I searched the web and I only found tutorials where the input must be of entity sys-(number, day, time, location, person). In my dialog I ask the user about his identifier. This identifier should be an alphanumerical string. How can I do so? 回答1: Take a look at this IBM Cloud solution tutorial that creates a chatbot. It uses identifiers for emails, URIs and conferences. I see two options

NPM ELIFECYCLE error - using node server.js command

巧了我就是萌 提交于 2019-11-30 04:38:40
I am deploying test-bot on ibm watson as described here https://github.com/eciggaar/text-bot and when I am trying to deploy code locally using CLI foundry it is getting the following errors. I am using Nodejs version 6.10.3 and npm version 5.0.4 can someone please help me with this. 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 complete log of this run can be