简体   繁体   中英

Dialogflow Intent won't pick up Carousel Card response

I'm currently testing dialogflow to get to know it a bit more.

Within Google Dialogflow, I have created 2 Carousel cards, named "City" and "Country". The item titles also have "City" and "Country". I also created 2 Intents named "_City" and _Country. Intent "_City" contains the name "City" as a Training phrases (without any Action and Parameter). Intent "_Country" contains the "Country" as a Training phrases.

If I test the flow on Google Assistant (on actions.google.com or the Google Assistant app on my smart devices), I touched the City Carousel Card and it responds with "City".

I expected that the Intent "_City" with pick this up, but instead, Google Assistant response with "I do not understand". The same with the "Country" card.

Does somebody know how an Intent will pick up the response of a Carousel card?

If I use a basic card and add some Suggestion Chips, Google Assistant will pick up the response and the Intent will handle it correct.

A carousel response behaves slightly different from other responses. It is not going to be the same as text. Rather, you need to handle the actions_intent_OPTION event in Dialogflow and pass that to your fulfillment.

app.intent('Carousel - OPTION', (conv, params, option) => {
  const SELECTED_ITEM_RESPONSES = {
    'SELECTION_KEY_ONE': 'You selected the first item',
    'SELECTION_KEY_GOOGLE_HOME': 'You selected the Google Home!',
    'SELECTION_KEY_GOOGLE_PIXEL': 'You selected the Google Pixel!',
  };
  conv.ask(SELECTED_ITEM_RESPONSES[option]);
  conv.ask('Which response would you like to see next?');
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM