diff --git a/langchain/vectorstores/qdrant.py b/langchain/vectorstores/qdrant.py index bc40dc263f3..47531a8cf53 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(