Skip to content

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

Increase the priority of directly passing configurations through Config.default.

shenchucheng6597141bee79
diff --git a/metagpt/config2.py b/metagpt/config2.py
index 525fe3daf..7b6ddf8c6 100644
--- a/metagpt/config2.py
+++ b/metagpt/config2.py
@@ -110,8 +110,7 @@ class Config(CLIParams, YamlModel):
CONFIG_ROOT / "config2.yaml",
)
if reload or default_config_paths not in _CONFIG_CACHE:
- dicts = [kwargs, dict(os.environ)]
- dicts += [Config.read_yaml(path) for path in default_config_paths]
+ dicts = [dict(os.environ), *(Config.read_yaml(path) for path in default_config_paths), kwargs]
final = merge_dict(dicts)
_CONFIG_CACHE[default_config_paths] = Config(**final)
return _CONFIG_CACHE[default_config_paths]