Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

refactor: replace obj with role

莘权 马d36b4e2088c4
diff --git a/metagpt/environment.py b/metagpt/environment.py
index e9a5c6467..b3c296dac 100644
--- a/metagpt/environment.py
+++ b/metagpt/environment.py
@@ -61,9 +61,9 @@ class Environment(BaseModel):
logger.info(f"publish_message: {message.dump()}")
found = False
# According to the routing feature plan in Chapter 2.2.3.2 of RFC 113
- for obj, subscription in self.consumers.items():
+ for role, subscription in self.consumers.items():
if is_subscribed(message, subscription):
- obj.put_message(message)
+ role.put_message(message)
found = True
if not found:
logger.warning(f"Message no recipients: {message.dump()}")