Form: fill slot with whatever User types in next

Hello! I am working on my first project and encountered a problem, that I can’t seem to solve. This is the conversation, that I want to implement:

Bot: “What is your biggest fear?”
User: “I am afraid of spyders.”
[…] (some more Q&A)
Bot: “So earlier you said, your biggest fear was: {fear}”
[…]

This is my slot and form definiton:

slots:
   fear:
       type: text
       influence_conversation: false

forms:
    fear_form:
       required_slots:
           fear:
           - type: from_text

And this is how this part of the story looks like:

[...]
- action: utter_ask_fear
- action: fear_form
- active_loop: fear_form
- slot_was_set:
     - fear: "any text"
- action: utter_next_question
[...]

So this als works perfectly fine as long as the user input is somethig, that the Bot doesn’t know. The slot gets filled with whatever the input is. But, and this is what I can’t solve: If the User types something that is recognized as some defined intent (for example state_name, mood_sad etc.) the slot is not been filled. However I do want the slot to be filled, no matter what the User input is, even if it is a known intent. Can someone help me to accomplish this?

Welcome to the forum! :smiley:

Try doing the following:

forms:
    fear_form:
       required_slots:
           fear:
           - type: from_text
             intent: None

From the docs:

The from_intent mapping will fill slot slot_name with value my_value if user intent is intent_name or None.

That means that from_text will fill the slot with the text if the specified intent was detected. If you want to do it for any intent, set intent to None.

Thank you very much! I tried your suggestion and unfortunately it did not work. After a few more rounds of try and error, I was able to solve the problem.

Before I listed my intents in the domain file like this:

intents:
- affirm
- deny
- state_name

I tried with another model and listed the intents like this:

intents:
- affirm:
    use_entities: true
- deny:
    use_entites: true
- state_name:
    use_entites: true

Maybe you could help me understand, why this solved the problem. Only the state_name intent actually has entities, all the other intents don’t. But if I put the entities like that, filling the slot with any input works. I also noticed, that if I run rasa interactive and then create the domain file from it, all the intents will go back to the listing without the use_entities parameter.

That’s weird :sweat_smile:

Glad you solved it anyway :slight_smile: Please mark your answer as solution to mark the thread as solved