Skip to content

Commit

Permalink
core - remove register_type_placeholder()
Browse files Browse the repository at this point in the history
  • Loading branch information
cobycloud committed Jan 4, 2025
1 parent eb71f29 commit b8641e7
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkgs/core/swarmauri_core/ComponentBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,28 +184,6 @@ def decorator(subclass: Type['ComponentBase']):
return subclass
return decorator

@classmethod
def register_type_placeholder(cls, resource_type: str, type_name: str, module_path: str, interface: Optional[Type[Any]] = None):
"""
Registers a placeholder for a component class with a specific type name under a resource type.
Used for lazy-loaded plugins to register type information without loading the module.
Parameters:
- resource_type: The category of the resource (e.g., 'agents', 'chains').
- type_name: The string identifier for the component type.
- module_path: The module path where the class will be loaded from.
- interface: The interface class that the component implements.
"""
if resource_type not in cls.TYPE_REGISTRY:
cls.TYPE_REGISTRY[resource_type] = {}
cls.TYPE_REGISTRY[resource_type][type_name] = {
"module_path": module_path,
"class_name": type_name,
"interface": interface
}
# No need to recreate models as no actual class is loaded
logger.info(f"Registered placeholder for type '{type_name}' under resource '{resource_type}' with module '{module_path}' and interface '{interface.__name__ if interface else 'None'}'")

@classmethod
def register_model(cls):
"""
Expand Down

0 comments on commit b8641e7

Please sign in to comment.