Skip to content

Class swarmauri_core.service_registries.IServiceRegistry.IServiceRegistry

swarmauri_core.service_registries.IServiceRegistry.IServiceRegistry

Bases: ABC

Abstract base class for service registries.

register_service abstractmethod

register_service(name, details)

Register a new service with the given name and details.

Source code in swarmauri_core/service_registries/IServiceRegistry.py
10
11
12
13
14
15
@abstractmethod
def register_service(self, name: str, details: Dict[str, Any]) -> None:
    """
    Register a new service with the given name and details.
    """
    pass

get_service abstractmethod

get_service(name)

Retrieve a service by its name.

Source code in swarmauri_core/service_registries/IServiceRegistry.py
17
18
19
20
21
22
@abstractmethod
def get_service(self, name: str) -> Optional[Dict[str, Any]]:
    """
    Retrieve a service by its name.
    """
    pass

get_services_by_roles abstractmethod

get_services_by_roles(roles)

Get services filtered by their roles.

Source code in swarmauri_core/service_registries/IServiceRegistry.py
24
25
26
27
28
29
@abstractmethod
def get_services_by_roles(self, roles: List[str]) -> List[str]:
    """
    Get services filtered by their roles.
    """
    pass

unregister_service abstractmethod

unregister_service(name)

unregister the service with the given name.

Source code in swarmauri_core/service_registries/IServiceRegistry.py
31
32
33
34
35
36
@abstractmethod
def unregister_service(self, name: str) -> None:
    """
    unregister the service with the given name.
    """
    pass

update_service abstractmethod

update_service(name, details)

Update the details of the service with the given name.

Source code in swarmauri_core/service_registries/IServiceRegistry.py
38
39
40
41
42
43
@abstractmethod
def update_service(self, name: str, details: Dict[str, Any]) -> None:
    """
    Update the details of the service with the given name.
    """
    pass