From 6597141bee79165d526b8cc0bfd2a95187854773 Mon Sep 17 00:00:00 2001 From: shenchucheng Date: Tue, 27 Aug 2024 23:32:54 +0800 Subject: [PATCH] Increase the priority of directly passing configurations through Config.default. --- metagpt/config2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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]