mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
feat: Role有2个动作(action-A和action-B),role是否应该通过给自己发消息触发内部动作循环/执行
This commit is contained in:
parent
2cf28e5a18
commit
3ad3882bd8
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue