Avision
Avision

Reputation: 3703

Dialogflow - responding to Actions on Google events

I'm building an action for AoG using Dialogflow, using node.js as the fulfillment webhook.

I use suggestions and carousels in my app and want to respond to when a user clicks. My current implementation uses dialoglow's fallback, and then I check the payload manually for rawInputs.inputType="TOUCH" for suggestions and intputs.intent=actions.intent.OPTION for carousels. I'm looking for a more elegant way to do so with dialogflow and the webhook.

Does anyone know if there's a way to either:

  1. Detect a carousel selection event in Dialogflow that can later be used as intent
  2. A built-in method in the node.js webhook to catch this event.

Upvotes: 4

Views: 374

Answers (1)

Prisoner
Prisoner

Reputation: 50701

Suggestion chips cannot be detected through Dialogflow directly - they are treated just like the user said or typed the chip that was selected.

However, you can detect that a carousel option has been selected. You can't determine which carousel item is selected in Dialogflow, you need to do that in your fulfillment webhook.

You can create an Intent which does not have any training phrases set, but which will trigger on an Event named actions_intent_OPTION (based on the native Intent name, but with the periods replaced by an underscore).

enter image description here

Upvotes: 5

Related Questions