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

@ -235,7 +235,7 @@ class WeaviateVector(BaseVector):
query_obj = query_obj.with_where(kwargs.get("where_filter"))
query_obj = query_obj.with_additional(["vector"])
properties = ["text"]
result = query_obj.with_bm25(query=query, properties=properties).with_limit(kwargs.get("top_k", 2)).do()
result = query_obj.with_bm25(query=query, properties=properties).with_limit(kwargs.get("top_k", 4)).do()
if "errors" in result:
raise ValueError(f"Error during query: {result['errors']}")
docs = []