rasa/core/training/interactive.py
async def _request_action_from_user(
    predictions: List[Dict[Text, Any]],
    sender_id: Text, endpoint: EndpointConfig
) -> (Text, bool):
    """Ask the user to correct an action prediction."""

    await _print_history(sender_id, endpoint)

    choices = [{"name": "{:03.2f} {:40}".format(a.get("score"),
                                                a.get("action")),
                "value": a.get("action")}
               for a in predictions]

    choices = ([{"name": "<create new action>", "value": OTHER_ACTION}] +
               choices)
    question = questionary.select("What is the next action of the bot?",
                                  choices)

    action_name = await _ask_questions(question, sender_id, endpoint)
    is_new_action = action_name == OTHER_ACTION

    if is_new_action:
        action_name = await _request_free_text_action(sender_id, endpoint)
    print("Thanks! The bot will now run {}.\n".format(action_name))
    return action_name, is_new_action
Ask the user to correct an action prediction.
Ask the user to correct an action prediction.
Ask the user to correct an action prediction .
async def _request_action_from_user(
    predictions: List[Dict[Text, Any]],
    sender_id: Text, endpoint: EndpointConfig
) -> (Text, bool):
    await _print_history(sender_id, endpoint)
    choices = [{"name": "{:03.2f} {:40}".format(a.get("score"),
                                                a.get("action")),
                "value": a.get("action")}
               for a in predictions]
    choices = ([{"name": "<create new action>", "value": OTHER_ACTION}] +
               choices)
    question = questionary.select("What is the next action of the bot?",
                                  choices)
    action_name = await _ask_questions(question, sender_id, endpoint)
    is_new_action = action_name == OTHER_ACTION
    if is_new_action:
        action_name = await _request_free_text_action(sender_id, endpoint)
    print("Thanks! The bot will now run {}.\n".format(action_name))
    return action_name, is_new_action
async def _request_action_from_user ( predictions : List [ Dict [ Text , Any ] ] , sender_id : Text , endpoint : EndpointConfig ) -> ( Text , bool ) : await _print_history ( sender_id , endpoint ) choices = [ { "name" : "{:03.2f} {:40}" . format ( a . get ( "score" ) , a . get ( "action" ) ) , "value" : a . get ( "action" ) } for a in predictions ] choices = ( [ { "name" : "<create new action>" , "value" : OTHER_ACTION } ] + choices ) question = questionary . select ( "What is the next action of the bot?" , choices ) action_name = await _ask_questions ( question , sender_id , endpoint ) is_new_action = action_name == OTHER_ACTION if is_new_action : action_name = await _request_free_text_action ( sender_id , endpoint ) print ( "Thanks! The bot will now run {}.\n" . format ( action_name ) ) return action_name , is_new_action
Ask the user to correct an action prediction.
Ask the user to correct an action prediction .
"""Ask the user to correct an action prediction."""
predictions
List[Dict[Text, Any]]
sender_id
Text
endpoint
EndpointConfig