diff --git a/playground/DIY/hierchical.py b/playground/DIY/hierchical.py new file mode 100644 index 00000000..983c1875 --- /dev/null +++ b/playground/DIY/hierchical.py @@ -0,0 +1,29 @@ +from swarms import HierarchicalSwarm + + +swarm = HierarchicalSwarm( + openai_api_key="key", + model_type="openai", + model_id="gpt-4", + use_vectorstore=False, + use_async=False, + human_in_the_loop=False, + logging_enabled=False +) + +#run the swarm with an objective +result = swarm.run("Design a new car") + +#or huggingface +swarm = HierarchicalSwarm( + model_type="huggingface", + model_id="tiaueu/falcon", + use_vectorstore=True, + embedding_size=768, + use_async=False, + human_in_the_loop=True, + logging_enabled=False, +) + +# Run the swarm with a particular objective +result = swarm.run("Write a sci-fi short story") diff --git a/swarms/swarms.py b/swarms/swarms.py index c47cf93d..8081713f 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -123,7 +123,7 @@ class HierarchicalSwarm: logging.error(f"Failed to initialize vector store: {e}") return None - def initialize_worker_node(self, worker_tools, vectorstore, llm_class=ChatOpenAI, ai_name="Swarm Worker AI Assistant", human_in_the_loop=True): + def initialize_worker_node(self, worker_tools, vectorstore, llm_class=ChatOpenAI, ai_name="Swarm Worker AI Assistant",): """ Init WorkerNode