简体   繁体   English

如何访问Dialogflow回退意图中的先前对话详细信息

[英]How to access previous conversation details in Dialogflow fallback intent

What would be the best way of accessing the previous conversation details when Dialogflow maps the input to a fallback intent? 当Dialogflow将输入映射到回退意图时,访问先前对话详细信息的最佳方法是什么?

We'd like to steer the user back into the right direction by re-prompting the last suggestion chips that were given. 我们想通过重新提示最后给出的建议筹码来引导用户回到正确的方向。

The way we do it now is by manually saving the last suggestions and manually resetting them if the conversation is progressing to new intent. 我们现在的方式是手动保存最后的建议,并在对话进展到新意图时手动重置它们。 Not optimal and error prone. 不是最佳的,容易出错。

It would be good if all fallback intents contained the "last intent/response" information. 如果所有后备意图包含“最后意图/响应”信息将是好的。

I also can't find the isFallback properety on the DialogflowConversation object in the AoG SDK. 我也无法在AoG SDK中的DialogflowConversation对象上找到isFallback properety。 So we're not able to reliably implement logic in the middleware handler. 所以我们无法在middleware处理程序中可靠地实现逻辑。 The isFallback property would be very useful to have access to on the conversation object in intent handler functions. isFallback属性对于在intent处理函数中访问会话对象非常有用。

Any best practices for reliably setting and resetting a memory of last conversation for usage in case of fallback? 是否有可靠设置和重置最后一次会话记忆的最佳做法,以便在回退的情况下使用?

You can save all your current intent response details in a new output context. 您可以在新的输出上下文中保存所有当前的意图响应详细信息。 Fetch that previous intent response from the previous intent output context and the use that data to create a new response for the fallback intent. 从先前的意图输出上下文中获取先前的意图响应,并使用该数据为回退意图创建新的响应。

how about if you use conv.action or conv.intent to check for your fallback intent? 如果你使用conv.actionconv.intent检查你的后备意图怎么样? You can create a middleware function that stores all the information you need from each conversation in user.data if it is not a fallback intent and use that in your fallback intent handler. 您可以创建一个中间件函数,如果它不是回退意图,则在user.data中存储每个对话所需的所有信息,并在回退意图处理程序中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM