🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
add revise_mode=HUMAN_REVIEW to support human_review and auto_revise
better62932ae369c00a7
diff --git a/metagpt/actions/action_node.py b/metagpt/actions/action_node.pyindex 6dca00df0..2d6782952 100644--- a/metagpt/actions/action_node.py+++ b/metagpt/actions/action_node.py@@ -29,8 +29,9 @@ class ReviewMode(Enum):class ReviseMode(Enum):- HUMAN = "human"- AUTO = "auto"+ HUMAN = "human" # human revise+ HUMAN_REVIEW = "human_review" # human-review and auto-revise+ AUTO = "auto" # auto-review and auto-reviseTAG = "CONTENT"@@ -540,10 +541,16 @@ class ActionNode:nodes_output[key] = {"value": value, "comment": review_comments[key]}return nodes_output- async def auto_revise(self, template: str = REVISE_TEMPLATE) -> dict[str, str]:+ async def auto_revise(+ self, revise_mode: ReviseMode = ReviseMode.AUTO, template: str = REVISE_TEMPLATE+ ) -> dict[str, str]:"""revise the value of incorrect keys"""# generate review comments- review_comments: dict = await self.auto_review()+ if revise_mode == ReviseMode.AUTO:+ review_comments: dict = await self.auto_review()+ elif revise_mode == ReviseMode.HUMAN_REVIEW:+ review_comments: dict = await self.human_review()+include_keys = list(review_comments.keys())# generate revise content@@ -575,7 +582,7 @@ class ActionNode:if revise_mode == ReviseMode.HUMAN:revise_contents = await self.human_revise()else:- revise_contents = await self.auto_revise()+ revise_contents = await self.auto_revise(revise_mode)return revise_contents