feat: remove all unnecessary CONTEXT references

feat: replace CONTEXT with local context
This commit is contained in:
莘权 马 2024-01-17 18:11:42 +08:00
parent dddf50112a
commit d5ac56f863
66 changed files with 350 additions and 349 deletions

View file

@ -84,7 +84,10 @@ class Config(CLIParams, YamlModel):
@classmethod
def from_home(cls, path):
"""Load config from ~/.metagpt/config.yaml"""
return Config.from_yaml_file(CONFIG_ROOT / path)
pathname = CONFIG_ROOT / path
if not pathname.exists():
return None
return Config.from_yaml_file(pathname)
@classmethod
def default(cls):