mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
Allow k to be higher than doc size in max_marginal_relevance_search (#1187)
Fixes issue #1186. For some reason, #1117 didn't seem to fix it.
This commit is contained in:
@@ -44,6 +44,10 @@ def test_faiss_vector_sim() -> None:
|
||||
output = docsearch.similarity_search_by_vector(query_vec, k=1)
|
||||
assert output == [Document(page_content="foo")]
|
||||
|
||||
# make sure we can have k > docstore size
|
||||
output = docsearch.max_marginal_relevance_search_by_vector(query_vec, k=10)
|
||||
assert len(output) == len(texts)
|
||||
|
||||
|
||||
def test_faiss_with_metadatas() -> None:
|
||||
"""Test end to end construction and search."""
|
||||
|
Reference in New Issue
Block a user