Closed
Description
This is actually an SDK issue but I added it here so we can add it to the milestone.
Description of Problem:
Docs specify that all slot validations for a given form is happening as a single function, which is confusing because validation is always unique for each slot. Users will still have to define separate validation functions, but they'll also have to write the logic inside run() for calling each validate method.
Also see the long discussions here
Overview of the Solution:
Some magic class ala
class AbstractFormValidatorAction(Action):
def run(...):
slots_to_validate = tracker.form_slots_to_validate()
for slot_name, value in slots_to_validate.items():
function_name = f"validate_{slot_name}"
fn = getattr(self, function_name)
fn(value, tracker, bla)
Definition of Done:
- Implementation
- Updated Rasa Open Source docs