Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

Merge branch 'dev' into v0.5-release

geekan1073ffd60dd7
diff --cc metagpt/config.py
index d7f5c1249,a0d61b39f..d4e85ca7b
--- a/metagpt/config.py
+++ b/metagpt/config.py
@@@ -45,11 -55,36 +55,39 @@@ class Config(metaclass=Singleton)
default_yaml_file = METAGPT_ROOT / "config/config.yaml"
def __init__(self, yaml_file=default_yaml_file):
++
+ golbal_options = OPTIONS.get()
+ # cli paras
+ self.project_path = ""
+ self.project_name = ""
+ self.inc = False
+ self.reqa_file = ""
+ self.max_auto_summarize_code = 0
+
self._init_with_config_files_and_env(yaml_file)
- logger.debug("Config loading done.")
self._update()
+ golbal_options.update(OPTIONS.get())
+ logger.debug("Config loading done.")
+ logger.info(f"OpenAI API Model: {self.openai_api_model}")
+
+ def get_default_llm_provider_enum(self):
+ if self._is_valid_llm_key(self.openai_api_key):
+ llm = LLMProviderEnum.OPENAI
+ elif self._is_valid_llm_key(self.anthropic_api_key):
+ llm = LLMProviderEnum.ANTHROPIC
+ elif self._is_valid_llm_key(self.zhipuai_api_key):
+ llm = LLMProviderEnum.ZHIPUAI
+ elif self._is_valid_llm_key(self.fireworks_api_key):
+ llm = LLMProviderEnum.FIREWORKS
+ elif self.open_llm_api_base:
+ llm = LLMProviderEnum.OPEN_LLM
+ else:
+ raise NotConfiguredException("You should config a LLM configuration first")
+ return llm
+
+ @staticmethod
+ def _is_valid_llm_key(k) -> bool:
+ return k and k != "YOUR_API_KEY"
def _update(self):
# logger.info("Config loading done.")
diff --cc metagpt/startup.py
index e886ad2a4,37526dbcc..a89b9c5e9
--- a/metagpt/startup.py
+++ b/metagpt/startup.py
@@@ -26,8 -25,9 +25,9 @@@ 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,
+ default=0,
- 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.",
),
):
"""Run a startup. Be a boss."""
diff --cc setup.py
index 57290f4cd,320230a7f..8ef2a6946
--- a/setup.py
+++ b/setup.py
@@@ -30,8 -30,8 +30,8 @@@ with open(path.join(here, "requirements
setup(
name="metagpt",
- version="0.5.1",
+ version="0.5.2",
- description="The Multi-Role Meta Programming Framework",
+ description="The Multi-Agent Framework",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/geekan/MetaGPT",