There are many circumstances in which a simple "follow up" specification is not quite accomplishing what the user is trying to capture, and enhancements can be made to accomplish this.
Suppose in a restaurant ordering bot we have a slot_fill
action get_order
which extracts three entities from the user; pizza
, drink
, and side
. We want to ensure that get_order
is the next action run after the bot's initial greeting greet
, so we specify follow_up: get_order
as necessary in the YAML.
Now, get_order
will follow up greet
as specified. But what if the action is only able to extract pizza
, and with an unsure confidence at that? Although the relevant clarify
and slot_fill
actions have been generated, there's currently no way to specify that all three entities will be extracted before the bot moves on to anything else. This sometimes lead to awkward conversations where the bot does the following:
- extract entity A without a "maybe" confidence
- perform some unrelated action
- clarify entity A
As a result, it would be more intuitive to have a follow_up
option where instead of specifying only the action name, the user can optionally also specify the goal they're trying to accomplish. This goal may be an entity extraction, a successful API call, or a setting to context variables (maybe eventually we can up the complexity to include arbitrary formulas once #4 is resolved). Additionally, the user would have to specify in each action what goal it accomplishes, i.e. something like
action: example
goal:
extract_entities:
- pizza
- drink
- side
...
So, if a goal is specified under a follow_up
like this,
follow_up:
name: example
goal:
extract_entities:
- pizza
then all actions with that goal (or that include that goal) will not be disabled. Then, instead of painstakingly iterating through all the actions with that goal to figure out when it was accomplished (which might be difficult or impossible for some goals, i.e. extracting multiple entities which could take place over multiple actions), you auto-generate a system action that takes the follow_up
goal as a precondition and sets forcing__{action}
to False
as a result.
For example, if the user wanted to force the action which extracts/clarifies 5 entities through a slot_fill action, instead of having to settle for only having the initial ask forced, they can now easily force the bot to find all 5 entities before proceeding. The goal could even be somewhat unrelated to the forced action, which allows for more complex forcing, for example, forcing that we then find entity which could only be extracted farther down the line. This essentially allows the bot designer to tell the bot to “go up until a certain point, and then continue and do whatever you want.”
This functionality would also improve conversation quality on slot_fill
actions by auto-forcing the goal of entity extraction when the bot wasn't able to extract all the entities (with full certainty) from the initial input.