Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
added paraneter to current state of tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Feb 7, 2018
1 parent 991b2af commit 60f17ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rasa_core/trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@ def __init__(self, sender_id, slots,
###
# Public tracker interface
###
def current_state(self, should_include_events=False):
# type: (bool) -> Dict[Text, Any]
def current_state(self,
should_include_events=False,
only_events_after_latest_restart=False):
# type: (bool, bool) -> Dict[Text, Any]
"""Returns the current tracker state as an object."""

if should_include_events:
evts = [e.as_dict() for e in self.events]
if only_events_after_latest_restart:
es = self.events
else:
es = self.events_after_latest_restart()
evts = [e.as_dict() for e in es]
else:
evts = None

Expand Down

0 comments on commit 60f17ca

Please sign in to comment.