samtecspg / articulate

A platform for building conversational interfaces with intelligent agents (chatbots)
http://spg.ai/projects/articulate/
Apache License 2.0
599 stars 159 forks source link

Dynamic buttons from webhook requests #964

Closed ravenous closed 4 years ago

ravenous commented 4 years ago

Feature Request

Create dynamic buttons and response values from webhook requests for quick response

split2

wrathagom commented 4 years ago

@Ravenous this functionality is available on master (recently committed) and will be added to a release shortly.

wrathagom commented 4 years ago

@dakavisa is going to try and build an example.

dakavisa commented 4 years ago

@Ravenous , With the new quick responses for action responses functionality, you can use Webhook responses to create quick responses, I attached a simple bot example that uses a country info API to display quick responses:

Action-Quick-Repsonses Response Example

CountriesBot.json.zip

rounakraj commented 4 years ago

@dakavisa @wrathagom Can we create buttons in action response? If yes how do we do that?

dakavisa commented 4 years ago

@rounakraj wit the latest code in master you can set quick responses for action responses in the action response tab

rounakraj commented 4 years ago

@dakavisa Thanks i will try in master..

rounakraj commented 4 years ago

@dakavisa Thanks i could verify the feature on master branch. However i have few queries. Attached my quick response and chat flow.

Screenshot 2019-12-09 at 7 17 35 PM Screenshot 2019-12-09 at 7 17 28 PM

In the above cases i am using handlebars to update the button based on slot condition. I only want to show buttons if slot value is null and not when slot value is there. How to handle the else parts to not show buttons when slot value is there. Currently it shows empty buttons.

dakavisa commented 4 years ago

@rounakraj yeah we are aware of that issue of the blank buttons, we have a fix already and will release it soon so any blanks or handlebar errors will be ignored, so for now please ignore the blank buttons. As for what you are trying to accomplish, I think a better way to show buttons when the slot is empty is to mark it as required, so you can ask directly to the user to fill it and enter button values for the options. You can also set a limit prompt number so your agent will ask n times for the slot value. And finally, If you still want to check if the slot is not set, the following handlebar syntax worked for me: {{#if (not slots.zWaveDevice.value)}} Bulb {{/if}}

rounakraj commented 4 years ago

@dakavisa Thanks for the reply. I understand marking as required is the solution but this is a backup which I have tried since marking as required is giving issue of double response already described in https://github.com/samtecspg/articulate/issues/967. #967 I have attached my test agent with exact reproduction in https://github.com/samtecspg/articulate/issues/967#issuecomment-562933364. Did you get a chance to look at it?

dakavisa commented 4 years ago

@rounakraj Yeah we are already looking into the double response issue, we will get back at you when we get a resolution

rounakraj commented 4 years ago

@dakavisa thanks

rounakraj commented 4 years ago

@dakavisa When using the chatbot agent from Slack Channel , the click on buttons have no effect. The data is not passed on to articulate. It displays the button and i am able to click it but there is no event going to articulate. Am i missing something?

wrathagom commented 4 years ago

Please create a new issue.

dakavisa commented 4 years ago

Closing blank buttons handlebars issue with f227dc7f315466ac4ee961e6c27d6a872c21e947