DialogFlow Webhook работает в DF, но не в Google Assistant Simulator - PullRequest
2 голосов
/ 11 мая 2019

Я попытался вернуть ответ по умолчанию, чтобы попытаться заставить это работать. Он размещен на AWS Lambda с шлюзом API. Прошлой ночью у меня работал какой-то другой код, но теперь я не могу заставить работать что-либо через Google Assistant.

Вот пример ответа V2, который я использую:

  callback(null, {
    "payload": {
      "google": {
        "expectUserResponse": true,
        "richResponse": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Choose a item"
              }
            }
          ]
        },
        "systemIntent": {
          "intent": "actions.intent.OPTION",
          "data": {
            "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
            "listSelect": {
              "title": "Hello",
              "items": [
                {
                  "optionInfo": {
                    "key": "first title key"
                  },
                  "description": "first description",
                  "image": {
                    "url": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
                    "accessibilityText": "first alt"
                  },
                  "title": "first title"
                },
                {
                  "optionInfo": {
                    "key": "second"
                  },
                  "description": "second description",
                  "image": {
                    "url": "https://lh3.googleusercontent.com/Nu3a6F80WfixUqf_ec_vgXy_c0-0r4VLJRXjVFF_X_CIilEu8B9fT35qyTEj_PEsKw",
                    "accessibilityText": "second alt"
                  },
                  "title": "second title"
                }
              ]
            }
          }
        }
      }
    }
  });

Вот вывод журнала из Google Assistant в DialogFlow:

Received response from agent with body: HTTP/1.1 200 OK Server: nginx/1.13.6 Date: Sat, 11 May 2019 18:44:24 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 772 X-Cloud-Trace-Context: e62f0526a5238882dd1c1a3b3a70e3b5/11459115340038791606;o=0 Google-Actions-API-Version: 2 Assistant-Interaction-Error-Code: -1 Assistant-Interaction-Error-Message: Failed to parse Dialogflow response into AppResponse because of empty speech response X-SHARD: default Via: 1.1 google Alt-Svc: clear 

{
  "responseMetadata": {
    "status": {
      "code": 10,
      "message": "Failed to parse Dialogflow response into AppResponse because of empty speech response",
      "details": [
        {
          "@type": "type.googleapis.com/google.protobuf.Value",
          "value": "{\"id\":\"99120b53-f0a7-415f-b44e-73c7525fcd43\",\"timestamp\":\"2019-05-11T18:44:24.422Z\",\"lang\":\"en-us\",\"result\":{},\"alternateResult\":{},\"status\":{\"code\":206,\"errorType\":\"partial_content\",\"errorDetails\":\"Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: errorMessage in message google.cloud.dialogflow.v2.WebhookResponse.\"},\"sessionId\":\"ABwppHHok5GTHl8A6XWq9q-Yp1chkoZ4vT688i4HTxVgVQDcY1zHH2JUqVeCMPc_6bbA7WFf1e-nw0ZQxQ\"}"
        }
      ]
    }
  }
}

Я не уверен, куда идти отсюда ... Кажется, все работает правильно, я просто не могу понять, где ошибка парсера с Google Assistant. Что дает?

Спасибо.

* +1012 *Here's proof that the Lambda works using my request
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...