refactor: 去重删除逻辑统一到 VectorDB.delete_by_source
This commit is contained in:
@@ -21,7 +21,11 @@ _custom_registry: dict[str, type[Splitter]] = {}
|
||||
|
||||
|
||||
def register_splitter(ext: str, splitter_cls: type[Splitter]) -> None:
|
||||
"""注册自定义 Splitter 类."""
|
||||
"""注册自定义 Splitter 类.
|
||||
|
||||
注意: 此函数非线程安全,请在程序启动时调用(单线程阶段)。
|
||||
运行时动态注册需自行加锁。
|
||||
"""
|
||||
ext = ext.lower() if ext.startswith(".") else f".{ext}"
|
||||
_custom_registry[ext] = splitter_cls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user