Skip to content

Commit

Permalink
[CLEANUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Mar 30, 2024
1 parent 2b13e86 commit 4e1100e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -996,17 +996,18 @@ from swarms import AutoSwarm, AutoSwarmRouter, BaseSwarm

# Build your own Swarm
class MySwarm(BaseSwarm):
def __init__(self, *args, **kwargs):
def __init__(self, name="kyegomez/myswarm", *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = name

def run(self, task: str, *args, **kwargs):
# Add your multi-agent logic here
# agent 1
# agent 2
# agent 3
return "output of the swarm"


# Add your custom swarm to the AutoSwarmRouter
router = AutoSwarmRouter(
swarms=[MySwarm]
Expand All @@ -1015,7 +1016,7 @@ router = AutoSwarmRouter(

# Create an AutoSwarm instance
autoswarm = AutoSwarm(
name = "AutoSwarm, an API for all swarms",
name="kyegomez/myswarm",
description="A simple API to build and run swarms",
verbose=True,
router=router,
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions playground/structs/build_your_own_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

# Build your own Swarm
class MySwarm(BaseSwarm):
def __init__(self, *args, **kwargs):
def __init__(self, name="kyegomez/myswarm", *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = name

def run(self, task: str, *args, **kwargs):
# Add your multi-agent logic here
Expand All @@ -15,12 +16,14 @@ def run(self, task: str, *args, **kwargs):


# Add your custom swarm to the AutoSwarmRouter
router = AutoSwarmRouter(swarms=[MySwarm])
router = AutoSwarmRouter(
swarms=[MySwarm]
)


# Create an AutoSwarm instance
autoswarm = AutoSwarm(
name="AutoSwarm, an API for all swarms",
name="kyegomez/myswarm",
description="A simple API to build and run swarms",
verbose=True,
router=router,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions swarms/structs/base_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class BaseSwarm(ABC):

def __init__(
self,
# name: str = "Swarm",
agents: List[Agent] = None,
models: List[Any] = None,
max_loops: int = 200,
Expand Down

0 comments on commit 4e1100e

Please sign in to comment.