So, let’s say that the user asks something that requires the activation of a form.
Before starting with the form, I want to check if some slot is set or not. If it’s set I will go on with the form, otherwise I will return some error message and deactivate the form.
Can you give me an example of that? How can I check in my stories if a slot is set or not?
And btw… what if I need to run some python code before the form starts? There must be a way to insert some code just before the first utter_ask is triggered…
If - as you have mentioned - the check should lay inside the form itsself, I’d suggest to overwrite the run - method of the rasa_sdk inside your form:
def run(
self,
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: Dict[Text, Any],
) -> List[EventType]:
"""Execute the side effects of this form.
Here you can check with the tracker.get_slot(…) method, what should happen.