feat: hnsw embedding server and csr format

This commit is contained in:
Andy Lee
2025-07-05 23:04:41 +00:00
parent 368474d036
commit 0aa84e147b
9 changed files with 959 additions and 154 deletions

View File

@@ -1,10 +1,13 @@
# packages/leann-core/src/leann/registry.py
# 全局的后端注册表字典
BACKEND_REGISTRY = {}
from typing import Dict, TYPE_CHECKING
if TYPE_CHECKING:
from leann.interface import LeannBackendFactoryInterface
BACKEND_REGISTRY: Dict[str, 'LeannBackendFactoryInterface'] = {}
def register_backend(name: str):
"""一个用于注册新后端类的装饰器。"""
"""A decorator to register a new backend class."""
def decorator(cls):
print(f"INFO: Registering backend '{name}'")
BACKEND_REGISTRY[name] = cls