I'm using IBM Watson Assistant for creating a chatbot. I'm using the web interface with the intents, entities and dialog flow|tree (I don't know how it is called, I'm just calling it web interface).
I would like to have one node in the dialog which waits for say 100s and then sends another message to the user but only if the user did not send another message in-between. I can add pause in a node but only a pause of at most 10s is possible. Of course I could add multiple such pause in sequence in a node but that's not so good style. How can I solve this instead to wait 100s and only sending a message afterwards if the user did not send a message during this 100s?
Moreover, I have a pretty linear flow in my chatbot (one large branch in the dialog tree). If the conversation with the chatbot is longer than 10 minutes I would like to stop it and jump out of the branch. I could solve it by storing the current time when the conversation starts and then checking in each node if the time difference is larger than 10 minutes and if so, jumping out. But this is again not good style. How can I solve this more elegant?
Unfortunately Watson Assistant does not provide this feature. But we have a lot of ways to do that, cause Watson is one API and we have all the back-end to create custom code, for instance.
You can use the last request /message and create one setInterval, adding some condition if passed more than since the last request to /message as you would like to and send some message that you want.
if(inputTiming > 100000) {
response.output.text = 'Hey, are you there?';
return response
}
Timing Events with Javascript
With Latest Watson Assistant, you can do something like this -
{
"time": 5000,
"typing": true,
"response_type": "pause"
},
Related
I have a skill in Alexa, Cortana and Google and in each case, there is a concept of terminating the flow after speaking the result or keeping the mic open to continue the flow. The skill is mostly in an Http API call that returns the information to speak, display and a flag to continue the conversation or not.
In Alexa, the flag returned from the API call and passed to Alexa is called shouldEndSession. In Google Assistant, the flag is expect_user_response.
So in my code folder, the API is called from the Javascript file and returns a JSON object containing three elements: speech (the text to speak - possibly SSML); displayText (the text to display to the user); and shouldEndSession (true or false).
The action calls the JavaScript code with type Search and a collect segment. It then outputs the JSON object mentioned above. This all works fine except I don't know how to handle the shouldEndSession. Is this done in the action perhaps with the validate segment?
For example, "Hi Bixby, ask car repair about changing my tires" would respond with the answer and be done. But something like "Hi Bixby, ask car repair about replacing my alternator". In this case, the response may be "I need to know what model car you have. What model car?". The user would then say "Toyota" and then Bixby would complete the dialog with the answer or maybe ask for more info.
I'd appreciate some pointers.
Thanks
I think it can easily be done in Bixby by input prompt when a required input is missing. You can build input-view to better enhance the user experience.
To start building the capsule, I would suggest the following:
Learn more about Bixby on https://bixbydevelopers.com/dev/docs/dev-guide
Try some sample capsules and watch some tutorial videos on https://bixbydevelopers.com/dev/docs/sample-capsules
If you have a Bixby enabled Samsung device, check our marketplace for ideas and inspirations.
I'm using IBM Watson Assistant for creating a chatbot. I'm using the web interface with the intents, entities and dialog flow|tree (I don't know how it is called, I'm just calling it web interface). I have four problems and hope that someone can help with it.
I have created two intens: #how_are_you with an example "How are you?" and intent #feeling_good with example "I'm good". Of course I have much more examples for these two intents. In the dialog I have now a parent node looking for #feeling_good and a child node looking for #how_are_you (skipping user input in-between). When a user now inputs the sentence "I'm good. How are you?" then only #feeling_good is triggered but not #how_are_you. How can I trigger both intents with only one user input?
I would like to have one node in the dialog which waits for say 100s and then sends another message to the user. Waiting is no problem (using pause) but how can I do it that only a message is sent after the 100s if the user did not send another message during the waiting period? That means when the user sends a message the waiting node should be canceled.
I have a node which checks for a certain intent. When the intent does not match I'm jumping back to the parent node. The problem is that the text from the parent node is repeated each time. How can I prevent this repetition when jumping back?
The last question is perhaps a bit more tricky. I would like to define an array of the numbers [1,2,3,4,5]. Then one node should sample a random number without replacement from that array (e.g. 2), i.e. the remaining array is then [1,3,4,5]. After some time another node should pick another number at random from the array (say 4). And so on. How can this be implemented? I know about variables (e.g. $var) but I don't know how to represent arrays and sample random numbers.
Thank you so much for your answers in advance. And happy new year to everybody.
1) In Watson Assistant always the intent with the highest confidence is used first. Hence processing multiple intents triggered by one sentence is tricky. The "best" solution is to use composite intent - #HELLO_HOW_ARE_YOU. Alternatively you can create conditions that would check if the first two intents returned are a comination of #HELLO and #HOW_ARE_YOU
2) Waiting and sending messages due to inactivity should be ideally handled by the client implementing the chat console in your interface. WA is not well suited for these types of operations, while there is some support, better way how to handle these is get your client application - when inactivity detected - to send something that will be mapped to #INACTIVITY_INTENT and WA will respond with your message coupled with that intent.
3) Don't jump to the node but jump to the first child of that node and use wait for user input.
4) This is possible. WA expression language supports getting random number, getting the size of an array and removing elements from the array.
E.g. <? $array.remove(new Random().nextInt(3))?>
I am building a chatbot that needs to be able to have long, branching conversations with users. Its purpose is to be able to engage the user for longs periods of time. One of the problems that I'm running into is how to handle unrelated responses from a user in the middle of a dialogue tree without "resetting" the entire conversation.
For example, let's say they have the following conversation:
Chatbot: Do you like vanilla or chocolate ice cream?
User: Vanilla
Chatbot: (recognizes "vanilla" and responds with appropriate child node) Great! Would you like chocolate or caramel on top?
User: Caramel
Chatbot: (recognizes "caramel" and responds with appropriate child node) That sounds delicious! Do you prefer sprinkles or whipped cream?
User: I would like a cherry!
At that point, my problem is that the chatbot triggers the "anything_else" response and says something like "I didn't understand that." Which means if the user wants to continue the conversation about ice cream, he has to start from the very beginning.
I'm very new to using IBM Watson assistant, but I did as much research as I could and I wasn't able to find anything. Any advice or help would be appreciated! So far the only idea I had was to have an "anything_else" option for every single dialogue node that could jump back to the next node up. But that sounds extremely complicated and time consuming. I was wondering if there was an easier way to just have the chatbot repeat whatever question it is asking until it gets a response that triggers one of the child nodes.
EDIT: It may be helpful to add that what I'm trying to here is "funnel" the user down certain conversation paths.
In anything_else node, you can enable return after digressions which will go back to the previous node and it fulfils your requirement.
There is a Anything Else option that acts as a fallback when the chatbot fails to recognize the intent.
You can take a look at the documentation here.
Having spent the last several days converting a working frontend application for a database with Async/Await, I fear I have worked myself into a corner. Being new to all this, I have a very simple question.
What happens to an "awaiting" process when the computer is suspended? Additionally, can a process that is "awaiting" be detected in a generic fashion so that the user can be warned that "the process is not finished" prior to Window closure? (The application has many Create and Update processes to manage the database backend).
TIA
Instead of
await DoAsync();
you could do something like
task = DoAsync();
await task;
and when closing your application, you might want to check somewhere else
if(task.Status == TaskStatus.Running)
...
this would make sense for long running operations. Have a look at the Task Class, though.
In Amazon Web Services, their queues allow you to post messages with a visibility delay up to 15 minutes. What if I don't want messages visible for 6 months?
I'm trying to come up with an elegant solution to the poll/push problem. I can write code to poll the SQS (or a database) every few seconds, check for messages that are ready to be visible, then move them to a "visible queue", or something like that. I wish there was a simpler, more reliable method to have messages become visible in queues far into the future without me having to worry about my polling application working perfectly all the time.
I'm not married to AWS, SQS or any of that, but I'd prefer to find a cloud-friendly solution that is stable, reliable and will trigger an event far into the future without me having to worry about checking on its status every day.
Any thoughts or alternate trees for me to explore barking up are welcome.
Thanks!
It sounds like you might be misunderstanding the visibility delay. Its purpose is to make sure that the polling application doesn't pull the same item off the queue more than once.
In other words, when the item is pulled off the queue it becomes invisible for a predetermined period of time (default is 30 seconds, max is 15 minutes) in case the polling system has a cluster of machines reading from the queue all at once.
Here's the relevant documentation:
http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/IntroductionArticle.html#AboutVT
...and the sentence in particular that relates to my comment is:
"Immediately after the component receives the message, the message is still in the queue. However, you don't want other components in the system receiving and processing the message again. Therefore, Amazon SQS blocks them with a visibility timeout, which is a period of time during which Amazon SQS prevents other consuming components from receiving and processing that message."
You should be able to use SQS for your purpose since you can leave an item in the queue for as long as you want.
7 years later, and Amazon still doesn't support the feature you need!
The two ways you can sort of get it to work are:
have messages contain a delivery target datetime in their message_attributes, and have the workers that consume the queue's messages just delete and recreate any message that is consumed before its target, with delay = max(0, min(secs_until_target_datetime, 900)) ; that would allow you to effectively schedule a message for any arbitrary future time;
or,
(slightly less frequent and costly:) similarly, if a message isn't due to be handled yet, recreate it and change its visibility timeout to be timeout = max(0, min(secs_until_target_datetime, 43200))
The disadvantage of using visibility timeout is that any read will re-trigger it.
There has been a direct AWS solution possible since 2016-12-01: AWS Step Functions
Each execution can last/idle up to one year, persists the state between transitions, and doesn't cost you any money while it waits.