NLU Command Adapter | Rasa Documentation

How the NLUCommandAdapter Works

The NLUCommandAdapter uses the classic way to start flows, such as using predicted intents by an intent classifier. It looks at the predicted intent from the intent classifier and tries to find a flow with a corresponding NLU trigger defined. If a flow has a NLU trigger matching the predicted intent and the confidence is larger than the given threshold defined in the NLU trigger, the NLUCommandAdapter will return a StartFlow command to begin the corresponding flow.

Using the NLUCommandAdapter

To use this component in your assistant, add the NLUCommandAdapter to your NLU pipeline in the config.yml file. You also need to have an intent classifier listed in your NLU pipeline. Read more about the config.yml file here.

config.yml

pipeline:
# - ...
  - name: NLUCommandAdapter
# - ...

When to use the NLUCommandAdapter

We recommend to use the NLUCommandAdapter in two scenarios:

New in 3.12

If you are using a LLM-based command generator alongside the NLUCommandAdapter in the config pipeline, note that both the LLM-based command generator and the NLUCommandAdapter can now issue commands at any given conversation turn. To enable this behaviour, you should set the minimize_num_calls boolean parameter to false in the LLM-based command generator configuration.

Customization

To restrict the length of user messages, you can set the user_input.max_characters (default value is 420 characters).

config.yml

pipeline:
  - name: NLUCommandAdapter
    user_input:
      max_characters: 420