reformatting done

This commit is contained in:
Abhishek 2024-03-08 08:15:13 +00:00
parent a5f278c297
commit cbfbecb487
2 changed files with 7 additions and 34 deletions

View file

@ -11,6 +11,7 @@ import platform
from typing import Any
import fire
from metagpt.actions import Action, UserRequirement
from metagpt.logs import logger
from metagpt.roles import Role
@ -34,9 +35,7 @@ class SpeakAloud(Action):
name: str = "SpeakAloud"
async def run(self, context: str, name: str, opponent_name: str):
prompt = self.PROMPT_TEMPLATE.format(
context=context, name=name, opponent_name=opponent_name
)
prompt = self.PROMPT_TEMPLATE.format(context=context, name=name, opponent_name=opponent_name)
# logger.info(prompt)
rsp = await self._aask(prompt)
@ -68,9 +67,7 @@ class Debator(Role):
context = "\n".join(f"{msg.sent_from}: {msg.content}" for msg in memories)
# print(context)
rsp = await todo.run(
context=context, name=self.name, opponent_name=self.opponent_name
)
rsp = await todo.run(context=context, name=self.name, opponent_name=self.opponent_name)
msg = Message(
content=rsp,
@ -91,9 +88,7 @@ async def debate(idea: str, investment: float = 3.0, n_round: int = 5):
team = Team()
team.hire([Biden, Trump])
team.invest(investment)
team.run_project(
idea, send_to="Biden"
) # send debate topic to Biden and let him speak first
team.run_project(idea, send_to="Biden") # send debate topic to Biden and let him speak first
await team.run(n_round=n_round)
@ -111,6 +106,4 @@ def main(idea: str, investment: float = 3.0, n_round: int = 10):
if __name__ == "__main__":
fire.Fire(
main
) # run as python debate.py --idea="TOPIC" --investment=3.0 --n_round=5
fire.Fire(main) # run as python debate.py --idea="TOPIC" --investment=3.0 --n_round=5