def set_state(self, state: entity_component.ComponentState) -> None:
    """Sets the component state from JSON data."""
    with self._lock:
      if state['previous_time']:
        previous_time = datetime.datetime.strptime(
            state['previous_time'], '%Y-%m-%d %H:%M:%S')
      else:
        previous_time = None
      self._previous_time = previous_time
      self._situation_thus_far = state['situation_thus_far']
Sets the component state from JSON data.
concordia/contrib/components/agent/situation_representation_via_narrative.py