How to use NLU entities in CALM flows

I have the following as my config, where the NLU part is based on some example from the rasa calm demo github repo

pipeline:
  - name: WhitespaceTokenizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: LogisticRegressionClassifier
    max_iter: 100
    solver: lbfgs
    tol: 0.0001
    random_state: 42
    ranking_length: 10
  - name: CRFEntityExtractor
  - name: NLUCommandAdapter
  - name: MultiStepLLMCommandGenerator
    llm:
      type: openai
      model: "gpt-4o-mini-2024-07-18"
    flow_retrieval:
      embeddings:
        type: openai
        model: "text-embedding-3-large"

and I have something like

nlu:
  - intent: trigger_greet_guest
    examples: |
      - trigger_greet_guest source_location [kitchen](nlu_guest_location) destination_location [livingroom](nlu_destination_location)
      - trigger_greet_guest source_location [hallway](nlu_guest_location) destination_location [diningroom](nlu_destination_location)
      - trigger_greet_guest source_location [livingroom](nlu_guest_location) destination_location [kitchen](nlu_destination_location)
      - trigger_greet_guest source_location [diningroom](nlu_guest_location) destination_location [hallway](nlu_destination_location)

for my NLU training data. This is just for me to trigger flows from an external source using NLU intents since directly triggering flows doesn’t seem to work.

Here is my domain where I defined the intent


intents:
  - trigger_greet_guest

entities:
  - nlu_guest_location
  - nlu_destination_location

slots:
  nlu_guest_location:
    type: text
    initial_value: null
    mappings:
    - type: from_entity
      entity: nlu_guest_location

  nlu_destination_location:
    type: text
    initial_value: null
    mappings:
    - type: from_entity
      entity: nlu_destination_location
responses:
  utter_greet_guest_custom:
    - text: "Currently a place holder for the initial message with nlu source location as {nlu_source_location} and nlu destination location as {nlu_destination_location}."

and my flow is as follows:

  greet_guests_dummy:
    description: dummy flow triggered by NLU component
    always_include_in_prompt: false
    nlu_trigger:
      - intent: trigger_greet_guest
    steps:
      - action: utter_greet_guest_custom

Anyways, when I get the flow, I try to utter the slots to verify but I only get None. The entities do not seem to carry forward into the flows. What am I doing wrong?

@Elliot94 thanks for the question. Given the structure of your NLU examples, looks like this is not natural language input.

What about structuring the input as a payload as if it were a button-push? Responses

Also have you confirmed the entities are definitely getting extracted? Also are you using Rasa Pro 3.9.0 or later?

Hi, first off, yes it is not really natural language input. I just want to trigger the flows from another process that is running elsewhere, but I was unable to get it working by directly triggering the intents via API (Open forum post here)

so this is my workaround for that. As for having it as buttons, I will be triggering these specific flows from another process rather than based on user interaction, so I am not sure if the same payload concept can be applied.

As for the entities, yes they are being extracted, and after digging around I got them working by explicitly calling “action_extract_slots” in the beginning of the flow. Also my Rasa Pro version is 3.9.3