How to handle free text in slots without mapping it to any intent?

Hi,

Currently, I am using Rasa 2.x version. I have this use case where I need to capture the last utterance given by the user and fill it in a slot without mapping it to any other intents.

In Rasa 3.x there is a way to do it using from_text.

slots:
  slot_name:
    type: text
    mappings:
    - type: from_text
      intent: intent_name
      not_intent: excluded_intent

this feature is not available in 2.x version. is there any way to do the same thing in Rasa 2.x?

Welcome to the forum! :slight_smile:

But it is :slight_smile:

The syntax is just different in 2.x as slot mappings were defined under forms. For example:

forms:
  form_log_in:
    required_slots:
      password:
      - intent_name: None
        not_intent: stop
        type: from_text
      username:
      - intent_name: None
        not_intent: stop
        type: from_text
1 Like

Piggybacking on here… but it seems relevant. How does one actually make use of this slot to fill it with any text?

Can I write a story like:

- story: my story
  steps:
  - intent: 4-prompt
  - action: utter_ask_question
  - "FILL SLOT HERE - DON'T TRY TO MAP TO AN INTENT AT ALL"
  - action: utter_interesting_answer

Or does the intent need to be mapped before we can access the contents of this slot?

Rasa will always map your inputs to intents, but the slot can still be filled nonetheless, regardless of what the intent is.

In other words, the intent does not affect anything (unless it’s the not_intent in the mapping), so you shouldn’t worry about detecting it.