I’m excited about the new Rasa 3.0 release, thanks rasa developers!
Unfortunately, I’m running into an issue which was not happening before the upgrade with the dynamic form behavior. Specifically, the bot asks the user “Can I ask your age?” If the user says no, then the slot age will be removed from the form slots through domain_slots.remove(“age”). When I run my custom action however I get the error:
ValueError: list.remove(x): x not in list
What am I missing?
Thank you!
class ValidateUserProfileForm(FormValidationAction):
def name(self) -> Text:
return "validate_user_profile_form"
async def required_slots(
self,
domain_slots: List[Text],
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: "DomainDict",
) -> Optional[List[Text]]:
if not tracker.get_slot("can_ask_age"):
domain_slots.remove("age")
return domain_slots
Hi Chris, Thank you for your help! Unfortunately, it does not solve the problem. I’m also wondering, when the form gets activated, the questions are not displayed as before. The first question “question_ready” does not show up, neither the question “Can_ask_age” … Not sure what has been changed internally in forms through the new slots definition. Are there more specific information required? … Really appreciate your help! … If this remove() function does not work smoothly do you have an idea how I could solve those conditional questions differently? E.g. having different responses in the age utter e.g “How is your age?” vs. “Okay, it’s fine to not tell your age” depending on whether the user has indicated that they are okay when the bots asks for their age vs. not okay? I mean there are several ways for doing that within a conversation but in the case of forms it seems very difficult to me
Unfortunately, it does not print the domain slots, it just shows the error message.
But thank you for your advice with the syntax of the utters… I had a typo, now they are displayed
Do you have an idea where I find a working example of this conditional behavior? When looking at formbot from RASA, there they have the example that the value of “outdoor_sitting” is set to true or false, depending on whether the user said yes to “do you want to sit outside” but this setting takes place silently. In my case, depending on “can I ask your age” the user is asked a further question or not. As I said this worked well in Rasa 2.8 but now I have no idea whether age needs to be included in the form or not, whether I should define it as a slot and then just add it to the form when Can ask age is true… And do I need a custom extract method in this case. I think Rasa 3.0 is a huge improvement, would just be great to be pointed to a working example with those conditional questions. Maybe you know one