feat: merge geekan:main

This commit is contained in:
莘权 马 2023-12-22 16:50:04 +08:00
parent 9a1909bb95
commit bf15613f63
2 changed files with 19 additions and 20 deletions

View file

@ -30,7 +30,6 @@ import loguru
from pydantic.json import pydantic_encoder
from tenacity import RetryCallState, _utils
from metagpt.config import CONFIG
from metagpt.const import MESSAGE_ROUTE_TO_ALL
from metagpt.logs import logger
from metagpt.utils.exceptions import handle_exception
@ -418,24 +417,6 @@ def any_to_name(val):
return any_to_str(val).split(".")[-1]
def format_value(value):
"""Fill parameters inside `value` with `options`."""
if not isinstance(value, str):
return value
if "{" not in value:
return value
merged_opts = CONFIG.options or {}
try:
return value.format(**merged_opts)
except KeyError as e:
logger.warning(f"Parameter is missing:{e}")
for k, v in merged_opts.items():
value = value.replace("{" + f"{k}" + "}", str(v))
return value
def concat_namespace(*args) -> str:
return ":".join(str(value) for value in args)