Skip to content

Commit

Permalink
Fixes fragment import.
Browse files Browse the repository at this point in the history
The fragment specification key was missing, thereby causing the fragment import to merge non-compatible structures. We now add the missing key.
  • Loading branch information
paulosalem authored Feb 2, 2025
1 parent 1c6ee9a commit 8cc785b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tinytroupe/agent/tiny_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down Expand Up @@ -1373,4 +1373,4 @@ def clear_agents():
"""
Clears the global list of agents.
"""
TinyPerson.all_agents = {}
TinyPerson.all_agents = {}

0 comments on commit 8cc785b

Please sign in to comment.