Skip to content

The agent engineering platform.

Hotfix: distance_func and collection_name must not be in kwargs (#735)

Francisco Inghamf9ddcb5705d4
diff --git a/langchain/vectorstores/qdrant.py b/langchain/vectorstores/qdrant.py
index bc40dc263f..47531a8cf5 100644
--- a/langchain/vectorstores/qdrant.py
+++ b/langchain/vectorstores/qdrant.py
@@ -182,10 +182,11 @@ class Qdrant(VectorStore):
qdrant_host = get_from_dict_or_env(kwargs, "host", "QDRANT_HOST")
kwargs.pop("host")
+ collection_name = kwargs.pop("collection_name", uuid.uuid4().hex)
+ distance_func = kwargs.pop("distance_func", "Cosine").upper()
+
client = qdrant_client.QdrantClient(host=qdrant_host, **kwargs)
- collection_name = kwargs.get("collection_name", uuid.uuid4().hex)
- distance_func = kwargs.pop("distance_func", "Cosine").upper()
client.recreate_collection(
collection_name=collection_name,
vectors_config=rest.VectorParams(