In the restaurant example provided in the docs, I have a doubt.
class ValidateRestaurantForm(FormValidationAction):
def name(self) -> Text:
return "validate_restaurant_form"
async def required_slots(
self,
slots_mapped_in_domain: List[Text],
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: "DomainDict",
) -> Optional[List[Text]]:
additional_slots=[]
if tracker.slots.get("outdoor_seating") is True:
additional_slots.append("shade_or_sun")
return required_slots
async def extract_shade_or_sun(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
text_of_last_user_message = tracker.latest_message.get("text")
return {"shade_or_sun": text_of_last_user_message}
To the best of knowledge I know that required_slots is executed every time any form event is being performed (form initiation, validation, Rejection). So in the above code (as provided in doument Rasa Forms), when User sends a response for utter_ask_outdoor_seating
with a confirmation response (yes
). Rasa core first executes required_slots
method which it then thinks that it needs to extract shade_or_sun
slot.
The following are my questions -
- Now right after this, its executes the method
extract_shade_or_sun
as it is in therequired_slots
withoututter_ask_shade_or_sun
being uttered first. - In case if there was method for validation of slot
outdoor_seating
, even in that scenariorequired_slots
is executed first, then validation ofoutdoor_seating
, and the next requested slot is set toshade_or_sun
and extraction of it is performed.
Am i missing something here. need help very bad