Skip to content

Commit

Permalink
add get/set state functions for the person_representation component.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 692898477
Change-Id: I43a4dca9987fad5c043ac87fd8cb64a62e7b1311
  • Loading branch information
jzleibo authored and copybara-github committed Nov 4, 2024
1 parent 142b3e2 commit 9bf0caa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions concordia/components/agent/person_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,15 @@ def _make_pre_act_value(self) -> str:
})

return result

def get_state(self) -> entity_component.ComponentState:
"""Converts the component to JSON data."""
with self._lock:
return {
'names_detected': self._names_detected,
}

def set_state(self, state: entity_component.ComponentState) -> None:
"""Sets the component state from JSON data."""
with self._lock:
self._names_detected = state['names_detected']

0 comments on commit 9bf0caa

Please sign in to comment.