From 3ad3882bd889a5f1b5c7d5bf0708d1827024cad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 6 May 2024 11:58:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Role=E6=9C=892=E4=B8=AA=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=EF=BC=88action-A=E5=92=8Caction-B=EF=BC=89=EF=BC=8Cro?= =?UTF-8?q?le=E6=98=AF=E5=90=A6=E5=BA=94=E8=AF=A5=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E7=BB=99=E8=87=AA=E5=B7=B1=E5=8F=91=E6=B6=88=E6=81=AF=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=86=85=E9=83=A8=E5=8A=A8=E4=BD=9C=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?/=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/roles/role.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metagpt/roles/role.py b/metagpt/roles/role.py index 80a4d6744..b6f6b7d20 100644 --- a/metagpt/roles/role.py +++ b/metagpt/roles/role.py @@ -443,6 +443,9 @@ class Role(SerializationMixin, ContextMixin, BaseModel): """If the role belongs to env, then the role's messages will be broadcast to env""" if not msg: return + if all(to in {any_to_str(self), self.name} for to in msg.send_to): # Message to myself + self.put_message(msg) + return if not self.rc.env: # If env does not exist, do not publish the message return