Получите ошибку после нажатия на карусель - PullRequest
1 голос
/ 29 апреля 2020

У нас есть действие, запущенное в производство. Он только что начал возвращать ошибку после попытки щелкнуть или вызвать элемент из карусели.

Шаги для воспроизведения следующие:

  1. Talk to Action
  2. Прекрасно загружается Carosel
  3. Вызов любого элемента в Карусели с помощью щелчка или голоса
  4. получить ошибку

Извините, {action} не отвечает в данный момент. Пожалуйста, попробуйте позже.

Вот фрагмент того, как он строится.

В журналах стековых драйверов ничего не сообщается как ошибка

  /**
   * @description Build the Carousel
   * @private
   * @static
   * @param {CardListItem[]} listItems - Array of CardListItem to transform
   * @returns {Carousel}
   * Returns a Carousel
   * @memberof TemplateBuilder
   */
  private static getCarousel(listItems: CardListItem[]): Carousel {
    const items = [] as GoogleActionsV2UiElementsCarouselSelectCarouselItem[];
    listItems = this.sortListTemplateListItemsByGoogleIndexAscending(listItems);
    for (const listItem of listItems) {
      if (listItem.googleIndex) {
        items.push(this.getCarouselItem(listItem));
      }
    }
    return new Carousel({
      items,
      display: 'DEFAULT',
    });
  }

  /**
   * @description Build a CarouselItem
   * @private
   * @static
   * @param {CardListItem} data - Template data of type ListTemplateData
   * @returns {GoogleActionsV2UiElementsCarouselSelectCarouselItem}
   * Returns a Carousel Item
   * @memberof TemplateBuilder
   */
  private static getCarouselItem(data: CardListItem): GoogleActionsV2UiElementsCarouselSelectCarouselItem {
    const title = data.textContent ? this.convertToPlainText(data.textContent) : null;
    const imageUrl = typeof data.image === 'string' ? data.image : data.image.imageUrl;
    return {
      optionInfo: {
        key: data.intentHandler || data.token,
        synonyms: [],
      } as GoogleActionsV2OptionInfo,
      image: new Image({
        url: this.getImageURL(imageUrl),
        alt: title,
        height: null,
        width: null,
      }),
      title,
    } as GoogleActionsV2UiElementsCarouselSelectCarouselItem;
  }

Ответ от веб-хука

{
    "payload": {
      "google": {
        "expectUserResponse": true,
        "systemIntent": {
          "intent": "actions.intent.OPTION",
          "data": {
            "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
            "carouselSelect": {
              "items": [
                {
                  "optionInfo": {
                    "key": "AccountBalanceIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-account.jpg",
                    "accessibilityText": "Account Balance",
                    "height": null,
                    "width": null
                  },
                  "title": "Account Balance"
                },
                {
                  "optionInfo": {
                    "key": "UsageCostIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-usage.jpg",
                    "accessibilityText": "Energy Usage",
                    "height": null,
                    "width": null
                  },
                  "title": "Energy Usage"
                },
                {
                  "optionInfo": {
                    "key": "BillAmountIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-bill.jpg",
                    "accessibilityText": "Bill History",
                    "height": null,
                    "width": null
                  },
                  "title": "Bill History"
                },
                {
                  "optionInfo": {
                    "key": "EnergyInsightsIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-insights.jpg",
                    "accessibilityText": "Energy Insights",
                    "height": null,
                    "width": null
                  },
                  "title": "Energy Insights"
                },
                {
                  "optionInfo": {
                    "key": "BillDueDateIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-bill-due-date.jpg",
                    "accessibilityText": "Bill Due Date",
                    "height": null,
                    "width": null
                  },
                  "title": "Bill Due Date"
                },
                {
                  "optionInfo": {
                    "key": "EnergyAlertIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-alert.jpg",
                    "accessibilityText": "Energy Alert",
                    "height": null,
                    "width": null
                  },
                  "title": "Energy Alert"
                },
                {
                  "optionInfo": {
                    "key": "EnergyTipIntent",
                    "synonyms": []
                  },
                  "image": {
                    "url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-tip.jpg",
                    "accessibilityText": "Energy Tip",
                    "height": null,
                    "width": null
                  },
                  "title": "Energy Tip"
                }
              ],
              "imageDisplayOptions": "DEFAULT"
            }
          }
        },
        "richResponse": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "<speak>Hi Brent,<break time=\"200ms\"/> welcome to <say-as interpret-as=\"spell-out\">AGL</say-as>.<break time=\"400ms\"/> With our latest update,<break time=\"200ms\"/> you can now set up Energy Alerts.<break time=\"300ms\"/> For other ways that I can help,<break time=\"200ms\"/> say \"more information\".<break time=\"350ms\"/> How can I help you today?</speak>",
                "displayText": "Hi Brent, welcome to AGL. With our latest update, you can now set up Energy Alerts. For other ways that I can help, say \"more information\". How can I help you today?"
              }
            }
          ],
          "suggestions": [
            {
              "title": "Monthly Billing"
            },
            {
              "title": "eBilling"
            },
            {
              "title": "Payment Extension"
            },
            {
              "title": "Feedback"
            },
            {
              "title": "Help"
            }
          ]
        }
      }
    },
    "outputContexts": [
      {
        "name": "projects/agl-prod-603de/agent/sessions/ABwppHESxXC8wRCVt2-hskWfsZwxEoH54G6jm_yTj2oIiETa1V3EbgRGj86H7Ys5bEKG0YrzkL0fE9Mpnhk/contexts/_actions_on_google",
        "lifespanCount": 99,
        "parameters": {
          "data": "{\"sessionLaunched\":true,\"skippedIntents\":[],\"possibleIntents\":[],\"followUp\":{\"yes\":{\"data\":null,\"intent\":\"Unhandled\"},\"no\":{\"data\":null,\"intent\":\"Unhandled\"},\"fuelType\":{\"elec\":{\"data\":null,\"intent\":\"Unhandled\"},\"gas\":{\"data\":null,\"intent\":\"Unhandled\"},\"both\":{\"data\":null,\"intent\":\"Unhandled\"}},\"number\":{\"data\":null,\"intent\":\"Unhandled\",\"slotName\":null},\"period\":{\"data\":null,\"intent\":\"Unhandled\",\"slotName\":null}},\"lastIntent\":\"LaunchRequest\"}"
        }
      }
    ]
  }

поток в симуляторе touch event hander dialogflow

...