refactor: update the default values of top-k parameter in vdb to be consistent (#9367)

This commit is contained in:
zhuhao 2024-10-16 16:00:21 +08:00 • committed by GitHub
commit 86594851cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 9 additions and 29 deletions

View file

@ -121,7 +121,7 @@ class MyScaleVector(BaseVector):
return self._search(f"TextSearch('enable_nlq=false')(text, '{query}')", SortOrder.DESC, **kwargs)
def _search(self, dist: str, order: SortOrder, **kwargs: Any) -> list[Document]:
top_k = kwargs.get("top_k", 5)
top_k = kwargs.get("top_k", 4)
score_threshold = float(kwargs.get("score_threshold") or 0.0)
where_str = (
f"WHERE dist < {1 - score_threshold}"