feat: 支持可配置的混合检索融合权重 (#2071)

* feat: 支持可配置的混合检索融合权重

* style: 修复 ruff format 检查
This commit is contained in:
zpf2000
2026-03-24 09:50:08 +08:00
committed by GitHub
parent c13971d7d6
commit 6fa653f232
9 changed files with 82 additions and 5 deletions
+3
View File
@@ -53,6 +53,7 @@ class VectorDatabase(abc.ABC):
search_type: str = 'vector',
query_text: str = '',
filter: dict[str, Any] | None = None,
vector_weight: float | None = None,
) -> Dict[str, Any]:
"""Search for the most similar vectors in the specified collection.
@@ -70,6 +71,8 @@ class VectorDatabase(abc.ABC):
{"file_id": "abc"}
{"created_at": {"$gte": 1700000000}}
{"file_type": {"$in": ["pdf", "docx"]}}
vector_weight: Weight for vector search in hybrid mode (0.01.0).
``None`` means use equal weights (backward compatible).
"""
pass