Configure global commands
For your application to support global commands, you must reserve an entity to hold the recognized command values you want your application to support. Three predefined events—Escalate, MainMenu, and Goodbye—are available, which you can map to specific values of your global command entity. To support additional commands, you must add both a custom event and the command entity value meant to trigger the event.
Once you have enabled global commands, you can add handlers for any events those commands are meant to trigger, in the Start node of your dialog design, or in the Enter node of a component, for component-level handling.
If you want some commands to be handled locally, at a specific question and answer node, configure command overrides. Commands that are only meant to be handled locally at a question and answer node don’t require a companion event. In a question and answer node, such commands are handled through system actions, just like intents and entity values.
Enable global commands
- Add a list entity—for example, COMMAND.
- Add literals for your entity—for example: Literal “goodbye” for value goodbye; “agent” and “operator” for agent; “main menu” for main_menu.
- In Mix.nlu, add at least “goodbye” as a sample under the NO_INTENT intent, and annotate it with the COMMAND entity.
This is a workaround to prevent “goodbye” from being recognized as a value for a global entity that Mix.dialog does not yet support. - In Mix.dialog, open the Project Settings panel, expand All channels, and click Global commands.
- Expand the Entity list and choose the entity you defined at step 1.
This entity becomes a reserved entity. You cannot assign its value to a variable or use it in dynamic messages. - Enable a command (for example, Goodbye), and choose the entity value (goodbye) that represents this command.
- If the project has channels that support DTMF interaction, choose a DTMF key for this command, if desired.
- Proceed in the same fashion for the other commands you want to enable.
Notes:
- If you later decide to replace your global command entity with another entity, or if you try deleting the global command entity or some of its values, Mix.dialog will prompt you to export the JSON representation of your design before proceeding.
- Don’t set DTMF mappings for your global command entity values, if you will be using an external DTMF grammar (see Specify grammars for commands).
Add a global command mapping
- Click the Add icon next to the Entity selector.
A new row appears.
- Choose the event for the command you want to enable.
Tip: Use the search field to narrow down the list if needed. If your project does not yet have the desired event, you can create it on the fly. - Choose the corresponding entity value, and a DTMF key if your project supports DTMF interaction.
Your new global command is enabled by default.
Note:
Don’t set DTMF mappings for your global command entity values, if you will be using an external DTMF grammar (see Specify grammars for commands).Remove a global command mapping
Click the More icon for the global command mapping you want to delete and choose Delete.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.