Action在Google上,通过action.intent.NEW_SURFACE进行Webhook响应

时间:2018-08-17 13:57:32

标签: actions-on-google

尝试在Webhook响应中实现NEW_SURFACE(Google Assistant语音调用Dialogflow调用Webhook)。

当我具有网络浏览器功能时,我会显示我的卡,但是当用户来自Google Home时,我该何时将其重定向至手机。

这是我在Google上的操作中的错误:

{
      "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\":\"28ef98e1-caec-4e1f-9a14-8fda597e8a06\",\"timestamp\":\"2018-08-17T12:31:10.735Z\",\"lang\":\"fr-ca\",\"result\":{},\"alternateResult\":{},\"status\":{\"code\":200,\"errorType\":\"success\"},\"sessionId\":\"1534509012113\"}"
            }
          ]
        }
      }
    }

这是我的webhook响应:

{
    "fulfillmentMessages": [],
    "payload": {
        "google": {
            "expectUserResponse": true,
            "expectedInputs": [
                {
                    "inputPrompt": {
                        "richInitialPrompt": {
                            "items": [
                                {
                                    "simpleResponse": {
                                        "textToSpeech": "TEST CHANGE SURFACE"
                                    }
                                }
                            ]
                        }
                    },
                    "possibleIntents": [
                        {
                            "intent": "actions.intent.NEW_SURFACE",
                            "inputValueData": {
                                "@type": "type.googleapis.com/google.actions.v2.NewSurfaceValueSpec",
                                "context": "To show you an image",
                                "notificationTitle": "Check out this image",
                                "capabilities": [
                                    "actions.capability.SCREEN_OUTPUT"
                                ]
                            }
                        }
                    ]
                }
            ]
        }
    },
    "source": "google"
}

需要帮助;-)

0 个答案:

没有答案