clean up worker

Former-commit-id: 46b80f0290
group-chat
Kye 1 year ago
parent fcbb5b1d43
commit 465c167cd9

@ -8,6 +8,7 @@ class MultiAgentDebate:
def run(self, task: str): def run(self, task: str):
results = [] results = []
for i in range(len(self.agents)): for i in range(len(self.agents)):
# Select the speaker based on the selection function # Select the speaker based on the selection function
speaker_idx = self.selection_func(i, self.agents) speaker_idx = self.selection_func(i, self.agents)
@ -25,10 +26,14 @@ def select_speaker(step: int, agents: List[Worker]) -> int:
return step % len(agents) return step % len(agents)
# Initialize agents # Initialize agents
worker1 = Worker(openai_api_key="", ai_name="Optimus Prime")
worker2 = Worker(openai_api_key="", ai_name="Bumblebee")
worker3 = Worker(openai_api_key="", ai_name="Megatron")
agents = [ agents = [
Worker(openai_api_key="", ai_name="Optimus Prime"), worker1,
Worker(openai_api_key="", ai_name="Bumblebee"), worker2,
Worker(openai_api_key="", ai_name="Megatron") worker3
] ]
# Initialize multi-agent debate with the selection function # Initialize multi-agent debate with the selection function

Loading…
Cancel
Save