mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-23 19:39:58 +00:00
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.
This commit is contained in:
@@ -81,7 +81,7 @@ class Qdrant(VectorStore):
|
|||||||
ids = [uuid.uuid4().hex for _ in texts]
|
ids = [uuid.uuid4().hex for _ in texts]
|
||||||
self.client.upsert(
|
self.client.upsert(
|
||||||
collection_name=self.collection_name,
|
collection_name=self.collection_name,
|
||||||
points=rest.Batch(
|
points=rest.Batch.construct(
|
||||||
ids=ids,
|
ids=ids,
|
||||||
vectors=[self.embedding_function(text) for text in texts],
|
vectors=[self.embedding_function(text) for text in texts],
|
||||||
payloads=self._build_payloads(
|
payloads=self._build_payloads(
|
||||||
@@ -314,7 +314,7 @@ class Qdrant(VectorStore):
|
|||||||
|
|
||||||
client.upsert(
|
client.upsert(
|
||||||
collection_name=collection_name,
|
collection_name=collection_name,
|
||||||
points=rest.Batch(
|
points=rest.Batch.construct(
|
||||||
ids=[uuid.uuid4().hex for _ in texts],
|
ids=[uuid.uuid4().hex for _ in texts],
|
||||||
vectors=embeddings,
|
vectors=embeddings,
|
||||||
payloads=cls._build_payloads(
|
payloads=cls._build_payloads(
|
||||||
|
Reference in New Issue
Block a user