rasa/core/training/interactive.py
async def _request_fork_from_user(
    sender_id,
    endpoint
) -> Optional[List[Dict[Text, Any]]]:
    """Take in a conversation and ask at which point to fork the conversation.

    Returns the list of events that should be kept. Forking means, the
    conversation will be reset and continued from this previous point."""

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

    choices = []
    for i, e in enumerate(tracker.get("events", [])):
        if e.get("event") == UserUttered.type_name:
            choices.append({"name": e.get("text"), "value": i})

    fork_idx = await _request_fork_point_from_list(list(reversed(choices)),
                                                   sender_id,
                                                   endpoint)

    if fork_idx is not None:
        return tracker.get("events", [])[:int(fork_idx)]
    else:
        return None
Take in a conversation and ask at which point to fork the conversation.

    Returns the list of events that should be kept. Forking means, the
    conversation will be reset and continued from this previous point.
Take in a conversation and ask at which point to fork the conversation.
Returns the list of events that should be kept. Forking means, the
conversation will be reset and continued from this previous point.
Take in a conversation and ask at which point to fork the conversation . Returns the list of events that should be kept . Forking means the conversation will be reset and continued from this previous point .
async def _request_fork_from_user(
    sender_id,
    endpoint
) -> Optional[List[Dict[Text, Any]]]:
    tracker = await retrieve_tracker(endpoint, sender_id,
                                     EventVerbosity.AFTER_RESTART)
    choices = []
    for i, e in enumerate(tracker.get("events", [])):
        if e.get("event") == UserUttered.type_name:
            choices.append({"name": e.get("text"), "value": i})
    fork_idx = await _request_fork_point_from_list(list(reversed(choices)),
                                                   sender_id,
                                                   endpoint)
    if fork_idx is not None:
        return tracker.get("events", [])[:int(fork_idx)]
    else:
        return None
async def _request_fork_from_user ( sender_id , endpoint ) -> Optional [ List [ Dict [ Text , Any ] ] ] : tracker = await retrieve_tracker ( endpoint , sender_id , EventVerbosity . AFTER_RESTART ) choices = [ ] for i , e in enumerate ( tracker . get ( "events" , [ ] ) ) : if e . get ( "event" ) == UserUttered . type_name : choices . append ( { "name" : e . get ( "text" ) , "value" : i } ) fork_idx = await _request_fork_point_from_list ( list ( reversed ( choices ) ) , sender_id , endpoint ) if fork_idx is not None : return tracker . get ( "events" , [ ] ) [ : int ( fork_idx ) ] else : return None
Take in a conversation and ask at which point to fork the conversation.
Take in a conversation and ask at which point to fork the conversation .
"""Take in a conversation and ask at which point to fork the conversation.

    Returns the list of events that should be kept. Forking means, the
    conversation will be reset and continued from this previous point."""
sender_id
endpoint