feat: 添加线索引擎、NLQ、场景检测、前端界面等核心功能模块

This commit is contained in:
freedakgmail
2026-06-16 08:15:15 +08:00
parent 7b1e2b10a8
commit 48340f6011
62 changed files with 6772 additions and 65 deletions
+22
View File
@@ -0,0 +1,22 @@
"""适配器注册表:按 staging 表名索引,便于调度器统一调用。"""
from __future__ import annotations
from typing import Type
from app.ingest.base import BaseAdapter
# 全局注册表:staging_table -> Adapter 类
ADAPTER_REGISTRY: dict[str, Type[BaseAdapter]] = {}
def register_adapter(cls: Type[BaseAdapter]) -> Type[BaseAdapter]:
"""类装饰器:将 Adapter 注册到全局表。"""
if cls.staging_table:
ADAPTER_REGISTRY[cls.staging_table] = cls
return cls
def get_adapter(staging_table: str) -> Type[BaseAdapter] | None:
"""按 staging 表名查找已注册的适配器类。"""
return ADAPTER_REGISTRY.get(staging_table)