mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 13:22:39 +02:00
feat: replaced with OPTIONS
This commit is contained in:
parent
3a1ebf19b7
commit
143ffb0c2c
39 changed files with 144 additions and 252 deletions
|
|
@ -259,18 +259,3 @@ def parse_recipient(text):
|
|||
recipient = re.search(pattern, text)
|
||||
return recipient.group(1) if recipient else ""
|
||||
|
||||
|
||||
def initialize_environment(options=None):
|
||||
"""Load `config/config.yaml` to `os.environ`"""
|
||||
if options:
|
||||
for k, v in options.items():
|
||||
os.environ[k] = str(v)
|
||||
return
|
||||
|
||||
yaml_file_path = Path(__file__).resolve().parent.parent.parent / "config/config.yaml"
|
||||
if not yaml_file_path.exists():
|
||||
return
|
||||
with open(str(yaml_file_path), "r") as yaml_file:
|
||||
data = yaml.safe_load(yaml_file)
|
||||
for k, v in data.items():
|
||||
os.environ[k] = str(v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue