From cf26ebdb2bdd51e8d7b43c5b583ad607d446a115 Mon Sep 17 00:00:00 2001 From: Kye Date: Sun, 24 Sep 2023 20:09:11 -0400 Subject: [PATCH] playground --- playground/orchestrate.py | 14 ++++++++++++++ playground/workflow.py | 11 ++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 playground/orchestrate.py diff --git a/playground/orchestrate.py b/playground/orchestrate.py new file mode 100644 index 00000000..c52c732a --- /dev/null +++ b/playground/orchestrate.py @@ -0,0 +1,14 @@ +from swarms import Worker, Orchestrator + +node = Worker( + openai_api_key="", + 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?") \ No newline at end of file diff --git a/playground/workflow.py b/playground/workflow.py index fc03f38a..a40fe605 100644 --- a/playground/workflow.py +++ b/playground/workflow.py @@ -1,6 +1,11 @@ -from swarms.structs.workflow import Workflow -workflow = Workflow() +from swarms import Workflow +from swarms.tools.autogpt import ChatOpenAI -workflow.add('Find 50 ceos in linkedin in agriculture ') +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()