mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 11:56:24 +02:00
update field definition of scratch
This commit is contained in:
parent
cc9d8e9673
commit
59db59ec65
3 changed files with 6 additions and 8 deletions
|
|
@ -2,8 +2,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Desc : dummy action to make every STRole can deal DummyMessage which is caused by DummyAction
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from metagpt.actions import Action
|
||||
from metagpt.schema import Message
|
||||
|
||||
|
|
@ -13,7 +11,6 @@ class DummyAction(Action):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
@dataclass
|
||||
class DummyMessage(Message):
|
||||
"""
|
||||
dummy message to pass to role and make them to have a execution every round
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from typing import Optional, Union
|
||||
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
|
|
@ -25,7 +25,7 @@ class Scratch(BaseModel):
|
|||
|
||||
# 类别2:世界信息
|
||||
curr_time: Optional[datetime] = Field(default=None)
|
||||
curr_tile: Optional[str] = Field(default=None)
|
||||
curr_tile: Optional[list[int]] = Field(default=None)
|
||||
daily_plan_req: Optional[str] = Field(default=None)
|
||||
|
||||
# 类别3:人物角色的核心身份
|
||||
|
|
@ -59,8 +59,8 @@ class Scratch(BaseModel):
|
|||
|
||||
# 类别6:个人计划
|
||||
daily_req: list[str] = Field(default=[])
|
||||
f_daily_schedule: list[list[str]] = Field(default=[])
|
||||
f_daily_schedule_hourly_org: list[list[str]] = Field(default=[])
|
||||
f_daily_schedule: list[list[Union[int, str]]] = Field(default=[])
|
||||
f_daily_schedule_hourly_org: list[list[Union[int, str]]] = Field(default=[])
|
||||
|
||||
# 类别7:当前动作
|
||||
act_address: Optional[str] = Field(default=None)
|
||||
|
|
@ -90,7 +90,7 @@ class Scratch(BaseModel):
|
|||
values["act_obj_event"] = (values["name"], None, None)
|
||||
return values
|
||||
|
||||
@field_validator("curr_time", "act_start_time", "chatting_end_time")
|
||||
@field_validator("curr_time", "act_start_time", "chatting_end_time", mode="before")
|
||||
@classmethod
|
||||
def check_time_filed(cls, time_filed):
|
||||
val = datetime.strptime(time_filed, "%B %d, %Y, %H:%M:%S") if time_filed else None
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ async def startup(
|
|||
):
|
||||
town = StanfordTown()
|
||||
logger.info("StanfordTown init environment")
|
||||
print(f"{fork_sim_code}\t{sim_code}{temp_storage_path}\t{investment}\t{n_round}")
|
||||
|
||||
# copy `storage/{fork_sim_code}` to `storage/{sim_code}`
|
||||
copy_folder(str(STORAGE_PATH.joinpath(fork_sim_code)), str(STORAGE_PATH.joinpath(sim_code)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue