I used return [FollowupAction()] instead of the regular return {} inside the validation function to set dynamic buttons using a custom action. But while testing the bot using rasa interactive here is the warning I am getting
Returning values in helper validation methods is deprecated. Your validate_fromloc_city_name()
method should return a dict of {‘slot_name’: value} instead.
I am trying to build a flight search and booking bot. So for example when a user says I would like to travel from London to Paris. I want to validate what airport in London the user would like to depart from by further asking "
Did you mean:
button1: Heathrow Airport, London
button2: Gatwick Airport, London
button3: Stansted Airport, London
This would require dynamic buttons. It’s not just warning it is also ignoring the FollowUpAction and proceeding to the next utter_ask_{slot} question. I am not sure whether I can override request_next_slot in my code as I have written some custom conditional logic for required_slots.
if tracker.get_slot('child_passengers') and tracker.get_slot('infant_passengers') and tracker.get_slot("round_trip") == "round trip":
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "no_of_children", "infant_passengers", "no_of_infants", "class_type", "currency_code", "round_trip", "return_date", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif tracker.get_slot('child_passengers') and tracker.get_slot('infant_passengers') and not(tracker.get_slot("round_trip") == "round trip"):
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "no_of_children", "infant_passengers", "no_of_infants", "class_type", "currency_code", "round_trip", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif tracker.get_slot('child_passengers') and not(tracker.get_slot('infant_passengers')) and tracker.get_slot("round_trip") == "round trip":
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "no_of_children", "infant_passengers", "class_type", "currency_code", "round_trip", "return_date", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif not(tracker.get_slot('child_passengers')) and tracker.get_slot('infant_passengers') and tracker.get_slot("round_trip") == "round trip":
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "infant_passengers", "no_of_infants", "class_type", "currency_code", "round_trip", "return_date", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif tracker.get_slot('child_passengers') and not(tracker.get_slot('infant_passengers')) and not(tracker.get_slot("round_trip") == "round trip"):
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "no_of_children", "infant_passengers", "class_type", "currency_code", "round_trip", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif not(tracker.get_slot('child_passengers')) and tracker.get_slot('infant_passengers') and not(tracker.get_slot("round_trip") == "round trip"):
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "infant_passengers", "no_of_infants", "class_type", "currency_code", "round_trip", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
elif not(tracker.get_slot('child_passengers')) and not(tracker.get_slot('infant_passengers')) and tracker.get_slot("round_trip") == "round trip":
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "infant_passengers", "class_type", "currency_code", "round_trip", "return_date", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
else:
return ["fromloc_city_name", "toloc_city_name", "depart_date", "no_of_adults", "child_passengers", "infant_passengers", "class_type", "currency_code", "round_trip", "flight_stop_check","email_id","title","user_name","mobile_no","country_code"]
Is there any fix you can suggest for this @akelad ,@abhishakskilrock