在代码实验室中,模拟器不会“交谈”:Google助手的构建操作(第1级)

时间:2018-06-28 19:48:16

标签: actions-on-google dialogflow

如果我遵循此code lab的说明进行操作,直到步骤4底部的“调试您的操作”,就会得到下图所示的怪异行为。有人知道为什么吗?请注意,显示屏上显示了一个问题,但是音频从不播放(向左看,以查看没有声音)。我现在已经两次重现了,一次是昨天一次,一次是今天一次(每次都按照代码实验室的说明从头开始重新创建整个项目)。这似乎只是“电话”表面的错误。切换到扬声器或智能显示可以解决该问题。

enter image description here

以下是“响应”选项卡的内容:

    {
  "conversationToken": "[]",
  "finalResponse": {
    "richResponse": {
      "items": [
        {
          "simpleResponse": {
            "textToSpeech": "Welcome! What is your favorite color?"
          }
        }
      ]
    }
  },
  "responseMetadata": {
    "status": {
      "message": "Success (200)"
    },
    "queryMatchInfo": {
      "queryMatched": true,
      "intent": "44a0a46f-b4e3-4985-a7ea-59bb90ef3bb9"
    }
  }
}

以及“调试”标签:

    {
  "response": "Alright. Getting the test version of my test app.",
  "expectUserResponse": false,
  "conversationToken": "GidzaW11bG...",
  "audioResponse": "//NExAARiC...",
  "debugInfo": {
    "assistantToAgentDebug": {
      "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=c37cbcc968134768a12a05cdbfb8459c' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6IjRlZjUxMThiMDgwMGJkNjBhNDE5NDE4NmRjYjUzOGZjNjZlNWViMzQifQ.eyJhdWQiOiJhY3Rpb25zLWNvZGVsYWIzLWRlOWNkIiwiZXhwIjoxNTMwMjE0OTk5LCJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJqdGkiOiJmODgwZjZiMmQxZDQyYjMxODc4Nzg2YjY4MjI3Y2U3MzhhYTE5MGFlIiwiaWF0IjoxNTMwMjE0ODc5LCJuYmYiOjE1MzAyMTQ1Nzl9.A6oNz2UWwaBN8ARTAFNRXr-hWYEVChQVI-iUCCVX0xLFZTRm8Ns5b5XvC-_aLg4yLJmf2LuSJj1hKua1QLjzzMt_ifHNqwOTASk_3fUumCdItNivqljPahUdonEOq5uUPORIuvzzLb11kD67sEnSadHydv1vCE4MNLxCRDLQvYDoWwd3TIk2TkRpnbbjve4uOPpp7q9_8NPwek4AypNj73peSzB0bTKaSKlCUTtUf4EGKO5siGpDeOgxo4W4L98FXkwvQGfzyPv_KF24S4dzkn0bpnVSqTemA8nmEGNrmnDYyikmfQ1LZnq9vpWwtBkIcNFMCNdz94CAta9Eotk8Kw'  -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHFP1TkMd6vXAW26cxs7CBqCuZCoFXlPyocAtISGTpGDkJ1gPSlh1ALbe64yGW7Qs_X6IPoKrS952cuMhKrJisLTSA\",\"locale\":\"en-US\",\"lastSeen\":\"2018-06-28T19:35:56Z\"},\"conversation\":{\"conversationId\":\"1530214879800\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to my test app\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]}],\"requestType\":\"SIMULATOR\"}'",
      "assistantToAgentJson": "{\"user\":{\"userId\":\"ABwppHFP1TkMd6vXAW26cxs7CBqCuZCoFXlPyocAtISGTpGDkJ1gPSlh1ALbe64yGW7Qs_X6IPoKrS952cuMhKrJisLTSA\",\"locale\":\"en-US\",\"lastSeen\":\"2018-06-28T19:35:56Z\"},\"conversation\":{\"conversationId\":\"1530214879800\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to my test app\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]}],\"requestType\":\"SIMULATOR\"}"
    },
    "agentToAssistantDebug": {
      "agentToAssistantJson": "{\"conversationToken\":\"[]\",\"finalResponse\":{\"richResponse\":{\"items\":[{\"simpleResponse\":{\"textToSpeech\":\"Welcome! What is your favorite color?\"}}]}},\"responseMetadata\":{\"status\":{\"message\":\"Success (200)\"},\"queryMatchInfo\":{\"queryMatched\":true,\"intent\":\"44a0a46f-b4e3-4985-a7ea-59bb90ef3bb9\"}}}"
    },
    "sharedDebugInfoList": []
  },
  "visualResponse": {
    "visualElementsList": [
      {
        "displayText": {
          "content": "Welcome! What is your favorite color?"
        }
      }
    ],
    "suggestionsList": [],
    "agentLogoUrl": "https://www.gstatic.com/voice/opa/partner_icons/generic_3p_avatar.png",
    "agentStyle": {
      "primaryColor": "",
      "fontFamily": "",
      "borderRadius": 0,
      "backgroundColor": "",
      "backgroundImageUrl": ""
    }
  },
  "clientError": 0,
  "is3pResponse": 1
}

最后这是我的意图,您可以在URL栏中看到具有ID的ID,该ID表示匹配的意图。

我不知道为什么会这样。感谢您的输入。

1 个答案:

答案 0 :(得分:0)

更新的答案:

今天通过模拟器体验将模拟器与手机表面一起使用时,似乎与5月初在代码实验室截取的屏幕截图不一致(您可以在此处看到日期)。

切换到另一个表面将使模拟器向您发出响应。但是,您可能已经注意到,模拟器的“显示”部分具有正确的响应。过去已经制定了行动,但我认为您在学习如何制定良好行动方面没有问题。

旧答案:

请取消选择“默认欢迎意图”切换为“将此意图设置为对话结束”。它位于Dialogflow控制台中意图UI的“ Responses”部分下。

通常,您只想将意图通过操作结束对话的状态打开此开关。