Google Assistant иногда возвращает ACTION, а иногда TEXT - PullRequest
0 голосов
/ 07 мая 2020

Я впервые задаю вопрос, не связанный с кодом, поэтому, если он неправильный / его нужно изменить, дайте мне знать ...
Я создаю список с продуктами:

  1. EY7546X шлакохромная машина | zonder accu's en lader
  2. BDF343RHE Буровая / прочная машина | 14,4v 1,3Ah Li-ion
{
  "payload": {
    "google": {
      "expectUserResponse": true,
      "systemIntent": {
        "intent": "actions.intent.OPTION",
        "data": {
          "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
          "carouselSelect": {
            "items": [
              {
                "description": "€192.00",
                "image": {
                  "accessibilityText": "productImage",
                  "url": "http://example.com/foo.jpg"
                },
                "title": "EY7546X slagschroefmachine | zonder accu's en lader",
                "optionInfo": {
                  "key": "596"
                }
              },
              {
                "description": "€195.30",
                "image": {
                  "accessibilityText": "productImage",
                  "url": "http://example.com/bar.jpg"
                },
                "title": "BDF343RHE Boor-/schroefmachine | 14,4v 1.3Ah Li-ion",
                "optionInfo": {
                  "key": "691"
                }
              },
            ]
          }
        }
      },
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "de volgende producten:"
            }
          }
        ]
      }
    }
  },

Когда я выполняю код, номер 1 вызывает actions.intent.TEXT:

"inputs": [
    {
      "intent": "actions.intent.TEXT",
      "rawInputs": [
        {
          "inputType": "VOICE",
          "query": "EY7546X slagschroefmachine | zonder accu's en lader"
        }
      ],
      "arguments": [
        {
          "name": "text",
          "rawText": "EY7546X slagschroefmachine | zonder accu's en lader",
          "textValue": "EY7546X slagschroefmachine | zonder accu's en lader"
        }
      ]
    }
]

И при нажатии на номер 2 он возвращает action.intent.OPTION:

"inputs": [
    {
      "intent": "actions.intent.OPTION",
      "rawInputs": [
        {
          "inputType": "VOICE",
          "query": "BDF343RHE Boor-/schroefmachine | 14,4v 1.3Ah Li-ion"
        }
      ],
      "arguments": [
        {
          "name": "OPTION",
          "textValue": "691"
        },
        {
          "name": "text",
          "rawText": "BDF343RHE Boor-/schroefmachine | 14,4v 1.3Ah Li-ion",
          "textValue": "BDF343RHE Boor-/schroefmachine | 14,4v 1.3Ah Li-ion"
        }
      ]
    }
  ],

Есть ли способы всегда вернуть OPTION? Или есть ограничения на заголовок, о котором я не знаю?

...