IBM Watson Assistant: How to close dialog by disabling input field? - ibm-cloud

How can I disable the input field of Watson assistant after giving closing statement?
Ex: If the bot shows thank you for using our services, then the Input field should be grayed out and should not let user to type, user has to restart the bot to chat.

There is a method in watson :instance.updateAssistantInputFieldVisibility(false) it disables the input field, so you can customize the way you want to use.

I see the following options for you to "disable" the chat in Watson Assistant.
You could respond with a pause.
Set an internal variable that from your point of view the dialog is done and should not be resumed again. React to any input by not answering.
Consider a special version of anything_else.
Build your own interface that can disable the input.
IMHO disabling input should not be done, it is against best practices. You want the user to interact. Reloading the web page with the chat typically reenables input anyway. So what is the use case...?

Related

How to callout to an action skill from a dialog skill in IBM watson?

I have been trying to create a chat bot that helps users to interact with my website. I want Watson to be able to interact with my web-server to read, write or modify my database. In certain cases, Watson will require some very specific user inputs/Q&A which are too unordered to belong to any specific entity, for which I'm thinking an Action skill can help. After creating an Action skill that collects the desired user inputs, I'm now unable to find the option that let's you call an action skill from within a dialog node, or to callout for webhooks from an action skill.
Although some articles from the documentation says, it's possible to do so but I can't see from where. There used to be an option (Call an action skill) in the customize dialog box, here is a screenshot of the old customize dialog box, but this option is not there anymore. Is there any other way to achieve this?
IBM no longer provides the callout to actions skill from dialog skill. They posted alerts for existing users;-
Note: Once disabled, call out to an action skill will no longer be available.

IBM Watson Assistant: How to set a context variable from option response?

I couldn't figure out a problem with IBM Watson Assistant. I've chosen to use an Option type as response. That way, I can see a list on my chatbot where each item is clickable and has an associated value.
When a user clicks one of the options, the associated user input value is sent to the assistant. How can I give this value to a context variable? Is it possible?
Yes, that is possible for option responses and is the typical use case. I have demonstrated that in a simple chatbot I use in some of my talks.
I use different language code as options. Users can click on them and the result is saved in the variable langcode. Because users could have already specified what I would ask for, I check for it and save it.
The simple bot has more uses of options and the full skill is available in case you want to see all the details.

Debug Watson Assistant webhook

My Watson Assistant dialog has a webhook call to an IBM Cloud Functions action. After I change the code in the action function and "Try it out" again in Watson Assistant, it doesn't pick up the change. Is there some cache I need to clear, or something I need to restart each time I make a code change?
In Watson Assistant in the "Try it out" are links / buttons to clear everything or to manage context variables. There you can reset the "Try it out" bot.
In general, when you assign values to a variable the value is kept until you clear or delete it. Thus, if you do not set input variables to null to clear them they are reused without asking the user for input again.

How do i insert a checkbox in the IBM Watson Assistant?

I am using IBM Watson Assistant to create a troubleshooting guide. I wish to put a disclaimer in the beginning and only if the user checks the checkbox saying he agrees to the statements in the disclaimer, they will be able to go further in the conversation.
I tried include the HTML checkbox code, but it doesn't seem to work. I don't want "options" which is present in the Assistant. i wish to have a checkbox.
Note that Watson Assistant typically is part of a solution and not a chatbot alone. What is your app that is used as user interface? You could let your app react to a context variable and display the checkbox. Not all user interfaces and integrations may support displaying a checkbox.
Another option is to ask the user to agree to the terms. If they answer "I agree" or "Yes", then the dialog moves forward.

Automated Actions - Mouse Clicks Based on Text Displayed

I am looking for a way to automate mouse clicks based on display text on screen.
The main function is the following:
- When bot detects "Hello!" on screen of Facebook Messenger, it clicks to open conversation. Then it reads the message (messages are always the same) and depending on the messages received it clicks on Saved Replies and sends the correct message.
For example:
Bot detects "hello!" it clicks and opens the conversation. Then bot reads "Amazing Offer 20% off" so it goes to Saved Replies and sends the correct message according to that offer.
*Saved replies is a canned message function that facebook for business messages offers as a function. So basically all I need is a bot that can automate clicks and detect text on screen. It will be run from a PC using Windows.
Any suggestions?
There are three options.
1) Use the Facebook API.
Facebook have spent time and effort to build a system in which developers can interact with their products. Here is a link: https://messengerplatform.fb.com
Options that might be against their policies and will get your account blocked (or worse):
2) Chrome Extension.
Through a Chrome extension, you have the ability to scan the DOM every few seconds and interact with the elements.
This needs to be maintained as Facebook might change element positions, ids or classes. https://developer.chrome.com/extensions/getstarted
3) PhantomJs.
This is a headless browser which you can run and interact with the DOM elements. This also needs to be maintained as the DOM may change at any time.
http://phantomjs.org/page-automation.html