Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 12, 2023
1 parent ca606fb commit a500b82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions swarms/swarms/autoscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class AutoScaler:
Args:
initial_agents (int, optional): Number of initial agents. Defaults to 10.
scale_up_factor (int, optional): Scale up factor. Defaults to 1.
idle_threshold (float, optional): Idle threshold. Defaults to 0.2.
busy_threshold (float, optional): Busy threshold. Defaults to 0.7.
agent ([type], optional): Agent. Defaults to None.
Methods:
add_task: Add task to queue
Expand All @@ -29,7 +29,7 @@ class AutoScaler:
monitor_and_scale: Monitor and scale
start: Start scaling
del_agent: Delete an agent
Usage
```
# usage of usage
Expand Down
13 changes: 6 additions & 7 deletions swarms/swarms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
from typing import Optional, List, Dict, Any
from swarms.workers.base import AbstractWorker


class AbstractSwarm(ABC):
"""
Abstract class for swarm simulation architectures
"""

# TODO: Pass in abstract LLM class that can utilize Hf or Anthropic models, Move away from OPENAI
# TODO: ADD Universal Communication Layer, a ocean vectorstore instance
# TODO: BE MORE EXPLICIT ON TOOL USE, TASK DECOMPOSITION AND TASK COMPLETETION AND ALLOCATION
Expand Down Expand Up @@ -67,17 +69,17 @@ def direct_message(
):
"""Send a direct message to a worker"""
pass

@abstractmethod
def autoscaler(self, num_workers: int, worker: ["AbstractWorker"]):
"""Autoscaler that acts like kubernetes for autonomous agents"""
pass

@abstractmethod
def get_worker_by_id(self, id: str) -> "AbstractWorker":
"""Locate a worker by id"""
pass

@abstractmethod
def get_worker_by_name(self, name: str) -> "AbstractWorker":
"""Locate a worker by name"""
Expand All @@ -91,7 +93,7 @@ def assign_task(self, worker: "AbstractWorker", task: Any) -> Dict:
@abstractmethod
def get_all_tasks(self, worker: "AbstractWorker", task: Any):
"""Get all tasks"""

@abstractmethod
def get_finished_tasks(self) -> List[Dict]:
"""Get all finished tasks"""
Expand Down Expand Up @@ -156,6 +158,3 @@ def get_swarm_status(self) -> Dict:
def save_swarm_state(self):
"""Save the swarm state"""
pass



0 comments on commit a500b82

Please sign in to comment.