I’ve been following the official documentation to create a Form for my Chatbot, and I need to add some different required slots for each entity value. E.g if entity city = “New York” add an additional slot to fill, if entity city = any other city than NY, don’t add anything.
In the documentation, I found this note:
Note: you can customise the required slots function not to be static. E.g. if the job_function is a developer, you could add a required_slot about the users experience level with Rasa.
But no details are given on how to do it. Can someone help ?
Hi @forwitai. You can write some custom logic in the required_slots() method. Since it inherits from tracker you get all the tracker methods available for you - you can return the values of the most recent entities with tracker.latest_message.get('entities') and use the values to define which slots should be required (for example, write if statement to return a specific list of required slots).