From 23749212bfe3b705f0f47758c4dca42efe337eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Sun, 12 Nov 2023 17:41:51 +0800 Subject: [PATCH] refactor: rename --- metagpt/roles/role.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/metagpt/roles/role.py b/metagpt/roles/role.py index 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 test msg = 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():