From e50c1ea7fb4ba691e280c9ecda9f8b290266a0d5 Mon Sep 17 00:00:00 2001 From: weiyang Date: Mon, 27 Mar 2023 23:29:07 +0800 Subject: [PATCH] Fix the parameter error of 'Qdrant.maximal_marginal_relevance' (#1921) Hi, first and foremost, I would like to express my gratitude for your outstanding work; it's truly remarkable! https://github.com/hwchase17/langchain/blob/master/langchain/vectorstores/qdrant.py#L134 It appears that there might be a minor issue with the `limit` parameter being passed incorrectly in the `Qdrant.maximal_marginal_relevance` function. This seems to be a typographical error. Signed-off-by: weiyang --- langchain/vectorstores/qdrant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/vectorstores/qdrant.py b/langchain/vectorstores/qdrant.py index 4ce535fcd4..8e716df0a0 100644 --- a/langchain/vectorstores/qdrant.py +++ b/langchain/vectorstores/qdrant.py @@ -165,7 +165,7 @@ class Qdrant(VectorStore): query_vector=embedding, with_payload=True, with_vectors=True, - limit=k, + limit=fetch_k, ) embeddings = [result.vector for result in results] mmr_selected = maximal_marginal_relevance(embedding, embeddings, k=k)