DialogFlow:后续意图自动移出到根级别

DialogFlow: follow-up intent automatically moves out to the root level

我正在使用 DialogFlow 控制台。我的后续意图应该留在子级别的父意图内。但是,它会以某种方式自动移动到根级别。 (见下图)

如何将它移回子级别? DialodFlow 不支持在代理内拖放和移动..

根据 follow-up intents 的文档,后续 Intent 是其关联父 Intent 的子 Intent。

参考文档,我创建了一个简单的聊天机器人,它按预期工作并维护父子层次结构。

您可以参考下面的示例约会 意图层次结构。

回复:

User : book appointment
appointment-followup: today?
User : yes
Appointment-yes-followup : ok we will book it for you this afternoon will that be fine?
User : yes
Appointment-yes-yes-followup : Ok done it will be booked today afternoon


User : book appointment
appointment-followup: today?
User : no
appointment-no-followup : do you want to book tomorrow?
User : yes
Appointment-no-followup : sorry we don't have booking for tomorrow

每当您创建任何后续意图时它都会创建一个输出上下文,该上下文会自动添加到父 Intent 中,并且相同的输入上下文会添加到后续意图中. 更改后续意图的输入上下文不会维护父子层次结构

在我的 Appointment-yes-yes follow-up intent 输入上下文是 Appointment-yes-followup,当我尝试更改输入上下文并在输入上下文中添加我的父意图,即 Appointment,后续意图超出层次结构。

您也可以在 Json 回复中检查同样的内容。

要将后续意图获取到父意图的子级别,您需要在父级后续意图下创建后续意图,因为 dialogflow 不提供拖放和移动选项并且 后续意图的输入上下文必须包含父级后续意图 .

例如 Appointment-yes-yes 应在输入上下文中包含 Appointment-yes followup