Dialogflow API V2 “End of conversation” flag in webhook request

梦想的初衷 提交于 2019-12-14 01:51:26

问题


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

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?


回答1:


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
    },
    ...
  },
  ...
}



回答2:


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.



来源:https://stackoverflow.com/questions/50516103/dialogflow-api-v2-end-of-conversation-flag-in-webhook-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!