mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 09:46:24 +02:00
refactor: rename is_recipient
This commit is contained in:
parent
93ebe8c103
commit
af4c87e123
8 changed files with 19 additions and 19 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.is_recipient({self.name})]
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.contain_any({self.name})]
|
||||
return len(self._rc.news)
|
||||
|
||||
async def _act(self) -> Message:
|
||||
|
|
@ -103,7 +103,7 @@ class Biden(Role):
|
|||
# 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.is_recipient(message_filter)]
|
||||
self._rc.news = [msg for msg in self._rc.news if msg.contain_any(message_filter)]
|
||||
return len(self._rc.news)
|
||||
|
||||
async def _act(self) -> Message:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue