1

I have successfully tested the first few intents of my app with my webhook in the DialogFlow console, but testing in the Simulator gives the following error:

UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: ": Cannot find field.".

NB!!! The first thing to notice is that it refers to "API Version 2".

No requests are reaching my webhook - so it appears that this is all within Google.

Using Chrome Developer Tools, I see the Network entry that gets this error response - some details below:

Request url from Simulator: https://assistant.clients6.google.com/v1/assistant:converse?alt=json&key=A.....

NB!!! (Note it says 'v1')

Request Payload:

{"conversationToken":"","debugLevel":1,"inputType":"KEYBOARD","locale":"en-US","mockLocation":{"city":"Mountain View","coordinates":{"latitude":37.421980615353675,"longitude":-122.08419799804688},"formattedAddress":"Googleplex, Mountain View, CA 94043, United States","zipCode":"94043"},"query":"Talk to ","surface":"PHONE"}

Response:

{
    "response": "Connect the docs isn't responding right now. Try again soon.",
    "conversationToken": "GidzaW11bGF0b3JfZGV2aWNlXzM3MTQxRERFM0I0Nzk1Q0ZfMDAwMDA=",
    "audioResponse": "//NExAAR... encoded audio ...",
    "debugInfo": {
        "assistantToAgentDebug": {
            "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=...token...' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: ...authorization key...' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"...user id...\",\"locale\":\"en-US\",\"lastSeen\":\"2017-12-15T17:22:55Z\"},\"conversation\":{\"conversationId\":\"1513778713541\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to Connect The Docs\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'",
            "assistantToAgentJson": "{\"user\":{\"userId\":\"...user id...\",\"locale\":\"en-US\",\"lastSeen\":\"2017-12-15T17:22:55Z\"},\"conversation\":{\"conversationId\":\"1513778713541\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to Connect The Docs\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}"
        },
        "agentToAssistantDebug": {
            "agentToAssistantJson": "{\"message\":\"Unexpected apiai response format: Empty speech response\",\"apiResponse\":{\"id\":\"24ddbf1c-3930-40c6-ba50-03c0935cd1d0\",\"timestamp\":\"2017-12-20T14:05:13.766Z\",\"lang\":\"en-us\",\"result\":{},\"status\":{\"code\":200,\"errorType\":\"success\"},\"sessionId\":\"1513778713541\"}}"
        },
        "sharedDebugInfo": [{
            "name": "ResponseValidation",
            "subDebugEntry": [{
                "name": "UnparseableJsonResponse",
                "debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\"."
            }]
        }]
    },
    "visualResponse": {}
}

I have been informed by Google Support that I am indeed using version V2 - I initiated this in December 2017 - long after the May 2017 "cutoff date" where V2 is supposed to be the default.

Is this a Google bug? Have I missed something setting up my intents? Or is there another setting that may be causing this?

I see that other posts in the DialogFlow forum show the same problem.

Any help is appreciated.

Added on 1/9/2018: Contents of the Debug Tab:

{
  "agentToAssistantDebug": {
    "agentToAssistantJson": {
      "message": "Unexpected apiai response format: Empty speech response",
      "apiResponse": {
        "id": "64a900d2-23e8-4833-b9de-0b207f63bffc",
        "timestamp": "2018-01-08T21:08:36.821Z",
        "lang": "en-us",
        "result": {},
        "status": {
          "code": 200,
          "errorType": "success"
        },
        "sessionId": "1515445716570"
      }
    }
  },
  "assistantToAgentDebug": {
    "assistantToAgentJson": {
      "user": {
        "userId": "ABwppHFGoTJm5fKpau6WWwufKQE5UwkebooowZF7YhvD7PPY-hUfxU2_KRpB0LLNcLPyXasbXnRxXT6fniKk",
        "locale": "en-US",
        "lastSeen": "2018-01-05T15:53:11Z"
      },
      "conversation": {
        "conversationId": "1515445716570",
        "type": "NEW"
      },
      "inputs": [
        {
          "intent": "actions.intent.MAIN",
          "rawInputs": [
            {
              "inputType": "VOICE",
              "query": "talk to connect the docs"
            }
          ]
        }
      ],
      "surface": {
        "capabilities": [
          {
            "name": "actions.capability.AUDIO_OUTPUT"
          },
          {
            "name": "actions.capability.SCREEN_OUTPUT"
          },
          {
            "name": "actions.capability.WEB_BROWSER"
          }
        ]
      },
      "isInSandbox": true,
      "availableSurfaces": [
        {
          "capabilities": [
            {
              "name": "actions.capability.AUDIO_OUTPUT"
            },
            {
              "name": "actions.capability.SCREEN_OUTPUT"
            }
          ]
        }
      ]
    },
    "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=0ffc8bcf72704850a4b4139d49a8d72e' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6IjBhYTQ1NDFlNGM4ZWVhODQ0NjhmZTYxYTkzZmIxYzA2MzJkYjVhMGYifQ.eyJhdWQiOiJhY3RpdmUtZG9jdW1lbnQiLCJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJqdGkiOiIwY2U2OTdlNmE3NGFiZmVmZTdiYzhmMGU2ZGJlMzEyMDFjOWU3MzA5IiwiaWF0IjoxNTE1NDQ1NzE2LCJleHAiOjE1MTU0NDU4MzYsIm5iZiI6MTUxNTQ0NTQxNn0.hZNpVrH4o8ObGIvZ7BQV44nymekTWR_K4_jsDKCzgj74z57IDyUXNGEZs6KUFxBM_2FXiSoOxJUQZ1OhDRpkpQ6L4LELYN_JDhly7kgy-SLgKgLG6FZ4YV-8qOgr9Uxmr9SsG6NSXdiG7HvTrHLXIwA8K2siBNGGDWAIB691gAC8qsjsq4d3VnHMTeqlJ6mDoOtZ2xdLnJbK5B-OK-rLHEhX6K1-Z7rXQL3OgSwUtRVvYfHI3jqY83Xn3-uf06izkQhwVqH-W6X1REltrlxFTPW2h72D-st-QQ9euIpK3fn0x-z3ouQ17g-rGrPjKcOop9FejtKMT1tibxSkQ7qywQ'  -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHFGoTJm5fKpau6WWwufKQE5UwkebooowZF7YhvD7PPY-hUfxU2_KRpB0LLNcLPyXasbXnRxXT6fniKk\",\"locale\":\"en-US\",\"lastSeen\":\"2018-01-05T15:53:11Z\"},\"conversation\":{\"conversationId\":\"1515445716570\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"talk to connect the docs\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'"
  },
  "sharedDebugInfo": [
    {
      "name": "ResponseValidation",
      "subDebugEntry": [
        {
          "debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\".",
          "name": "UnparseableJsonResponse"
        }
      ]
    }
  ]
}

