mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
fixbug: +缺省值
This commit is contained in:
parent
c677897561
commit
ac74406260
2 changed files with 6 additions and 6 deletions
|
|
@ -12,13 +12,14 @@ from typing import Optional
|
|||
from tenacity import retry, stop_after_attempt, wait_fixed
|
||||
|
||||
from metagpt.actions.action_output import ActionOutput
|
||||
from metagpt.config import Config
|
||||
from metagpt.utils.common import OutputParser
|
||||
from metagpt.logs import logger
|
||||
|
||||
|
||||
class 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_options
|
||||
self.name: str = name
|
||||
self.llm = llm
|
||||
self.context = context
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue