🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
refine code
geekan2bae7f2bfb11
diff --git a/metagpt/config.py b/metagpt/config.pyindex 48ac82a3a..bdf580a1f 100644--- a/metagpt/config.py+++ b/metagpt/config.py@@ -45,6 +45,7 @@ class Config(metaclass=Singleton):default_yaml_file = METAGPT_ROOT / "config/config.yaml"def __init__(self, yaml_file=default_yaml_file):+ self._init_cli_paras()self._init_with_config_files_and_env(yaml_file)self._update()logger.debug("Config loading done.")@@ -130,8 +131,20 @@ class Config(metaclass=Singleton):self.workspace_path = Path(self._get("WORKSPACE_PATH", DEFAULT_WORKSPACE_ROOT))self._ensure_workspace_exists()+ def _init_cli_paras(self):+ self.project_path = None+ self.project_name = None+ self.inc = None+ self.reqa_file = None+ self.max_auto_summarize_code = None+def update_via_cli(self, project_path, project_name, inc, reqa_file, max_auto_summarize_code):"""update config via cli"""++ # Use in the PrepareDocuments action according to Section 2.2.3.5.1 of RFC 135.+ if project_path:+ inc = True+ project_name = project_name or Path(project_path).nameself.project_path = project_pathself.project_name = project_nameself.inc = incdiff --git a/metagpt/startup.py b/metagpt/startup.pyindex 047f35cf6..37526dbcc 100644--- a/metagpt/startup.py+++ b/metagpt/startup.py@@ -1,7 +1,6 @@#!/usr/bin/env python# -*- coding: utf-8 -*-import asyncio-from pathlib import Pathimport typer@@ -41,10 +40,6 @@ def startup()from metagpt.team import Team- # Use in the PrepareDocuments action according to Section 2.2.3.5.1 of RFC 135.- if project_path:- inc = True- project_name = project_name or Path(project_path).nameCONFIG.update_via_cli(project_path, project_name, inc, reqa_file, max_auto_summarize_code)company = Team()