pull/64/head
Kye 2 years ago
parent ca606fb92e
commit a500b8298d

@ -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
@ -29,7 +29,7 @@ class AutoScaler:
monitor_and_scale: Monitor and scale
start: Start scaling
del_agent: Delete an agent
Usage
```
# usage of usage

@ -2,11 +2,13 @@ from abc import ABC, abstractmethod
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
@ -67,17 +69,17 @@ class AbstractSwarm(ABC):
):
"""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"""
@ -91,7 +93,7 @@ class AbstractSwarm(ABC):
@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"""
@ -156,6 +158,3 @@ class AbstractSwarm(ABC):
def save_swarm_state(self):
"""Save the swarm state"""
pass

Loading…
Cancel
Save