🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
refactor: rename
莘权 马23749212bfe3
diff --git a/metagpt/roles/role.py b/metagpt/roles/role.pyindex 5c512b0f0..a8280cecf 100644--- a/metagpt/roles/role.py+++ b/metagpt/roles/role.py@@ -255,16 +255,16 @@ class Role:logger.debug(f"{self._setting}: {self._rc.state=}, will do {self._rc.todo}")return await self._act()- async def run(self, test_message=None):+ async def run(self, with_message=None):"""Observe, and think and act based on the results of the observation"""- if test_message: # For test+ if with_message: # For testmsg = None- if isinstance(test_message, str):- msg = Message(test_message)- elif isinstance(test_message, Message):- msg = test_message- elif isinstance(test_message, list):- msg = Message("\n".join(test_message))+ if isinstance(with_message, str):+ msg = Message(with_message)+ elif isinstance(with_message, Message):+ msg = with_message+ elif isinstance(with_message, list):+ msg = Message("\n".join(with_message))self.put_message(msg)if not await self._observe():