Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialogflow API V2 "End of conversation" flag in webhook request

I am migrating a Dialogflow agent to API V2, and I am having an issue related to the "Set this intent as end of conversation" option

enter image description here

My fulfillment webhook relies on the "endConversation": true property of the V1 webhook request's metadata to perform custom platform logic.

Is there any way I can expose this same property in Dialogflow V2 without using a custom payload?

like image 795
Mike Avatar asked May 24 '18 18:05

Mike


2 Answers

You can look at the queryResult.diagnosticInfo.end_conversation field in Dialogflow's v2 webhook requests the form of which you can see below:

{
  "queryResult": {
    "diagnosticInfo": {
      "end_conversation": true
    },
    ...
  },
  ...
}
like image 200
matthewayne Avatar answered Sep 29 '22 01:09

matthewayne


Curiously, this is stored at the agent level. If you export an agent, you'll notice an endIntentIds key in the agent.json file, which is an array of IDs of the intents that have this flag set.

I'm not sure why this isn't stored on the intent. Since you have to fully export the agent via the v2 API in order to see agent-level settings, you'll have to do that and then unzip the file in order to determine whether or not this flag is set on an intent.

UPDATE

It turns out that this information is accessible via inbound webhook fulfillment requests. Check out matthewwayne's answer.

like image 31
techpeace Avatar answered Sep 29 '22 01:09

techpeace