clean up worker

Former-commit-id: 35ed6245290d3bfed82971a099bb6e68cba0460a
pull/160/head
Kye 2 years ago
parent 5b48e5c825
commit 14c4c40b69

@ -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