问题
If I follow the instructions for this code lab up until "Debug your Action" at the bottom of step 4, I get the bizarre behavior pictured below. Does anyone know why? Note that the display shows a question, but the audio never plays (look on left to see it's absence). I have reproduced this twice now, once yesterday and again today (re-creating the entire project from scratch following the code lab instructions, each time). This appears to be a bug in the "phone" surface only. Switching to Speaker or Smart Display resolves the problem.
Here is the content of the Response tab:
{
"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"
}
}
}
And the Debug tab:
{
"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
}
Finally here is my intent, which you can see has the id (in url bar) that shows it is the intent that is matched.
I can't figure out why this might be happening. Thanks for any input.
回答1:
Updated answer:
There seems to be an inconsistency when using simulator with the phone surface using the simulator experience today vs. the screenshot at the codelab which was taken in beginning of May (you can see the date there).
Switching to a different surface will make the simulator pronounce the response to you. However, as you probably noticed, the "display" section of a simulator has correct response. Having developed actions in the past, I don't think you have a problem as far learning how to develop good actions.
Old answer:
Please unselect "Set this intent as end of conversation" toggle for your "Default Welcome Intent". It is located under "Responses" section of the intent's UI in Dialogflow console.
In general, you would want to have this toggle on only for intents that will end the conversation with your action.
来源:https://stackoverflow.com/questions/51090316/simulator-not-talking-in-code-lab-build-actions-for-the-google-assistant-lev