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
[docs]
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
@property
@abstractmethod
def type(self) -> str:
pass
@type.setter
@abstractmethod
def type(self, value: str) -> None:
pass
@property
@abstractmethod
def date_created(self) -> datetime:
pass
@property
@abstractmethod
def last_modified(self) -> datetime:
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