From 8cc785b54633d4237938ef0639200b019fb1b475 Mon Sep 17 00:00:00 2001 From: Paulo Salem Date: Sun, 2 Feb 2025 20:57:16 -0300 Subject: [PATCH] Fixes fragment import. The fragment specification key was missing, thereby causing the fragment import to merge non-compatible structures. We now add the missing key. --- tinytroupe/agent/tiny_person.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinytroupe/agent/tiny_person.py b/tinytroupe/agent/tiny_person.py index 137fc59..4361818 100644 --- a/tinytroupe/agent/tiny_person.py +++ b/tinytroupe/agent/tiny_person.py @@ -265,7 +265,7 @@ def import_fragment(self, path): # check the type is "Fragment" and that there's also a "persona" key if fragment.get("type", None) == "Fragment" and fragment.get("persona", None) is not None: - self.include_persona_definitions(fragment) + self.include_persona_definitions(fragment["persona"]) else: raise ValueError("The imported JSON file must be a valid fragment of a persona configuration.") @@ -1373,4 +1373,4 @@ def clear_agents(): """ Clears the global list of agents. """ - TinyPerson.all_agents = {} \ No newline at end of file + TinyPerson.all_agents = {}