mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-23 15:48:11 +02:00
add simplest debate example
This commit is contained in:
parent
dd57c45bbe
commit
49377c9db0
7 changed files with 71 additions and 21 deletions
|
|
@ -28,6 +28,7 @@ class Environment(BaseModel):
|
|||
Environment, hosting a batch of roles, roles can publish messages to the environment, and can be observed by other roles
|
||||
"""
|
||||
|
||||
desc: str = Field(default="") # 环境描述
|
||||
roles: dict[str, Role] = Field(default_factory=dict)
|
||||
members: dict[Role, Set] = Field(default_factory=dict)
|
||||
history: str = "" # For debug
|
||||
|
|
@ -151,6 +152,9 @@ class Environment(BaseModel):
|
|||
"""
|
||||
return self.roles.get(name, None)
|
||||
|
||||
def role_names(self) -> str:
|
||||
return ", ".join([f"{i.name}" for i in self.roles.values()])
|
||||
|
||||
@property
|
||||
def is_idle(self):
|
||||
"""If true, all actions have been executed."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue