mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 13:52:38 +02:00
bug fix and refactor code
This commit is contained in:
parent
193fc5535a
commit
7ab6e43b62
2 changed files with 58 additions and 28 deletions
|
|
@ -33,7 +33,7 @@ class Environment(BaseModel):
|
|||
|
||||
desc: str = Field(default="") # 环境描述
|
||||
roles: dict[str, SerializeAsAny[Role]] = Field(default_factory=dict, validate_default=True)
|
||||
members: dict[Role, Set] = Field(default_factory=dict, exclude=True)
|
||||
member_addrs: dict[Role, Set] = Field(default_factory=dict, exclude=True)
|
||||
history: str = "" # For debug
|
||||
context: Context = Field(default_factory=Context, exclude=True)
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class Environment(BaseModel):
|
|||
"role_class": role.__class__.__name__,
|
||||
"module_name": role.__module__,
|
||||
"role_name": role.name,
|
||||
"role_sub_tags": list(self.members.get(role)),
|
||||
"role_sub_tags": list(self.member_addrs.get(role)),
|
||||
}
|
||||
)
|
||||
role.serialize(stg_path=stg_path.joinpath(f"roles/{role.__class__.__name__}_{role.name}"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue