actions-on-google / actions-on-google-nodejs

Node.js client library for Actions on Google
https://actions-on-google.github.io/actions-on-google-nodejs
Apache License 2.0
900 stars 197 forks source link

queryText being sent to Dialogflow is not the original user query #419

Closed jonny-ms closed 3 years ago

jonny-ms commented 3 years ago

The user input / queryText being sent to Dialogflow is not the expected, original user query.

image

I then enabled "Log interactions to Google Cloud" in my Dialogflow project's settings. What I'm seeing is multiple request/response interactions before the actual request that goes to DF. In the example above, this is what I see:

image

With the first debug resource showing post data with:

"inputs":[{"rawInputs":[{"inputType":"UNSPECIFIED_INPUT_TYPE","query":"how long has it been on the market"}]

And

resource: {
type: "assistant_action"
  labels: {
    project_id: "<MY-PROJECT-ID>"
    version_id: ""
    action_id: ""
  }
},
timestamp: "2021-03-05T18:41:44.142202856Z"
severity: "DEBUG"
labels: {
  channel: "production"
  querystream: "GOOGLE_USER"
  source: "AOG_REQUEST_RESPONSE"
}

The subsequent requests are the same but with modified input queries ("how long has it been on the market" -> "how long has something been on the market" -> "how long has us FDA been on the market"), the last one being the actual user query sent, the channel being preview and the action_id "actions.intent.TEXT".

resource: {
type: "assistant_action"
  labels: {
    project_id: "<MY-PROJECT-ID>"
    version_id: ""
    action_id: "actions.intent.TEXT"
  }
},
timestamp: "2021-03-05T18:41:45.942019959Z"
severity: "DEBUG"
labels: {
  channel: "preview"
  querystream: "GOOGLE_USER"
  source: "AOG_REQUEST_RESPONSE"
}

I should note that I am testing current drafts of an AoG project and have no releases let alone a production release. I have a denied beta, because of branding issues which I address with separate AoG/DF projects for PROD. I do not have any intents enabled for slot filling or any required entity parameters. And I have been noticing this on many occasions when getting unexpected fallbacks.

What are all these requests/responses happening before DF Fulfillment? Why is the query being changed?

Fleker commented 3 years ago

Your issue is that when you the explicit query with it, the it is replaced with us FDA?

jonny-ms commented 3 years ago

Hi @Fleker , thanks for your comment.

Yes, so this is happening with many different utterances. The above kind of looks like a slot filling (which is not enabled in my DF agent). But I am also getting instances where I the sentence changes structure (eg. user says "can this be used in renal impairment", AoG sends "drug uses in renal impairment"). Can it be from some speechBiasingHints? Though I've never tinkered with that...

This may be the wrong forum for this issue. The problem seems to be a query manipulation that happens before the Dialogflow request. But if anyone has experienced this before or can advise on where to reach support, any help would be much appreciated.

jonny-ms commented 3 years ago

aog_entity_resolution_lorem

To me, this is pretty clear evidence that Actions on Google is attempting entity resolution, before sending data to DF. How can I disable this?

jonny-ms commented 3 years ago

Closing this issue.

After having contacted someone at Google Cloud, I was informed this was something that had been raised by others and that AoG devs were looking into it.

As of a Mar 24 2021 release, I can no longer replicate the issue.