rasa/core/restore.py
async def replay_events(tracker: DialogueStateTracker, agent: 'Agent') -> None:
    """Take a tracker and replay the logged user utterances against an agent.

    During replaying of the user utterances, the executed actions and events
    created by the agent are compared to the logged ones of the tracker that
    is getting replayed. If they differ, a warning is logged.

    At the end, the tracker stored in the agent's tracker store for the
    same sender id will have quite the same state as the one
    that got replayed."""

    actions_between_utterances = []
    last_prediction = [ACTION_LISTEN_NAME]

    for i, event in enumerate(tracker.events_after_latest_restart()):
        if isinstance(event, UserUttered):
            _check_prediction_aligns_with_story(last_prediction,
                                                actions_between_utterances)

            actions_between_utterances = []
            cliutils.print_success(event.text)
            out = CollectingOutputChannel()
            await agent.handle_text(event.text,
                                    sender_id=tracker.sender_id,
                                    output_channel=out)
            for m in out.messages:
                console.print_bot_output(m)

            tracker = agent.tracker_store.retrieve(tracker.sender_id)
            last_prediction = actions_since_last_utterance(tracker)

        elif isinstance(event, ActionExecuted):
            actions_between_utterances.append(event.action_name)

    _check_prediction_aligns_with_story(last_prediction,
                                        actions_between_utterances)
Take a tracker and replay the logged user utterances against an agent.

    During replaying of the user utterances, the executed actions and events
    created by the agent are compared to the logged ones of the tracker that
    is getting replayed. If they differ, a warning is logged.

    At the end, the tracker stored in the agent's tracker store for the
    same sender id will have quite the same state as the one
    that got replayed.
Take a tracker and replay the logged user utterances against an agent.
During replaying of the user utterances, the executed actions and events
created by the agent are compared to the logged ones of the tracker that
is getting replayed. If they differ, a warning is logged.

At the end, the tracker stored in the agent's tracker store for the
same sender id will have quite the same state as the one
that got replayed.
Take a tracker and replay the logged user utterances against an agent . During replaying of the user utterances the executed actions and events created by the agent are compared to the logged ones of the tracker that is getting replayed . If they differ a warning is logged . At the end the tracker stored in the agent ' s tracker store for the same sender id will have quite the same state as the one that got replayed .
async def replay_events(tracker: DialogueStateTracker, agent: 'Agent') -> None:
    actions_between_utterances = []
    last_prediction = [ACTION_LISTEN_NAME]
    for i, event in enumerate(tracker.events_after_latest_restart()):
        if isinstance(event, UserUttered):
            _check_prediction_aligns_with_story(last_prediction,
                                                actions_between_utterances)
            actions_between_utterances = []
            cliutils.print_success(event.text)
            out = CollectingOutputChannel()
            await agent.handle_text(event.text,
                                    sender_id=tracker.sender_id,
                                    output_channel=out)
            for m in out.messages:
                console.print_bot_output(m)
            tracker = agent.tracker_store.retrieve(tracker.sender_id)
            last_prediction = actions_since_last_utterance(tracker)
        elif isinstance(event, ActionExecuted):
            actions_between_utterances.append(event.action_name)
    _check_prediction_aligns_with_story(last_prediction,
                                        actions_between_utterances)
async def replay_events ( tracker : DialogueStateTracker , agent : 'Agent' ) -> None : actions_between_utterances = [ ] last_prediction = [ ACTION_LISTEN_NAME ] for i , event in enumerate ( tracker . events_after_latest_restart ( ) ) : if isinstance ( event , UserUttered ) : _check_prediction_aligns_with_story ( last_prediction , actions_between_utterances ) actions_between_utterances = [ ] cliutils . print_success ( event . text ) out = CollectingOutputChannel ( ) await agent . handle_text ( event . text , sender_id = tracker . sender_id , output_channel = out ) for m in out . messages : console . print_bot_output ( m ) tracker = agent . tracker_store . retrieve ( tracker . sender_id ) last_prediction = actions_since_last_utterance ( tracker ) elif isinstance ( event , ActionExecuted ) : actions_between_utterances . append ( event . action_name ) _check_prediction_aligns_with_story ( last_prediction , actions_between_utterances )
Take a tracker and replay the logged user utterances against an agent.
Take a tracker and replay the logged user utterances against an agent .
"""Take a tracker and replay the logged user utterances against an agent.

    During replaying of the user utterances, the executed actions and events
    created by the agent are compared to the logged ones of the tracker that
    is getting replayed. If they differ, a warning is logged.

    At the end, the tracker stored in the agent's tracker store for the
    same sender id will have quite the same state as the one
    that got replayed."""
tracker
DialogueStateTracker
agent
'Agent'