ai-server/source/registry/InterfaceRegistry.py

16 lines
416 B
Python

import typing
from source.api.interface import base
class InterfaceRegistry:
"""
The interface registry
Store the list of other interface available
"""
def __init__(self):
self.interface_types: dict[str, typing.Type[base.BaseInterface]] = {}
def register_type(self, name: str, interface_type: typing.Type[base.BaseInterface]):
self.interface_types[name] = interface_type