| 44 | class BaseAPIHandler: |
| 45 | """Base class for asynchronous API handlers.""" |
| 46 | def __init__(self, name): |
| 47 | self.name = name |
| 48 | self.models = [] # List of supported models { "name": "model-id", "parameters": "optional", ... } |
| 49 | API_HANDLERS[name] = self |
| 50 | logger.info("Registered API handler: '%s'", name) |
| 51 | # Optional: Create a shared httpx client if needed across handlers (managing lifecycle is key) |
| 52 | # self.http_client = httpx.AsyncClient(timeout=90.0) # Example |
| 53 | |
| 54 | def get_models(self): |
| 55 | """Return the list of models supported by this handler.""" |