Former-commit-id: 9823f3da56
pull/47/head
Kye 1 year ago
parent bedbbec742
commit b0a0845d3c

@ -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")

@ -123,7 +123,7 @@ class HierarchicalSwarm:
logging.error(f"Failed to initialize vector store: {e}") logging.error(f"Failed to initialize vector store: {e}")
return None 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 Init WorkerNode

Loading…
Cancel
Save