mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 22:02:38 +02:00
fix planner serialization bug, add test data
This commit is contained in:
parent
f9519ca417
commit
56f5dc9f2e
6 changed files with 911 additions and 28 deletions
|
|
@ -32,8 +32,8 @@ class Planner(BaseModel):
|
|||
auto_run: bool = False
|
||||
use_tools: bool = False
|
||||
|
||||
def __init__(self, goal: str, **kwargs):
|
||||
plan = Plan(goal=goal)
|
||||
def __init__(self, goal: str = "", plan: Plan = None, **kwargs):
|
||||
plan = plan or Plan(goal=goal)
|
||||
super().__init__(plan=plan, **kwargs)
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
actions: list[SerializeAsAny[Action]] = Field(default=[], validate_default=True)
|
||||
rc: RoleContext = Field(default_factory=RoleContext)
|
||||
addresses: set[str] = set()
|
||||
planner: Planner = None
|
||||
planner: Planner = Field(default_factory=Planner)
|
||||
|
||||
# builtin variables
|
||||
recovered: bool = False # to tag if a recovered role
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue