Skip to content

Commit 6a923d5

Browse files
committed
Update E2E test for linear ranker
1 parent c99e524 commit 6a923d5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/neo4j_graphrag/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def validate_alpha(self) -> Self:
176176
if ranker == HybridSearchRanker.LINEAR:
177177
if alpha is None:
178178
raise ValueError("alpha must be provided when using the linear ranker")
179-
if 0.0 <= alpha <= 1.0:
179+
if not (0.0 <= alpha <= 1.0):
180180
raise ValueError("alpha must be between 0 and 1")
181181
else:
182182
if alpha is not None:

tests/e2e/test_hybrid_e2e.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def test_hybrid_retriever_search_text_linear_ranker(
192192
query_text="Find me a book about Fremen",
193193
top_k=top_k,
194194
effective_search_ratio=effective_search_ratio,
195+
ranker="linear",
196+
alpha=0.9,
195197
)
196198

197199
assert isinstance(results, RetrieverResult)

0 commit comments

Comments
 (0)