Ask again for a not set slot in form

I have a question about how to ask for the slots in the forms.

I have defined a slot that is mapped with “from_entity” and whose values are in a lookup table.

Everything works fine when the user types one of the values included in the look up table.

However, when the slot is asked and the phrase written by the user does not contain any entity, the chatbot does not ask for the slot again.

Should this happen like this or is there a way to make the chatbot ask for the slot again?

1 Like

Got a chatlog from rasa interactive that gives a demo of something going wrong?

Are you using custom actions to validate the data? If not, that might fix it too. There’s more information on validation in the custom forms section on our learning center.

1 Like

Thanks for the reply @koaning

I have not indicated the version of Rasa in the original post, I include it here

Rasa Version      :         3.0.8
Rasa SDK Version  :         3.0.4
Python Version    :         3.8.12
Operating System  :         Windows-10-10.0.22000-SP0

Looking at the chatlog of the interactive version I see the same thing that does not ask again for the slot that has not been fixed. I attach the story here

- story: interactive_story_1
  steps:
  - intent: book_restaurant
  - action: book_restaurant_form
  - active_loop: book_restaurant_form
  - slot_was_set:
    - requested_slot: food
  - intent: book_restaurant

What happens in the story is that it detects the intent book_restaurant and asks for the slot food with the phrase “What kind of food do you want?” and if I answer “Sushi” (which is not in the look up table of the food entity) it re-enters the form to execute the validation and returns to the action_listen action but without asking for the slot again.

Right now I don’t have a validation function, should I add one so that if the slot value is None it tells the user ‘I didn’t understand that’?

Is there any way to indicate that the slot should be asked again if it has not been filled?

Sending back a message that helps the user what to do next is a good practice either way.

A form should do that on it’s own, so I think something strange is happening.

Could you share the full log of something going wrong in a rasa interactive session? That way I can see the slots being set and that might help me debug.

I have defined a validation function that checks if the value of the slot has been set, if not, it tells the user ‘I haven’t understood what kind of food you want, can you tell me in another way?’ but it does not enter the validation if no slot value is previously extracted.

I have observed that if I create a custom extraction method in which I return {'food': None} if no entity value is detected, it does enter the validation and displays the message asking again for the slot.

@Belen is this problem resolved as i am facing same issue in rasa 3.x. For first unfound slot prompt is asked to provide entity value to be stored on slot. But if somehow the slot is not filled on the response after prompt was asked then neither the flow is going into validation_form action nor the prompt is repeated. The conversation halts and if response provided is somehow detected as another intent the response to that intent is returned.

1 Like

@koaning is this issue resolved?

i am facing the same issue in rasa 3.x, If the slot is not filled the first time, the slot will not be asked again

I tried this method,Although able to achieve asking again for the slot, but it introduces a new problem, doing so will cause all operations that interrupt the form to be ineffective

Was anybody able to solve this? I am facing the same issue in 2.8.x. if the request slot entity is not detected, it jumps out of the form.