mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Refactor: Update message publishing logic to handle multiple recipients
This commit is contained in:
parent
991bfd6f68
commit
351cf18c3a
1 changed files with 5 additions and 5 deletions
|
|
@ -31,11 +31,11 @@ class MGXEnv(Environment):
|
|||
|
||||
if user_defined_recipient:
|
||||
# human user's direct chat message to a certain role
|
||||
|
||||
if self.get_role(user_defined_recipient).is_idle:
|
||||
# User starts a new direct chat with a certain role, expecting a direct chat response from the role; Other roles including TL should not be involved.
|
||||
# If the role is not idle, it means the user helps the role with its current work, in this case, we handle the role's response message as usual.
|
||||
self.direct_chat_roles.add(user_defined_recipient)
|
||||
for role_name in message.send_to:
|
||||
if self.get_role(role_name).is_idle:
|
||||
# User starts a new direct chat with a certain role, expecting a direct chat response from the role; Other roles including TL should not be involved.
|
||||
# If the role is not idle, it means the user helps the role with its current work, in this case, we handle the role's response message as usual.
|
||||
self.direct_chat_roles.add(role_name)
|
||||
|
||||
self._publish_message(message)
|
||||
# # bypass team leader, team leader only needs to know but not to react (commented out because TL doesn't understand the message well in actual experiments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue