🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
refine code
geekan67de31324834
diff --git a/metagpt/config.py b/metagpt/config.pyindex 386c4784e..50ad6a3b2 100644--- a/metagpt/config.py+++ b/metagpt/config.py@@ -131,6 +131,14 @@ class Config(metaclass=Singleton):self.workspace_path = Path(self._get("WORKSPACE_PATH", DEFAULT_WORKSPACE_ROOT))self._ensure_workspace_exists()+ def update_via_cli(self, project_path, project_name, inc, reqa_file, max_auto_summarize_code):+ """update config via cli"""+ self.project_path = project_path+ self.project_name = project_name+ self.inc = inc+ self.reqa_file = reqa_file+ self.max_auto_summarize_code = max_auto_summarize_code+def _ensure_workspace_exists(self):self.workspace_path.mkdir(parents=True, exist_ok=True)logger.debug(f"WORKSPACE_PATH set to {self.workspace_path}")diff --git a/metagpt/repo_parser.py b/metagpt/repo_parser.pyindex 9a1218ef1..3524a5bce 100644--- a/metagpt/repo_parser.py+++ b/metagpt/repo_parser.py@@ -96,4 +96,4 @@ def error():if __name__ == "__main__":- error()+ main()diff --git a/metagpt/startup.py b/metagpt/startup.pyindex 17eb26665..6ae47213e 100644--- a/metagpt/startup.py+++ b/metagpt/startup.py@@ -27,8 +27,8 @@ def startup(reqa_file: str = typer.Option(default="", help="Specify the source file name for rewriting the quality test code."),max_auto_summarize_code: int = typer.Option(default=-1,- help="The maximum number of times the 'SummarizeCode' action is automatically invoked, "- "with -1 indicating unlimited. This parameter is used for debugging the workflow.",+ help="The maximum number of times the 'SummarizeCode' action is automatically invoked, with -1 indicating "+ "unlimited. This parameter is used for debugging the workflow.",),recover_path: str = typer.Option(default=None, help="recover the project from existing serialized storage")):@@ -43,14 +43,10 @@ def startup(from metagpt.team import Team# Use in the PrepareDocuments action according to Section 2.2.3.5.1 of RFC 135.- CONFIG.project_path = project_pathif project_path:inc = Trueproject_name = project_name or Path(project_path).name- CONFIG.project_name = project_name- CONFIG.inc = inc- CONFIG.reqa_file = reqa_file- CONFIG.max_auto_summarize_code = max_auto_summarize_code+ CONFIG.update_via_cli(project_path, project_name, inc, reqa_file, max_auto_summarize_code)if not recover_path:company = Team()