Stop slot/form validation if user hits with different intent is not working if the validation is with regex

Version: 2.5 I am doing a custom validation to slots with regex in actions.py and the definition of slots and validation in actions.py is as follows

The regex will check the slot value (name) and sets the value of input to name slot if matched, else it will throw an error saying and slot wont be set until the input is matched with regex.

The following is the definition of action name in domain.yml

image

image

image

and the stories path for name slot
image

Though I have mentioned in stories, while filling the slot if user does not want to provide the value (with intent deny), the form is not deactivating instead it is checking the user input with regex and throwing the else condition. I have more slots which are validating based on regex each of them are executing the same.

@bharath-madduri You mention required_slots, slot_mapping and requested_slot, but not mentioned in form. Do cross check again the syntax Forms , Forms or https://youtu.be/CKn4ZBh9PpY

@bharath-madduri Check action.py and your form and slots in domain and do check the rasa doc.You will get.

The link you are referring is 2.7 version, but I am using 2.5 version, as per 2.5 version I assume I have mentioned everything as in docx.

@bharath-madduri Then update the version , as Rasa backend team update so much. Or if you believe your code is 100% delete older train model and re-train.

Tried deleting the model and initiated a new project still no luck with 2.5, will give it a try with 2.7 and let you know if that works, thank you for your help.

I tried in rasa 2.7 , its not working, may be it does not work if slot validation is with regex.

@bharath-madduri check your regex is it correct or not? https://regexr.com @bharath-madduri I will encourage to see this example first https://youtu.be/CKn4ZBh9PpY and implement and then replace with regex. If am sure you have syntax error in code.

I tried the FormBot with rasa 2.7 if the validation is with Regex, then it is not deactivating the form.

validation functionality is working fine if it is not with Regex.

This is the regex I am using for email validation [1]+[._]?[a-z0-9]+[@]\w+[.]\w{2,3}$

I have tested the regular expression on https://regex101.com/ and it only works for email.

Please let me know if you have any solution to deactivate the form if the validation is with regex.


  1. a-z0-9 ↩︎

@bharath-madduri this is for me? if yes can you please share the form stories or rules?

Here is the stories.yml
image

I did not mention anything in rules.yml

hey @nik202 any luck to deactivate slot filling with Regular Expression?

@bharath-madduri Any luck? Not get you !

Are you able to identify the issue I am facing with R.E , as you said before it should work.

@bharath-madduri If you not mention me @ and nik202 the post missed it in-between its 21 day old post bro, do share some related files. I will try see it.

All of the required files are in this post only. if you still want me to send again, can do that.

@bharath-madduri Again you not mentioned me with @ and nik202 it go into unread one not as notification. Do share me original files so that I can dry run the code.

hey @nik202 here are the files for you.domain.yml (833 Bytes) stories.yml (396 Bytes) nlu.yml (1.4 KB) actions.py (1.2 KB) Rasa version : 2.7 Hope it helps.

hey @nik202 able to check for the regex with slot validation?