Nlu fallback within stories

Hi,

I am working on a chatbot project and I was wondering if it’s possible to add nlu_fallback intent to the story so that the fallback behaves differently under different scenario. Or does it make more sense to do so with a customized action? The tricky thing about writing it as a customized action is that I won’t be able to know in which context(story scenario) the bot is currently in.

The stories would be like the following:

- story: storyA
  steps:
  - intent: functionA
  - action: utter_options
  - intent: nlu_fallback
  - action: provide_guidance for functionA
- story: storyB
  steps:
  - intent: functionB
  - action: utter_options
  - intent: nlu_fallback
  - action: provide_guidance for functionB

You could override action_default_fallback and review the previous intents. There’s an example here.

1 Like

My best guess: use the nlu_fallback intent in the story steps, as you have described. You can use the provide_guidance action to provide different guidance to the user depending on the context of the story. You can determine the context by checking the current active story in the action code, for example by accessing the tracker.active_story.name attribute