🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
fixbug: +缺省值
莘权 马ac744062609d
diff --git a/metagpt/actions/action.py b/metagpt/actions/action.pyindex 86a6664ba..10579d4f4 100644--- a/metagpt/actions/action.py+++ b/metagpt/actions/action.py@@ -12,13 +12,14 @@ from typing import Optionalfrom tenacity import retry, stop_after_attempt, wait_fixedfrom metagpt.actions.action_output import ActionOutput+from metagpt.config import Configfrom metagpt.utils.common import OutputParserfrom metagpt.logs import loggerclass Action(ABC):- def __init__(self, options, name: str = '', context=None, llm=None):- self.options = options+ def __init__(self, options=None, name: str = '', context=None, llm=None):+ self.options = options or Config().runtime_optionsself.name: str = nameself.llm = llmself.context = contextdiff --git a/metagpt/roles/role.py b/metagpt/roles/role.pyindex f605f5010..4f46bb973 100644--- a/metagpt/roles/role.py+++ b/metagpt/roles/role.py@@ -103,10 +103,9 @@ class Role:"""Role/Proxy"""def __init__(self, options=None, cost_manager=None, name="", profile="", goal="", constraints="", desc="", *args, **kwargs):- if not options:- options = Config().runtime_options- if not cost_manager:- cost_manager = CostManager(*options)+ options = options or Config().runtime_options+ cost_manager = cost_manager or CostManager(*options)+self._options = Role.supply_options(options=kwargs, default_options=options)name = Role.format_value(name, self._options)