rasa/core/training/interactive.py
async def _validate_action(action_name: Text,
                           policy: Text,
                           confidence: float,
                           predictions: List[Dict[Text, Any]],
                           endpoint: EndpointConfig,
                           sender_id: Text,
                           finetune: bool = False
                           ) -> bool:
    """Query the user to validate if an action prediction is correct.

    Returns `True` if the prediction is correct, `False` otherwise."""

    question = questionary.confirm(
        "The bot wants to run '{}', correct?".format(action_name))

    is_correct = await _ask_questions(question, sender_id, endpoint)

    if not is_correct:
        action_name, is_new_action = await _request_action_from_user(
            predictions, sender_id, endpoint)
    else:
        is_new_action = False

    tracker = await retrieve_tracker(endpoint, sender_id,
                                     EventVerbosity.AFTER_RESTART)

    if _form_is_rejected(action_name, tracker):
        # notify the tracker that form was rejected
        await send_event(endpoint, sender_id,
                         {"event": "action_execution_rejected",
                          "name": tracker['active_form']['name']})

    elif _form_is_restored(action_name, tracker):
        await _confirm_form_validation(action_name, tracker, endpoint,
                                       sender_id)

    if not is_correct:
        await _correct_wrong_action(action_name, endpoint, sender_id,
                                    finetune=finetune,
                                    is_new_action=is_new_action)
    else:
        await send_action(endpoint, sender_id, action_name, policy, confidence)

    return action_name == ACTION_LISTEN_NAME
Query the user to validate if an action prediction is correct.

    Returns `True` if the prediction is correct, `False` otherwise.
Query the user to validate if an action prediction is correct.
Returns `True` if the prediction is correct, `False` otherwise.
Query the user to validate if an action prediction is correct . Returns ` True ` if the prediction is correct ` False ` otherwise .
async def _validate_action(action_name: Text,
                           policy: Text,
                           confidence: float,
                           predictions: List[Dict[Text, Any]],
                           endpoint: EndpointConfig,
                           sender_id: Text,
                           finetune: bool = False
                           ) -> bool:
    question = questionary.confirm(
        "The bot wants to run '{}', correct?".format(action_name))
    is_correct = await _ask_questions(question, sender_id, endpoint)
    if not is_correct:
        action_name, is_new_action = await _request_action_from_user(
            predictions, sender_id, endpoint)
    else:
        is_new_action = False
    tracker = await retrieve_tracker(endpoint, sender_id,
                                     EventVerbosity.AFTER_RESTART)
    if _form_is_rejected(action_name, tracker):
        await send_event(endpoint, sender_id,
                         {"event": "action_execution_rejected",
                          "name": tracker['active_form']['name']})
    elif _form_is_restored(action_name, tracker):
        await _confirm_form_validation(action_name, tracker, endpoint,
                                       sender_id)
    if not is_correct:
        await _correct_wrong_action(action_name, endpoint, sender_id,
                                    finetune=finetune,
                                    is_new_action=is_new_action)
    else:
        await send_action(endpoint, sender_id, action_name, policy, confidence)
    return action_name == ACTION_LISTEN_NAME
async def _validate_action ( action_name : Text , policy : Text , confidence : float , predictions : List [ Dict [ Text , Any ] ] , endpoint : EndpointConfig , sender_id : Text , finetune : bool = False ) -> bool : question = questionary . confirm ( "The bot wants to run '{}', correct?" . format ( action_name ) ) is_correct = await _ask_questions ( question , sender_id , endpoint ) if not is_correct : action_name , is_new_action = await _request_action_from_user ( predictions , sender_id , endpoint ) else : is_new_action = False tracker = await retrieve_tracker ( endpoint , sender_id , EventVerbosity . AFTER_RESTART ) if _form_is_rejected ( action_name , tracker ) : await send_event ( endpoint , sender_id , { "event" : "action_execution_rejected" , "name" : tracker [ 'active_form' ] [ 'name' ] } ) elif _form_is_restored ( action_name , tracker ) : await _confirm_form_validation ( action_name , tracker , endpoint , sender_id ) if not is_correct : await _correct_wrong_action ( action_name , endpoint , sender_id , finetune = finetune , is_new_action = is_new_action ) else : await send_action ( endpoint , sender_id , action_name , policy , confidence ) return action_name == ACTION_LISTEN_NAME
Query the user to validate if an action prediction is correct.
Query the user to validate if an action prediction is correct .
"""Query the user to validate if an action prediction is correct.

    Returns `True` if the prediction is correct, `False` otherwise.""" # notify the tracker that form was rejected
action_name
Text
policy
Text
confidence
float
predictions
List[Dict[Text, Any]]
endpoint
EndpointConfig
sender_id
Text
finetune
bool