How to add different fallback intents for different intents

痞子三分冷 提交于 2021-02-10 12:43:00

问题


How to add different fallback intents for different intents? So that user will see appropriate message instead of common fallback message.


回答1:


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. 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

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




回答2:


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.

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. 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




回答3:


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.

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.



来源:https://stackoverflow.com/questions/51317450/how-to-add-different-fallback-intents-for-different-intents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!