ChatWorld / src /user.py
JiangYH's picture
Upload folder using huggingface_hub
6f179e7 verified
raw
history blame
495 Bytes
from pydantic import BaseModel
UUID = str
class Role(BaseModel):
role_name: str
role_nickname: str = None
model_role_name: str
model_role_nickname: str = None
class User:
history: list[str] = []
role_name: str = None
role_nickname: str = None
model_role_name: str = None
model_role_nickname: str = None
def update(self, new_properties: dict) -> "User":
for k, v in new_properties.items():
setattr(self, k, v)
return self