mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-24 14:15:17 +02:00
Merge pull request #566 from shenchucheng/fix-options-lookuperror
fix cContextVar OPTIONS LookupError
This commit is contained in:
commit
f65c7a0dbe
2 changed files with 3 additions and 1 deletions
|
|
@ -45,9 +45,11 @@ class Config(metaclass=Singleton):
|
|||
default_yaml_file = METAGPT_ROOT / "config/config.yaml"
|
||||
|
||||
def __init__(self, yaml_file=default_yaml_file):
|
||||
golbal_options = OPTIONS.get()
|
||||
self._init_with_config_files_and_env(yaml_file)
|
||||
logger.debug("Config loading done.")
|
||||
self._update()
|
||||
golbal_options.update(OPTIONS.get())
|
||||
|
||||
def _update(self):
|
||||
# logger.info("Config loading done.")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from loguru import logger
|
|||
|
||||
import metagpt
|
||||
|
||||
OPTIONS = contextvars.ContextVar("OPTIONS")
|
||||
OPTIONS = contextvars.ContextVar("OPTIONS", default={})
|
||||
|
||||
|
||||
def get_metagpt_package_root():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue