From 336350eba9db48c33d1049218eb9bfc088e6958e Mon Sep 17 00:00:00 2001 From: geekan Date: Fri, 22 Dec 2023 22:49:13 +0800 Subject: [PATCH] refine code --- examples/debate_simple.py | 6 +++--- metagpt/roles/role.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/debate_simple.py b/examples/debate_simple.py index fe04a7d1a..1a80bf8f4 100644 --- a/examples/debate_simple.py +++ b/examples/debate_simple.py @@ -12,11 +12,11 @@ from metagpt.environment import Environment from metagpt.roles import Role from metagpt.team import Team -action1 = Action(name="BidenSay", instruction="Passionately refute Trump's latest news, and strive to gain votes") -action2 = Action(name="TrumpSay", instruction="Passionately refute Biden's latest news, and strive to gain votes") +action1 = Action(name="BidenSay", instruction="Express opinions and argue vigorously, and strive to gain votes") +action2 = Action(name="TrumpSay", instruction="Express opinions and argue vigorously, and strive to gain votes") biden = Role(name="Biden", profile="Democratic candidate", goal="Win the election", actions=[action1], watch=[action2]) trump = Role(name="Trump", profile="Republican candidate", goal="Win the election", actions=[action2], watch=[action1]) env = Environment(desc="US election live broadcast") team = Team(investment=10.0, env=env, roles=[biden, trump]) -asyncio.run(team.run(idea="Topic: Climate Change", send_to="Biden", n_round=5)) +asyncio.run(team.run(idea="Topic: climate change. Under 80 words per message.", send_to="Biden", n_round=5)) diff --git a/metagpt/roles/role.py b/metagpt/roles/role.py index e5142fbec..6a7cc32ec 100644 --- a/metagpt/roles/role.py +++ b/metagpt/roles/role.py @@ -390,7 +390,7 @@ class Role(BaseModel): async def _act(self) -> Message: logger.info(f"{self._setting}: to do {self._rc.todo}({self._rc.todo.name})") - response = await self._rc.todo.run(self._rc.important_memory) + response = await self._rc.todo.run(self._rc.history) if isinstance(response, (ActionOutput, ActionNode)): msg = Message( content=response.content,