From 0c6786feaaac5fa3cd9a684877f5c68450c285d5 Mon Sep 17 00:00:00 2001 From: seehi <6580@pm.me> Date: Mon, 15 Jul 2024 18:22:05 +0800 Subject: [PATCH] update comment --- metagpt/exp_pool/serializers/role_zero.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/metagpt/exp_pool/serializers/role_zero.py b/metagpt/exp_pool/serializers/role_zero.py index 720bf5078..967e53e41 100644 --- a/metagpt/exp_pool/serializers/role_zero.py +++ b/metagpt/exp_pool/serializers/role_zero.py @@ -43,8 +43,14 @@ class RoleZeroSerializer(SimpleSerializer): list[dict]: The filtered request. """ - filtered_req = [ - copy.deepcopy(item) for item in req if "Command Editor.read executed: file_path" in item["content"] - ] + filtered_req = [copy.deepcopy(item) for item in req if self._is_useful_content(item["content"])] return filtered_req + + def _is_useful_content(self, content: str) -> bool: + """Currently, only the content of the file is considered, and more judgments can be added later.""" + + if "Command Editor.read executed: file_path" in content: + return True + + return False