question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form automatically fills in all `from_text` slots in RC2

See original GitHub issue

I am working on a bot in RC2 where I’m supposed to give my name.

> python -m rasa --version

Rasa Version      :         3.0.0rc2
Minimum Compatible Version: 3.0.0rc1
Rasa SDK Version  :         3.0.0rc1
Rasa X Version    :         None
Python Version    :         3.7.9
Operating System  :         Linux-5.11.0-7614-generic-x86_64-with-Pop-20.10-groovy
Python Path       :         /home/vincent/Development/rasa-3.x-form-examples/venv/bin/python

Here’s a snippet of the domain file where the bot is having well.

forms:
  name_form:
    required_slots:
      - first_name
      - last_name

slots:
  first_name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
        conditions:
         - active_loop: name_form
           requested_slot: first_name
  last_name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
        conditions:
         - active_loop: name_form
           requested_slot: last_name

This form behaves well, here’s a snippet for the behavior in rasa shell.

Your input ->  hi there                                                                                                                                                                
Hey! How are you?

Your input ->  i want to tell you my name                                                                                                                                              
What is your first name?

Your input ->  vincent                                                                                                                                                                 
What is your last name?

Your input ->  warmerdarm                                                                                                                                                              
Ok. Thanks!
I will remember that your name is vincent warmerdarm!

So far so good. But let’s now remove the conditions.

forms:
  name_form:
    required_slots:
      - first_name
      - last_name

slots:
  first_name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
  last_name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text

Here’s what rasa shell does now.

Your input ->  i want to tell you my name                                                                                                                                              
Ok. Thanks!
I will remember that your name is i want to tell you my name i want to tell you my name!

This is a bit strange. The form has two slots but they both automatically get filled from a single utterance. I’d argue that this is a bit greedy, similar to the issue described here. What’s going to be confusing to the end-user is that the two responses for asking the user is completely skipped too.

responses:
  utter_ask_first_name:
  - text: What is your first name?
  utter_ask_last_name:
  - text: What is your last name?
  utter_submit:
  - text: Ok. Thanks!
  utter_slots_values:
  - text: I will remember that your name is {first_name} {last_name}!

If anybody is interested in reproducing this issue, the project can be found here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
ancalitacommented, Nov 17, 2021

@koaning I’ve added this note in the from_text section of the docs:

To maintain the 2.x form behavior when using `from_text` slot mappings, you must use [mapping conditions](./domain.mdx#mapping-conditions), where both `active_loop` and `requested_slot` keys are defined.

Plus, developed a bit this paragraph in the migration guide:

For slots that should be filled only in the context of a form, add [mapping conditions](./domain.mdx#mapping-conditions) 
to specify which form(s) should be active, as well as indicate if the `requested_slot` should be the same slot.
Adding `conditions` is required to preserve the behavior of slot mappings from 2.0, since without them
the mappings will be applied on each user turn regardless of whether a form is active or not.

Let me know if that’s alright!

1reaction
ancalitacommented, Nov 17, 2021

Follow-up issue created 😃

@koaning would it be ok to close this issue since the solution is to use conditions in the slot mapping?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable automatic slot filling in forms - Rasa Community Forum
Hello, in my current project I want to validate all user input that rasa collects through a form. This is done with a...
Read more >
Rasa Form Action - Slot getting filled with same data twice
After filling the form, I have an utter action which shows all the ... and the same value is filled automatically twice in...
Read more >
substitute auto slot filling with customizable action · Issue #6267
For our apartment search bot, it can help us set (or edit) user preferences outside of our standard preferences form. The reason we...
Read more >
How-To Inserting Design Form into PDF so User Opens and ...
1. User must fill out form before gaining access to the .PDF file which is a product presentation. 2. User must send back...
Read more >
Create a Signup with Time Slots Using Choice Eliminator 2 ...
Use Choice Eliminator 2 to restrict the number of people signing up for a time slot on a Google Form.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found