mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-04 02:42:57 +00:00
update
This commit is contained in:
@@ -102,7 +102,7 @@ def test_linear_combination(tmp_path):
|
||||
query = "Our father who art in heaven"
|
||||
query_vector = table.to_pandas()["vector"][0]
|
||||
result = (
|
||||
table.search(vector=query_vector, text=query, query_type="vector")
|
||||
table.search(vector=query_vector, text=query, query_type="hybrid")
|
||||
.limit(30)
|
||||
.rerank(normalize="score")
|
||||
.to_arrow()
|
||||
@@ -116,6 +116,7 @@ def test_linear_combination(tmp_path):
|
||||
"be descending."
|
||||
)
|
||||
|
||||
# automatically deduce the query type
|
||||
result = (
|
||||
table.search(vector=query_vector, text=query)
|
||||
.limit(30)
|
||||
@@ -123,6 +124,12 @@ def test_linear_combination(tmp_path):
|
||||
.to_arrow()
|
||||
)
|
||||
|
||||
# wrong query type raises an error
|
||||
with pytest.raises(ValueError):
|
||||
table.search(vector=query_vector, text=query, query_type="vector").rerank(
|
||||
normalize="score"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.environ.get("COHERE_API_KEY") is None, reason="COHERE_API_KEY not set"
|
||||
|
||||
Reference in New Issue
Block a user