From 882b6f83667ce4a5e110ba53ae0702390d59b9c0 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 25 Sep 2023 13:23:24 -0400 Subject: [PATCH] clean up --- dialogue_simulator.py | 13 +++++++++++-- swarms/swarms/dialogue_simulator.py | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dialogue_simulator.py b/dialogue_simulator.py index 3aa12763..72c4e45c 100644 --- a/dialogue_simulator.py +++ b/dialogue_simulator.py @@ -4,6 +4,15 @@ worker1 = Worker(ai_name="Plinus", openai_api_key="") worker2 = Worker(ai_name="Optimus Prime", openai_api_key="") collab = DialogueSimulator([worker1, worker2], DialogueSimulator.select_next_speaker) -collab.reset() +collab.step() -collab.start("My name is Plinus and I am a worker", "How are you?") \ No newline at end of file +# collab.start("My name is Plinus and I am a worker", "How are you?") + +max_iters = 6 +n = 0 + +while n < max_iters: + collab.start("My name is Plinus and I am a worker", "How are you?") + print(f"({name}): {message}") + print("\n") + n += 1 \ No newline at end of file diff --git a/swarms/swarms/dialogue_simulator.py b/swarms/swarms/dialogue_simulator.py index 623acd4a..7455366a 100644 --- a/swarms/swarms/dialogue_simulator.py +++ b/swarms/swarms/dialogue_simulator.py @@ -6,15 +6,15 @@ class DialogueSimulator: def __init__( self, agents: List[Worker], - selection_func + selection_func: Callable[[int, List[Worker]], int], ): self.agents = agents self._step = 0 self.select_next_speaker = selection_func - def reset(self): - for agent in self.agents: - agent.reset() + # def reset(self): + # for agent in self.agents: + # agent.reset() def start(self, name: str, message: str): #init conv with a message from name