mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 09:46:24 +02:00
refactor: According to RFC 113, add message dispatching functionality.
This commit is contained in:
parent
e5c792e512
commit
47d47d274e
2 changed files with 14 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ import platform
|
|||
import re
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
from metagpt.const import MESSAGE_ROUTE_TO_ALL
|
||||
from metagpt.logs import logger
|
||||
|
||||
|
||||
|
|
@ -336,3 +337,14 @@ def any_to_str_set(val) -> set:
|
|||
else:
|
||||
res.add(any_to_str(val))
|
||||
return res
|
||||
|
||||
|
||||
def is_subscribed(message, tags):
|
||||
"""Return whether it's consumer"""
|
||||
if MESSAGE_ROUTE_TO_ALL in message.send_to:
|
||||
return True
|
||||
|
||||
for t in tags:
|
||||
if t in message.send_to:
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue