Skip to content

Commit

Permalink
refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
geekan committed Dec 22, 2023
1 parent 3feee73 commit 336350e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/debate_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
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))
2 changes: 1 addition & 1 deletion metagpt/roles/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ async def _think(self) -> None:

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,
Expand Down

0 comments on commit 336350e

Please sign in to comment.