- Introduction of dynamic Retrievers & Specialists
- Introduction of dynamic Processors - Introduction of caching system - Introduction of a better template manager - Adaptation of ModelVariables to support dynamic Processors / Retrievers / Specialists - Start adaptation of chat client
This commit is contained in:
21
eveai_chat_workers/specialists/registry.py
Normal file
21
eveai_chat_workers/specialists/registry.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import Dict, Type
|
||||
from .base import BaseSpecialist
|
||||
|
||||
|
||||
class SpecialistRegistry:
|
||||
"""Registry for specialist types"""
|
||||
|
||||
_registry: Dict[str, Type[BaseSpecialist]] = {}
|
||||
|
||||
@classmethod
|
||||
def register(cls, specialist_type: str, specialist_class: Type[BaseSpecialist]):
|
||||
"""Register a new specialist type"""
|
||||
cls._registry[specialist_type] = specialist_class
|
||||
|
||||
@classmethod
|
||||
def get_specialist_class(cls, specialist_type: str) -> Type[BaseSpecialist]:
|
||||
"""Get the specialist class for a given type"""
|
||||
if specialist_type not in cls._registry:
|
||||
raise ValueError(f"Unknown specialist type: {specialist_type}")
|
||||
return cls._registry[specialist_type]
|
||||
|
||||
Reference in New Issue
Block a user