Former-commit-id: 0e7762a7a6
group-chat
Kye 1 year ago
parent adc9b9365d
commit 480050d576

@ -0,0 +1,9 @@
from swarms import DialogueSimulator, Worker
def select_next_speaker(step: int, agents) -> int:
idx = (step) % len(agents)
return idx
debate = DialogueSimulator(Worker, select_next_speaker)
debate.run()

@ -1,12 +0,0 @@
def select_next_speaker(
step: int,
agents,
director
) -> int:
#if the step if even => director
#=> director selects next speaker
if step % 2 == 1:
idx = 0
else:
idx = director.select_next_speaker() + 1
return idx

@ -11,6 +11,19 @@ bid_parser = BidOutputParser(
regex=r"<(\d+)>", output_keys=["bid"], default_output_key="bid"
)
def select_next_speaker(
step: int,
agents,
director
) -> int:
#if the step if even => director
#=> director selects next speaker
if step % 2 == 1:
idx = 0
else:
idx = director.select_next_speaker() + 1
return idx
#main
class MultiAgentCollaboration:

@ -1,11 +0,0 @@
from swarms import Workflow
from swarms.tools.autogpt import ChatOpenAI
workflow = Workflow(ChatOpenAI)
workflow.add("What's the weather in miami")
workflow.add("Provide details for {{ parent_output }}")
workflow.add("Summarize the above information: {{ parent_output}}")
workflow.run()
Loading…
Cancel
Save