mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-03 04:42:38 +02:00
refactor: According to RFC 116: Updated the type of send_to.
This commit is contained in:
parent
47d47d274e
commit
7e83a4bb31
1 changed files with 6 additions and 7 deletions
|
|
@ -60,7 +60,7 @@ class Trump(Role):
|
|||
async def _observe(self) -> int:
|
||||
await super()._observe()
|
||||
# accept messages sent (from opponent) to self, disregard own messages from the last round
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.contain_any({self.name})]
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.send_to == {self.name}]
|
||||
return len(self._rc.news)
|
||||
|
||||
async def _act(self) -> Message:
|
||||
|
|
@ -78,8 +78,8 @@ class Trump(Role):
|
|||
content=rsp,
|
||||
role=self.profile,
|
||||
cause_by=ShoutOut,
|
||||
msg_from=self.name,
|
||||
msg_to=self.opponent_name,
|
||||
sent_from=self.name,
|
||||
send_to=self.opponent_name,
|
||||
)
|
||||
|
||||
return msg
|
||||
|
|
@ -102,8 +102,7 @@ class Biden(Role):
|
|||
await super()._observe()
|
||||
# accept the very first human instruction (the debate topic) or messages sent (from opponent) to self,
|
||||
# disregard own messages from the last round
|
||||
message_filter = {BossRequirement, self.name}
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.contain_any(message_filter)]
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.cause_by == BossRequirement or msg.send_to == {self.name}]
|
||||
return len(self._rc.news)
|
||||
|
||||
async def _act(self) -> Message:
|
||||
|
|
@ -121,8 +120,8 @@ class Biden(Role):
|
|||
content=rsp,
|
||||
role=self.profile,
|
||||
cause_by=ShoutOut,
|
||||
msg_from=self.name,
|
||||
msg_to=self.opponent_name,
|
||||
sent_from=self.name,
|
||||
send_to=self.opponent_name,
|
||||
)
|
||||
|
||||
return msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue