Add UserRequirement to watch in default if the role is not set to watch

This commit is contained in:
shenchucheng 2023-12-17 00:21:43 +08:00
parent f65c7a0dbe
commit 68f3865893
2 changed files with 17 additions and 1 deletions

View file

@ -121,6 +121,10 @@ class Message(BaseModel):
:param send_to: Specifies the target recipient or consumer for message delivery in the environment.
:param role: Message meta info tells who sent this message.
"""
if not cause_by:
from metagpt.actions import UserRequirement
cause_by = UserRequirement
super().__init__(
id=uuid.uuid4().hex,
content=content,