This commit is contained in:
yzlin 2024-04-25 21:41:02 +08:00
parent 872ac85de5
commit c63a7ecc18
2 changed files with 4 additions and 1 deletions

View file

@ -24,6 +24,7 @@ class MGXEnv(Environment):
else:
# every regular message goes through team leader
message.send_to.add(tl.name)
tl.put_message(message)
return True

View file

@ -110,7 +110,9 @@ class TeamLeader(Role):
"""Useful in 'react' mode. Return a Message conforming to Role._act interface."""
self.run_commands(self.commands)
self.task_result = TaskResult(result="Success", is_success=True)
return Message(content="Commands executed", role="assistant")
msg = Message(content="Commands executed", role="user", send_to=self)
self.rc.memory.add(msg)
return msg
def publish_message(self, msg):
"""If the role belongs to env, then the role's messages will be broadcast to env"""