首页 > 解决方案 > 如何使用 facebook 循环在 Dialogflow 中制作自定义有效负载,返回到先前的意图?

问题描述

我有一个对话流程设置为使用 Dialogflow 作为聊天机器人工作,当您到达对话结束时,您可以循环回到流程的开头或结束对话。在环回阶段,我们目前在有效载荷中有这个:

{
  "type": "backTo",
  "intent": "hello"
} 

我认为打招呼会触发更早的意图并再次开始流程。

标签: dialogflow-espayload

解决方案


Remember that Intents are based on what the user does. So it doesn't really make sense to say that your code is triggering an earlier Intent.

Instead, just send back a reply indicating you're starting over and don't end the conversation. If appropriate, you can also set the context so an earlier Intent that has this as the Input Context matches.


推荐阅读