1

I have a set of intents that can be triggered.

  • turn light on
  • turn light off
  • close door
  • open door

For every intent I have a set of followup intents, e.g.

  • turn light on
    • select light source (input context light-on-followup)
    • select light source fallback (input context light-on-followup)

I want to make sure that if the user has triggered turn light on intent, and I am asking him which light source do you want to turn on? he can either trigger select light source or if the utterance doesn't match that the fallback intent is triggered.

The problem that I am facing: if the user says turn light off while being in the turn light on dialog, the fallback intent is not triggered but the user triggers the higher order intent turn light off instead. I want to prevent that this can happen. Is there a way to do this?

I am using the input context for the fallback intent but apparently a high confidence level in a higher order intent leads Dialogflow to trigger the higher order intent instead.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
Andre
  • 4,185
  • 5
  • 22
  • 32

1 Answers1

2

First of all - are you sure you want this?

Imagine the following scenario:

User:  Turn the light on
Agent: Which light do you want to turn on?
User:  Oh, no, I meant turn it off

This is not an unusual conversation that might take place. If the user changes their mind, or realizes they meant something else, they should be able to do so. A good VUI design principle is that the user can take the conversation in any direction at any time, and you should allow them to do so as much as possible.

Dialogflow is set to work this way intentionally by trying to find matches that make the most sense in the overall context, rather than forcing users down a narrow path by default.

However, if you really wanted to do what you ask, you might try something such as this:

  • Setup an Input Context (let's call it root for this example) for all of the root level Intents that you expect the user today
  • When a root-level Intent is recognized, have its Output Context set root to a lifespan of 0, meaning none of them would match.
  • For the Output Context of any of the Followup Intents, set the root Context again, so only the root-level Intents may be recognized.
Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Thanks for the heads-up. I totally understand where you are coming from. Maybe my picked example was to generic but let's say you are inside a more important dialog. e.g. setting up and repeating your pin. In all other dialogs you want to be able to change back to top level intents but in this specific one it should not be allowed, e.g. only cancel can stop the conversation. I guess I will try to check the current context in my fulfillment endpoint and redirect to another intent manually. But I might actually just follow your guideline instead! Thanks! – Andre Jan 31 '20 at 19:40