Contents of the Validation Errors Tab: UnparseableJsonResponse API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: ": Cannot find field.".

Screenshot of welcome intent added 1/10/2018: welcome intent screenshot part 1 welcome intent part 2

Colin G
  • 309
  • 3
  • 14
  • Can you also include the contents of the Debug tab? (And if there is a Validation tab, those contents as well?) – Prisoner Jan 09 '18 at 01:12
  • I added the contents of the Debug and Validation Errors as requested. – Colin G Jan 09 '18 at 14:37
  • Very useful! Can you also include a complete screen shot of the Dialogflow Intent you think should be handling this? – Prisoner Jan 09 '18 at 15:26
  • I imagine it's the input_welcome intent - as provided by Google when I initialized DialogFlow and which I have not touched. My fulfillment webhook log shows no access attempts. – Colin G Jan 09 '18 at 19:03
  • 1
    The default welcome intent doesn't attempt to use the webhook, which is part of why I asked to take a look at the whole thing. – Prisoner Jan 09 '18 at 20:15
  • Not sure I understand. I am experiencing this problem when I go to the Simulator and enter or say "Talk to Connect The Docs". What intent should be handling this? Should I modify the default welcome intent in any way? Should I be starting by one of my other intents (which I have tested in the DialogFlow Console)? – Colin G Jan 10 '18 at 14:32
  • I understand this is when you're experiencing the problem. I'm trying to help you debug it, and there are a number of things in the welcome intent that could be causing it. I want to verify them, which is why I asked for a screen shot of all the fields in the welcome intent. I don't want to tell you to change them or repoint your welcome intent until we determine what it is. – Prisoner Jan 10 '18 at 14:45
  • I added the screenshot - in two parts (some overlap around "Default GOOGLE ASSISTANT"). – Colin G Jan 10 '18 at 20:34
  • Excellent. Hope the answer helps. – Prisoner Jan 10 '18 at 20:45

1 Answers1

1

The problem is a combination of two things:

  1. There are no text replies set in the Response section.

  2. When the Intent is triggered, it does not get sent to a webhook.

As a result, Dialogflow replies to the Assistant with no text response, which is an error.

You can correct this by making sure your welcome intent does one of the following (you don't have to do both):

  1. Set one or more text replies. These would be sent back when the Intent is called.

  2. Check the Use webhook box under Fulfillment. This would call your webhook when the Intent is triggered. (And then make sure that your webhook returns a valid response.)

As you speculated in your comments, you could also change the Welcome Intent to one of your other Intents that you've already tested to respond. There is nothing special about this particular Welcome Intent - it was just the one created by default for you.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Marvelous! Thank you for your answer, and also to the time you dedicated to solving my problem. The Simulator does no longer give me that error - I am most grateful. Now if only Google would have emphasized that this is a likely source of error - and made this warning prominent and easy to find, things would go much more quickly. Thank you! – Colin G Jan 11 '18 at 00:15
  • Glad we figured it out! And thanks for sticking with me as we tried to. I know some of my requests seemed odd at the time, but it honestly could have been a lot of things, and we needed to work our way through the options. – Prisoner Jan 11 '18 at 03:06