refactor: 修复 Embedder Protocol 标准写法和 PDF/EPUB Splitter 参数语义
This commit is contained in:
+15
-2
@@ -48,9 +48,22 @@ _PROVIDER_DEFAULTS: dict[str, dict[str, str | int]] = {
|
||||
# -- 接口 --
|
||||
class Embedder(Protocol):
|
||||
"""嵌入器接口."""
|
||||
|
||||
@property
|
||||
def dimension(self) -> int: ...
|
||||
def embed(self, texts: list[str]) -> list[list[float]]: ...
|
||||
def dimension(self) -> int:
|
||||
"""返回嵌入向量的维度."""
|
||||
...
|
||||
|
||||
def embed(self, texts: list[str]) -> list[list[float]]:
|
||||
"""对文本列表进行嵌入.
|
||||
|
||||
Args:
|
||||
texts: 待嵌入的文本列表
|
||||
|
||||
Returns:
|
||||
嵌入向量列表,每个向量为 float 列表
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
# -- 本地模型 --
|
||||
|
||||
Reference in New Issue
Block a user