-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
2,718 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Any, List | ||
|
||
|
||
class IControlPlane(ABC): | ||
""" | ||
Abstract base class for ControlPlane. | ||
""" | ||
|
||
@abstractmethod | ||
def create_agent(self, name: str, role: str) -> Any: | ||
""" | ||
Create an agent with the given name and role. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def remove_agent(self, name: str) -> None: | ||
""" | ||
Remove the agent with the specified name. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def list_active_agents(self) -> List[str]: | ||
""" | ||
List all active agent names. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def submit_tasks(self, tasks: List[Any]) -> None: | ||
""" | ||
Submit one or more tasks to the task management strategy for processing. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def process_tasks(self) -> None: | ||
""" | ||
Process and assign tasks from the queue, then transport them to their assigned services. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def distribute_tasks(self, task: Any) -> None: | ||
""" | ||
Distribute tasks using the task strategy. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def orchestrate_agents(self, task: Any) -> None: | ||
""" | ||
Orchestrate agents for task distribution. | ||
""" | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Any, Callable, List | ||
from enum import Enum | ||
|
||
|
||
class PipelineStatus(Enum): | ||
""" | ||
Enum representing the status of a pipeline execution. | ||
""" | ||
|
||
PENDING = "pending" | ||
RUNNING = "running" | ||
COMPLETED = "completed" | ||
FAILED = "failed" | ||
STOPPED = "stopped" | ||
|
||
|
||
class IPipeline(ABC): | ||
""" | ||
Interface defining core methods for pipeline execution and management. | ||
""" | ||
|
||
@abstractmethod | ||
def add_task(self, task: Callable, *args: Any, **kwargs: Any) -> None: | ||
""" | ||
Add a task to the pipeline. | ||
:param task: Callable task to be executed | ||
:param args: Positional arguments for the task | ||
:param kwargs: Keyword arguments for the task | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def execute(self, *args: Any, **kwargs: Any) -> List[Any]: | ||
""" | ||
Execute the entire pipeline. | ||
:return: List of results from pipeline execution | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_status(self) -> PipelineStatus: | ||
""" | ||
Get the current status of the pipeline. | ||
:return: Current pipeline status | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def reset(self) -> None: | ||
""" | ||
Reset the pipeline to its initial state. | ||
""" | ||
pass |
Empty file.
43 changes: 43 additions & 0 deletions
43
pkgs/core/swarmauri_core/service_registries/IServiceRegistry.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Dict, Any, List, Optional | ||
|
||
|
||
class IServiceRegistry(ABC): | ||
""" | ||
Abstract base class for service registries. | ||
""" | ||
|
||
@abstractmethod | ||
def register_service(self, name: str, details: Dict[str, Any]) -> None: | ||
""" | ||
Register a new service with the given name and details. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_service(self, name: str) -> Optional[Dict[str, Any]]: | ||
""" | ||
Retrieve a service by its name. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_services_by_roles(self, roles: List[str]) -> List[str]: | ||
""" | ||
Get services filtered by their roles. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def unregister_service(self, name: str) -> None: | ||
""" | ||
unregister the service with the given name. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def update_service(self, name: str, details: Dict[str, Any]) -> None: | ||
""" | ||
Update the details of the service with the given name. | ||
""" | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,32 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Any, List, Dict | ||
from datetime import datetime | ||
from swarmauri_core.agents.IAgent import IAgent | ||
from swarmauri_core.chains.ICallableChain import ICallableChain | ||
from typing import Any, Dict, List, Optional, Union | ||
|
||
class ISwarm(ABC): | ||
""" | ||
Interface for a Swarm, representing a collective of agents capable of performing tasks, executing callable chains, and adaptable configurations. | ||
""" | ||
|
||
# Abstract properties and setters | ||
@property | ||
@abstractmethod | ||
def id(self) -> str: | ||
"""Unique identifier for the factory instance.""" | ||
pass | ||
|
||
@id.setter | ||
@abstractmethod | ||
def id(self, value: str) -> None: | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def name(self) -> str: | ||
pass | ||
|
||
@name.setter | ||
@abstractmethod | ||
def name(self, value: str) -> None: | ||
pass | ||
class ISwarm(ABC): | ||
"""Abstract base class for swarm implementations""" | ||
|
||
@property | ||
@abstractmethod | ||
def type(self) -> str: | ||
async def exec( | ||
self, | ||
input_data: Union[str, List[str]], | ||
**kwargs: Dict[str, Any], | ||
) -> Any: | ||
"""Execute swarm tasks with given input""" | ||
pass | ||
|
||
@type.setter | ||
@abstractmethod | ||
def type(self, value: str) -> None: | ||
def get_swarm_status(self) -> Dict[int, Any]: | ||
"""Get status of all agents in the swarm""" | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def date_created(self) -> datetime: | ||
def agents(self) -> List[Any]: | ||
"""Get list of agents in the swarm""" | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def last_modified(self) -> datetime: | ||
def queue_size(self) -> int: | ||
"""Get size of task queue""" | ||
pass | ||
|
||
@last_modified.setter | ||
@abstractmethod | ||
def last_modified(self, value: datetime) -> None: | ||
pass | ||
|
||
def __hash__(self): | ||
""" | ||
The __hash__ method allows objects of this class to be used in sets and as dictionary keys. | ||
__hash__ should return an integer and be defined based on immutable properties. | ||
This is generally implemented directly in concrete classes rather than in the interface, | ||
but it's declared here to indicate that implementing classes must provide it. | ||
""" | ||
pass | ||
|
73 changes: 0 additions & 73 deletions
73
pkgs/core/swarmauri_core/swarms/ISwarmAgentRegistration.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.