From 93ebe8c103388ffbe48119b0600ea0bd4c55b64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Tue, 7 Nov 2023 14:12:20 +0800 Subject: [PATCH] feat: recover `history` --- metagpt/environment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metagpt/environment.py b/metagpt/environment.py index a7e6322ff..75a790714 100644 --- a/metagpt/environment.py +++ b/metagpt/environment.py @@ -29,6 +29,7 @@ class Environment(BaseModel): roles: dict[str, Role] = Field(default_factory=dict) consumers: dict[Role, Set] = Field(default_factory=dict) + history: str = Field(default="") # For debug class Config: arbitrary_types_allowed = True @@ -67,6 +68,7 @@ class Environment(BaseModel): found = True if not found: logger.warning(f"Message no recipients: {message.dump()}") + self.history += f"\n{message}" # For debug return True