ticketmaster / actions-on-google-kotlin

Unofficial Actions on Google SDK for Kotlin and Java
Apache License 2.0
119 stars 20 forks source link

Sample DF app not working? #53

Closed davidmarinangeli closed 6 years ago

davidmarinangeli commented 6 years ago

The problem

Hi Patrick, I know you will hate me for all these issues 😛 but I'm experiencing other problems with your sample.

In fact, if I say "list" or "basic card" it doesn't catch the appropriate intent. Furthermore, ANY response tested on Google Assistant simulator gives me error and tells me 'final_response' must be set.

The problems is obviously extended also on my projects: in fact none of the samples copied and paste on my code don't work on Google Assistant simulator.

Some debugging

I've tried to write down manually the same structure of JSON for the response and here is what i found:

Manually built response through Google Assistant tab on Dialogflow

{
   "id":"a0e829f0-1dec-4624-9726-d76e2a6df19d",
   "timestamp":"2018-05-01T14:33:23.67Z",
   "lang":"it",
   "result":{
      "source":"agent",
      "resolvedQuery":"popolare",
      "action":"tell.popular",
      "actionIncomplete":false,
      "parameters":{
         "Filtro":"Popolarità"
      },
      "contexts":[
         {
            "name":"_actions_on_google_",
            "parameters":{
               "Filtro":"Popolarità",
               "Filtro.original":"popolare"
            },
            "lifespan":99
         }
      ],
      "metadata":{
         "intentId":"bb7a2662-2851-4d68-bb86-92d368b6d195",
         "webhookUsed":"false",
         "webhookForSlotFillingUsed":"false",
         "intentName":"choose_popular"
      },
      "fulfillment":{
         "speech":"",
         "messages":[
            {
               "type":"simple_response",
               "platform":"google",
               "textToSpeech":"Hello my friend"
            },
            {
               "type":"suggestion_chips",
               "platform":"google",
               "suggestions":[
                  {
                     "title":"this"
                  },
                  {
                     "title":"or"
                  },
                  {
                     "title":"that"
                  }
               ]
            },
            {
               "type":0,
               "speech":""
            }
         ]
      },
      "score":1
   },
   "status":{
      "code":200,
      "errorType":"success",
      "webhookTimedOut":false
   },
   "sessionId":"adf3ea83-cc0e-410c-b642-28300d81549a"
}

and below you can see response coming from webhook:

{
   "id":"513f3256-2e9c-4c94-93a4-1bfdb408a9b0",
   "timestamp":"2018-05-01T14:34:18.722Z",
   "lang":"it",
   "result":{
      "source":"agent",
      "resolvedQuery":"popolare",
      "action":"tell.popular",
      "actionIncomplete":false,
      "parameters":{
         "Filtro":"Popolarità"
      },
      "contexts":[
         {
            "name":"_actions_on_google_",
            "parameters":{
               "Filtro":"Popolarità",
               "Filtro.original":"popolare"
            },
            "lifespan":100
         }
      ],
      "metadata":{
         "intentId":"bb7a2662-2851-4d68-bb86-92d368b6d195",
         "webhookUsed":"true",
         "webhookForSlotFillingUsed":"false",
         "webhookResponseTime":297,
         "intentName":"choose_popular"
      },
      "fulfillment":{
         "speech":"Hi there from Java!",
         "source":"",
         "messages":[
            {
               "type":0,
               "speech":"Hi there from Java!"
            }
         ],
         "data":{
            "google":{
               "isSsml":false,
               "noInputPrompts":[

               ],
               "expectUserResponse":true,
               "richResponse":{
                  "items":[
                     {
                        "simpleResponse":{
                           "textToSpeech":"Hi there from Java!",
                           "displayText":"Hello there from Java!"
                        }
                     }
                  ],
                  "suggestions":[
                     {
                        "title":"hello"
                     },
                     {
                        "title":"hi"
                     }
                  ]
               }
            }
         }
      },
      "score":1
   },
   "status":{
      "code":200,
      "errorType":"success",
      "webhookTimedOut":false
   },
   "sessionId":"adf3ea83-cc0e-410c-b642-28300d81549a"
}

As you can see, in the fulfillment object is really different for the "messages" and "data" object: what's happening?

patjackson52 commented 6 years ago

Thanks for posting. I will run through the sample at some point. It could possible be broken as it has been awhile since I've used it. As for the 'final_response' missing - that is a warning and is a known issue. Plan is to fix that with the V2 update. It will work with the warning.