Skip to content

Commit 8cc785b

Browse files
authored
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.
1 parent 1c6ee9a commit 8cc785b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tinytroupe/agent/tiny_person.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def import_fragment(self, path):
265265

266266
# check the type is "Fragment" and that there's also a "persona" key
267267
if fragment.get("type", None) == "Fragment" and fragment.get("persona", None) is not None:
268-
self.include_persona_definitions(fragment)
268+
self.include_persona_definitions(fragment["persona"])
269269
else:
270270
raise ValueError("The imported JSON file must be a valid fragment of a persona configuration.")
271271

@@ -1373,4 +1373,4 @@ def clear_agents():
13731373
"""
13741374
Clears the global list of agents.
13751375
"""
1376-
TinyPerson.all_agents = {}
1376+
TinyPerson.all_agents = {}

0 commit comments

Comments
 (0)