rasa/core/training/interactive.py
async def _request_intent_from_user(
    latest_message,
    intents,
    sender_id,
    endpoint
) -> Dict[Text, Any]:
    """Take in latest message and ask which intent it should have been.

    Returns the intent dict that has been selected by the user."""

    predictions = latest_message.get("parse_data",
                                     {}).get("intent_ranking", [])

    predicted_intents = {p["name"] for p in predictions}

    for i in intents:
        if i not in predicted_intents:
            predictions.append({"name": i, "confidence": 0.0})

    # convert intents to ui list and add <other> as a free text alternative
    choices = ([{"name": "<create_new_intent>", "value": OTHER_INTENT}] +
               _selection_choices_from_intent_prediction(predictions))

    intent_name = await _request_selection_from_intent_list(choices,
                                                            sender_id,
                                                            endpoint)

    if intent_name == OTHER_INTENT:
        intent_name = await _request_free_text_intent(sender_id, endpoint)
        return {"name": intent_name, "confidence": 1.0}
    # returns the selected intent with the original probability value
    return next((x for x in predictions if x["name"] == intent_name), None)
Take in latest message and ask which intent it should have been.

    Returns the intent dict that has been selected by the user.
Take in latest message and ask which intent it should have been.
Returns the intent dict that has been selected by the user.
Take in latest message and ask which intent it should have been . Returns the intent dict that has been selected by the user .
async def _request_intent_from_user(
    latest_message,
    intents,
    sender_id,
    endpoint
) -> Dict[Text, Any]:
    predictions = latest_message.get("parse_data",
                                     {}).get("intent_ranking", [])
    predicted_intents = {p["name"] for p in predictions}
    for i in intents:
        if i not in predicted_intents:
            predictions.append({"name": i, "confidence": 0.0})
    choices = ([{"name": "<create_new_intent>", "value": OTHER_INTENT}] +
               _selection_choices_from_intent_prediction(predictions))
    intent_name = await _request_selection_from_intent_list(choices,
                                                            sender_id,
                                                            endpoint)
    if intent_name == OTHER_INTENT:
        intent_name = await _request_free_text_intent(sender_id, endpoint)
        return {"name": intent_name, "confidence": 1.0}
    return next((x for x in predictions if x["name"] == intent_name), None)
async def _request_intent_from_user ( latest_message , intents , sender_id , endpoint ) -> Dict [ Text , Any ] : predictions = latest_message . get ( "parse_data" , { } ) . get ( "intent_ranking" , [ ] ) predicted_intents = { p [ "name" ] for p in predictions } for i in intents : if i not in predicted_intents : predictions . append ( { "name" : i , "confidence" : 0.0 } ) choices = ( [ { "name" : "<create_new_intent>" , "value" : OTHER_INTENT } ] + _selection_choices_from_intent_prediction ( predictions ) ) intent_name = await _request_selection_from_intent_list ( choices , sender_id , endpoint ) if intent_name == OTHER_INTENT : intent_name = await _request_free_text_intent ( sender_id , endpoint ) return { "name" : intent_name , "confidence" : 1.0 } return next ( ( x for x in predictions if x [ "name" ] == intent_name ) , None )
Take in latest message and ask which intent it should have been.
Take in latest message and ask which intent it should have been .
"""Take in latest message and ask which intent it should have been.

    Returns the intent dict that has been selected by the user.""" # convert intents to ui list and add <other> as a free text alternative # returns the selected intent with the original probability value
latest_message
intents
sender_id
endpoint