Qdrant Client: Expose instance for creating client (#9706)

Expose classmethods to convenient initialize the vectostore.

The purpose of this PR is to make it easy for users to initialize an
empty vectorstore that's properly pre-configured without having to index
documents into it via `from_documents`.

This will make it easier for users to rely on the following indexing
code: https://github.com/langchain-ai/langchain/pull/9614
to help manage data in the qdrant vectorstore.
This commit is contained in:
Eugene Yurtsev 2023-08-28 09:30:59 -04:00 committed by GitHub
parent 610f46d83a
commit 5edf819524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1298,7 +1298,7 @@ class Qdrant(VectorStore):
embeddings = OpenAIEmbeddings()
qdrant = Qdrant.from_texts(texts, embeddings, "localhost")
"""
qdrant = cls._construct_instance(
qdrant = cls.construct_instance(
texts,
embedding,
location,
@ -1474,7 +1474,7 @@ class Qdrant(VectorStore):
embeddings = OpenAIEmbeddings()
qdrant = await Qdrant.afrom_texts(texts, embeddings, "localhost")
"""
qdrant = await cls._aconstruct_instance(
qdrant = await cls.aconstruct_instance(
texts,
embedding,
location,
@ -1510,7 +1510,7 @@ class Qdrant(VectorStore):
return qdrant
@classmethod
def _construct_instance(
def construct_instance(
cls: Type[Qdrant],
texts: List[str],
embedding: Embeddings,
@ -1676,7 +1676,7 @@ class Qdrant(VectorStore):
return qdrant
@classmethod
async def _aconstruct_instance(
async def aconstruct_instance(
cls: Type[Qdrant],
texts: List[str],
embedding: Embeddings,