From dcb17503f216a521400e1fc4aa2c82162ae849a3 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Fri, 14 Apr 2023 06:57:05 +0200 Subject: [PATCH] Update qdrant.py (#2750) At the moment of upload we should already know the format of data, therefore we can skip the costly pydantic validation. --- langchain/vectorstores/qdrant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langchain/vectorstores/qdrant.py b/langchain/vectorstores/qdrant.py index 33eec89e..1526379e 100644 --- a/langchain/vectorstores/qdrant.py +++ b/langchain/vectorstores/qdrant.py @@ -81,7 +81,7 @@ class Qdrant(VectorStore): ids = [uuid.uuid4().hex for _ in texts] self.client.upsert( collection_name=self.collection_name, - points=rest.Batch( + points=rest.Batch.construct( ids=ids, vectors=[self.embedding_function(text) for text in texts], payloads=self._build_payloads( @@ -314,7 +314,7 @@ class Qdrant(VectorStore): client.upsert( collection_name=collection_name, - points=rest.Batch( + points=rest.Batch.construct( ids=[uuid.uuid4().hex for _ in texts], vectors=embeddings, payloads=cls._build_payloads(