mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 13:52:38 +02:00
simplify some ser&desr code
This commit is contained in:
parent
6208400f71
commit
f563b2c608
5 changed files with 54 additions and 146 deletions
|
|
@ -70,10 +70,8 @@ class Environment(BaseModel):
|
|||
roles_info = read_json_file(roles_path)
|
||||
roles = []
|
||||
for role_info in roles_info:
|
||||
role_class = role_info.get("role_class")
|
||||
role_name = role_info.get("role_name")
|
||||
|
||||
role_path = stg_path.joinpath(f"roles/{role_class}_{role_name}")
|
||||
# role stored in ./environment/roles/{role_class}_{role_name}
|
||||
role_path = stg_path.joinpath(f'roles/{role_info.get("role_class")}_{role_info.get("role_name")}')
|
||||
role = Role.deserialize(role_path)
|
||||
roles.append(role)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue