Reputation: 1303
This is something that is confusing me. So, I have the following carousel with three items:
//This is my test Carousel
function googleAssistantOther1(agent){
let conv = agent.conv();
conv.ask('Please choose an item');
conv.ask(new Carousel({
title: `All Items`,
items: {
'WorksWithGoogleAssistantItemKey1':{
title: `My Message`,
description: `No description required`,
image:{
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item1`,
},
},
'GoogleHomeItemKey1': {
title: `Test1`,
description: `blah blah`,
image: {
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item2`,
},
},
'SomeRandomKey1':{
title: `Test2`,
description: `blah blah blah`,
image: {
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item3`,
},
},
},
}));
// Add Actions on Goole responses to your agent's response
agent.add(conv);
}
Upvotes: 0
Views: 172
Reputation: 2451
When a list carousel card(or item) is tapped, it generates an event that will hit your webhook, unlike the simple text message.
1st way (if your webhook handling the response)
So you need to handle it in your code.
Generally, it should have intent
as actions_intent_OPTION
. from there you need to segregate it.
2nd way (if your code is not handling the response)
In this way, your intent must be able to handle actions_intent_OPTION
event generated by the carousel(or list).
for that, your intent need to add the event as shown in below image (Basically it tells the dialogflow that whenever the actions_intent_OPTION
events triggered, this intent is capable to handle it, but currently in your case, no intent matches the description and it's going to Default Fallback Intent)
So whenever the list item tapped it can handle the flow.
For more refer this documentation.
Upvotes: 2