Как сделать так, чтобы Google DialogFlow Carousel работал - PullRequest
0 голосов
/ 25 июня 2019

Я хочу использовать карусель в качестве ответа от помощника. К сожалению, это не работает, и агент отключается. Должны отображаться некоторые элементы списка, такие как https://developers.google.com/actions/assistant/responses.

Я использую следующий код:

if (!conv.screen) {
  conv.ask('Sorry, try this on a screen device or select the ' +
    'phone surface in the simulator.');
  return;
}

conv.ask('This is a browse carousel example.');
// Create a browse carousel
conv.ask(new BrowseCarousel({
  items: [
    new BrowseCarouselItem({
      title: 'Title of item 1',
      url: 'google.com',
      description: 'Description of item 1',
      image: new Image({
        url: 'IMG_URL.com',
        alt: 'Image alternate text',
      }),
      footer: 'Item 1 footer',
    }),
    new BrowseCarouselItem({
      title: 'Google Assistant',
      url: 'google.com',
      description: 'Google Assistant on Android and iOS',
      image: new Image({
        url: 'IMG_URL_Assistant.com',
        alt: 'Image alternate text',
      }),
      footer: 'More information about the Google Assistant',
    }),
  ],
}));
...