When i first got this error in my form action. I tried the following steps to resolve it
added more training examples
added validate function for title
change button payload from /slot to /inform_title
checked slot_mappings and required_slots functions to see if there was any mistake
added more story paths with title set
But I am still getting the same error. I am trying to ask for the title using buttons. When a button with corresponding payload is selected it gives me the following error : Failed to extract slot title with action flight_booking_form
The error says that it failed to extract slot but I notice that the slot is actually getting set in rasa interactive. When the form action asks Do you want to validate slot title for the first time I get this error. Then after the next slot’s utterance utter_ask_username is executed it again asks to validate and title and this time it works and the slot gets set properly. When running the bot locally using rasa shell this utterance gets asked twice and the second time it shows error but the slot gets set as the bot proceeds to the next slot utterance (user_name) and I get an email confirmation at the end of the booking process with my full name and title. Here is the a screenshot of log output from rasa run actions --debug & rasa shell --debug
Hi @DaVeY79. I can see that a lot of your requested slots are featurized. Is there a reason for this? When using forms, your slots should be unfeaturized unless there is a very good reason why they should be influencing the dialogue. If that’s the case, then you stories should also include events SlotSet() in your stories for the slot to actually be set. What is your reasoning behind having title as categorical? Is it affecting the dialogue flow in any way?
@Juste You are right many of the slots are featurized when they should actually be unfeaturized as they don’t affect the conversation flow. I made title slot categorical as I assumed that only categorical slots can be set using buttons. I basically want to restrict the title slot to only those 4 values (Mr, Ms, Mx, Dr). If this title is set without buttons through some other intent I don’t want it to arbitrarily extract another value (say Miss, Sir, M etc). I could have specified a synonym mapping but I am not sure of all the synonym possibilities. Similarly with the other slots I wanted to restrict it to categorical or boolean or float value (with minimum and maximum values) that’s why I kept them as featurized
An update: After running debug I found the error. Selecting any title button is actually giving the intent greet instead of the intent inform_title. I sort of fixed this by changing slot mapping for title from self.from_entity(entity=“time”, intent=“inform_title”) to self.from_text(intent=None). But this shouldn’t happen right as I have given /inform_title{“title”:“title_name”} in the payload, shouldn’t this force the intent inform_title ? It looks like the intent is getting classified from the button title. In another case I gave the user option to choose from a dynamic list of buttons for e.g.
title: "La Guardia Airport, New York (LGA)" payload:/inform_departure_airport_code{"fromloc.airport_code":"LGA"}
title: "John F Kennedy Airport, New York (JFK)" payload:/inform_departure_airport_code{"fromloc.airport_code":"JFK"}
This too had the same issue. As soon as I changed it to:
title: "I want to travel from La Guardia Airport, New York (LGA)" payload:/inform_departure_airport_code{"fromloc.airport_code":"LGA"}
title: "I want to travel from John F Kennedy Airport, New York (JFK)" payload:/inform_departure_airport_code{"fromloc.airport_code":"JFK"}
The intent got classified correctly and the slot was validated and set immediately.