How to do entity / slot validation in rasa-x /actions.py

my app_id (entity and slot) is 8 or 9 digit numerical value.

  1. Should i put validation of it in rasa-x itself before passing to actions.py? How?

  2. Should i do validation in actions.py using if else conditions?

What is the right approach in such cases.

Thanks

Did you look at this docs page?