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.
24 lines
485 B
24 lines
485 B
from swarms import Worker, Orchestrator
|
|
|
|
api_key = os.getenv("OPENAI_API_KEY")
|
|
org_id = os.getenv("OPENAI_ORG_ID")
|
|
|
|
node = Worker(
|
|
openai_api_key=api_key,
|
|
openai_org_id=org_id,
|
|
ai_name="Optimus Prime",
|
|
)
|
|
|
|
|
|
# Instantiate the Orchestrator with 10 agents
|
|
orchestrator = Orchestrator(
|
|
node, agent_list=[node] * 10, task_queue=[]
|
|
)
|
|
|
|
# Agent 7 sends a message to Agent 9
|
|
orchestrator.chat(
|
|
sender_id=7,
|
|
receiver_id=9,
|
|
message="Can you help me with this task?",
|
|
)
|