呈现来自 Intent 的响应后,如何在对话结束时在 DialogFlow 中询问 "Was this helpful?"

How to ask "Was this helpful?" in DialogFlow at the end of conversation after rendering the response from Intent

所以我准备了一个流程

我已经尝试触发 followupEvent,但在意图链完成之前不会显示任何响应。

When the followupEventInput parameter is set for a WebhookResponse, Dialogflow ignores the fulfillmentText, fulfillmentMessages, and payload fields. When Dialogflow receives a webhook response that includes an event, it immediately triggers the corresponding intent in which it was defined.

我已准备好响应“是”和“否”的最终意图。但在触发它时需要帮助。

意图不应用作流程中的一个步骤或与单个响应相关联,它旨在表示您的用户为完成对话中的特定目标可能会说的一类短语。由于 was this helpful 不是由任何用户短语触发,而是更多地作为用户继续对话的触发器表明它不应该是一个单独的意图。

was this helpful 短语可用于多个意图是一个不错的选择,因此它可以在整个对话中使用,但我建议将此短语保存在文件中,API 或CMS 并通过代码检索响应。

我不是 PHP 开发人员,但我希望它符合:responseService.getResponse("requestFeedbackPrompt");

这允许您在整个代码中检索 was this helpful 短语,而不会错误地为其创建单独的意图,因为这会在以后保持状态时产生问题。

如果您决定为此采用单一意图,您很快就会发现很难跟踪 context、状态以及您作为多个意图进行的对话步骤将通过此通用意图。

如果您需要 was this helpful 响应的不同变体,您会怎么做?对于单一意图,您最终会为每个变体创建一个意图,并且您必须调整对话流程和状态每次都相应地。

如果您使用该服务,您只需调用 responseService.getResponse("OtherFeedbackPrompt);`