rasa/core/training/interactive.py
async def _confirm_form_validation(action_name, tracker, endpoint, sender_id):
    """Ask a user whether an input for a form should be validated.

    Previous to this call, the active form was chosen after it was rejected."""

    requested_slot = tracker.get("slots", {}).get(REQUESTED_SLOT)

    validation_questions = questionary.confirm(
        "Should '{}' validate user input to fill "
        "the slot '{}'?".format(action_name, requested_slot))
    validate_input = await _ask_questions(validation_questions, sender_id,
                                          endpoint)

    if not validate_input:
        # notify form action to skip validation
        await send_event(endpoint, sender_id,
                         {"event": "form_validation", "validate": False})

    elif not tracker.get('active_form', {}).get('validate'):
        # handle contradiction with learned behaviour
        warning_question = questionary.confirm(
            "ERROR: FormPolicy predicted no form validation "
            "based on previous training stories. "
            "Make sure to remove contradictory stories "
            "from training data. "
            "Otherwise predicting no form validation "
            "will not work as expected.")

        await _ask_questions(warning_question, sender_id, endpoint)
        # notify form action to validate an input
        await send_event(endpoint, sender_id,
                         {"event": "form_validation", "validate": True})
Ask a user whether an input for a form should be validated.

    Previous to this call, the active form was chosen after it was rejected.
Ask a user whether an input for a form should be validated.
Previous to this call, the active form was chosen after it was rejected.
Ask a user whether an input for a form should be validated . Previous to this call the active form was chosen after it was rejected .
async def _confirm_form_validation(action_name, tracker, endpoint, sender_id):
    requested_slot = tracker.get("slots", {}).get(REQUESTED_SLOT)
    validation_questions = questionary.confirm(
        "Should '{}' validate user input to fill "
        "the slot '{}'?".format(action_name, requested_slot))
    validate_input = await _ask_questions(validation_questions, sender_id,
                                          endpoint)
    if not validate_input:
        await send_event(endpoint, sender_id,
                         {"event": "form_validation", "validate": False})
    elif not tracker.get('active_form', {}).get('validate'):
        warning_question = questionary.confirm(
            "ERROR: FormPolicy predicted no form validation "
            "based on previous training stories. "
            "Make sure to remove contradictory stories "
            "from training data. "
            "Otherwise predicting no form validation "
            "will not work as expected.")
        await _ask_questions(warning_question, sender_id, endpoint)
        await send_event(endpoint, sender_id,
                         {"event": "form_validation", "validate": True})
async def _confirm_form_validation ( action_name , tracker , endpoint , sender_id ) : requested_slot = tracker . get ( "slots" , { } ) . get ( REQUESTED_SLOT ) validation_questions = questionary . confirm ( "Should '{}' validate user input to fill " "the slot '{}'?" . format ( action_name , requested_slot ) ) validate_input = await _ask_questions ( validation_questions , sender_id , endpoint ) if not validate_input : await send_event ( endpoint , sender_id , { "event" : "form_validation" , "validate" : False } ) elif not tracker . get ( 'active_form' , { } ) . get ( 'validate' ) : warning_question = questionary . confirm ( "ERROR: FormPolicy predicted no form validation " "based on previous training stories. " "Make sure to remove contradictory stories " "from training data. " "Otherwise predicting no form validation " "will not work as expected." ) await _ask_questions ( warning_question , sender_id , endpoint ) await send_event ( endpoint , sender_id , { "event" : "form_validation" , "validate" : True } )
Ask a user whether an input for a form should be validated.
Ask a user whether an input for a form should be validated .
"""Ask a user whether an input for a form should be validated.

    Previous to this call, the active form was chosen after it was rejected.""" # notify form action to skip validation # handle contradiction with learned behaviour # notify form action to validate an input
action_name
tracker
endpoint
sender_id