I'm using Watson conversation to do a messenger chatbot, and i need something like that
[![inserir a descrição da imagem aqui][1]][1]
I'm using Watson conversation to do a messenger chatbot, and i need something like that
[![inserir a descrição da imagem aqui][1]][1]
Watson Conversation API does not have built-in UI tools to create the type of buttons or options that you want in a response.
In order to achieve that, what you need to do is send back a flag or variable in your context object inside Watson Conversation's response. Then, in your frontend code you can test that variable and programmatically decide if you need to display certain HTML components like buttons, options, etc.
Watson's response in your dialog node should look something like this:
And then in your code, you should check inside the context. If the
showOptions
property istrue
, then, while displaying the answer to the user's input you could add the options that you need (Yes, No, I don't know).In your case, you don't even need to display the
output.text.values[0]
, just the options.Remember to turn the
showOptions
variable back to null in another dialog or your code will always display the options, even when you don't need to.