You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
379 B
20 lines
379 B
1 year ago
|
from swarms import Worker, Orchestrator
|
||
|
|
||
|
node = Worker(
|
||
|
openai_api_key="",
|
||
|
ai_name="Optimus Prime",
|
||
|
)
|
||
|
|
||
|
|
||
|
# Instantiate the Orchestrator with 10 agents
|
||
1 year ago
|
orchestrator = Orchestrator(
|
||
|
node, agent_list=[node] * 10, task_queue=[]
|
||
|
)
|
||
1 year ago
|
|
||
|
# Agent 7 sends a message to Agent 9
|
||
1 year ago
|
orchestrator.chat(
|
||
1 year ago
|
sender_id=7,
|
||
|
receiver_id=9,
|
||
|
message="Can you help me with this task?",
|
||
1 year ago
|
)
|