简体   繁体   English

如何为不同的意图添加不同的后备意图

[英]How to add different fallback intents for different intents

How to add different fallback intents for different intents? 如何为不同的意图添加不同的后备意图? So that user will see appropriate message instead of common fallback message. 这样,该用户将看到适当的消息,而不是常见的后备消息。

If you are developing your own webhook to handle requests and response, it would be better to use Default Fallback intent for all the intents. 如果您正在开发自己的Webhook来处理请求和响应,则最好对所有意图使用默认回退意图。 Add an output context to each of your individual intents and based on this context you can respond back from the webhook using the single Default Fallback Intent like 将输出上下文添加到您的每个单独的意图中,并且基于此上下文,您可以使用单个默认后备意图从Webhook进行响应,例如

switch(inputContextToDefaultFallback){
  case "context1"...
  case "context2"...
}

But if all your intents are not using webhook, then you can add a fallback intent from the dialogflow by clicking Add follow-up intent --> then selecting fallback like this 但是,如果您所有的意图都没有使用webhook,则可以通过单击添加后续意图->然后选择像这样的fallback从对话框流中添加一个fallback意图。 在此处输入图片说明

在此处输入图片说明

In order to add different Fallback intents for different contexts, you should just follow the steps provided in the documentation to add a new Fallback intent . 为了为不同的上下文添加不同的Fallback intent ,您应该按照文档中提供的步骤添加新的Fallback intent

To do so, go to the three dots more options menu next to the Create intent button in the Intents tab in the Dialogflow UI, and then click on the Create Fallback Intent option. 要做到这一点,去了三个点更多选项菜单旁边的Dialogflow UI的意图标签上的创建目标按钮,然后点击创建后备意向选项。 Once there, you will be able to create a fallback intent, where you need to specify the Input Context (which should be the context under which you want this fallback intent to trigger), and Responses 到达那里后,您将能够创建后备意图,在其中您需要指定输入上下文 (应该是希望该后备意图在其下触发的上下文),以及响应

You can add different Fallback Intents to handle different user replies to what your Action has asked. 您可以添加不同的“后备意图”来处理用户对您的操作要求的答复。 Just like you can add different Intents to specifically handle based things you've asked or said. 就像您可以添加不同的Intent来专门处理您已经问过或说过的事情一样。

The trick in both these cases is to set an Output Context along with with your reply, and then to require this as an Input Context for the regular Intents and Fallback Intents that you wish to be valid in this context. 在这两种情况下,技巧都是设置一个输出上下文以及您的答复,然后将其作为您希望在此上下文中有效的常规Intent和Fallback Intent的Input Context。

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

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