From 8bb1024d0f58ecc52c9acc327978eac7cf751b00 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung <samchenghung@gmail.com> Date: Sun, 12 May 2024 04:10:47 +0800 Subject: [PATCH] fix: qdrant store init parameters --- templates/components/vectordbs/typescript/qdrant/generate.ts | 5 ++++- templates/components/vectordbs/typescript/qdrant/index.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/components/vectordbs/typescript/qdrant/generate.ts b/templates/components/vectordbs/typescript/qdrant/generate.ts index f0e7fa40..e86421a2 100644 --- a/templates/components/vectordbs/typescript/qdrant/generate.ts +++ b/templates/components/vectordbs/typescript/qdrant/generate.ts @@ -18,7 +18,10 @@ async function loadAndIndex() { const documents = await getDocuments(); // Connect to Qdrant - const vectorStore = new QdrantVectorStore(collectionName, getQdrantClient()); + const vectorStore = new QdrantVectorStore({ + collectionName, + client: getQdrantClient(), + }); const storageContext = await storageContextFromDefaults({ vectorStore }); await VectorStoreIndex.fromDocuments(documents, { diff --git a/templates/components/vectordbs/typescript/qdrant/index.ts b/templates/components/vectordbs/typescript/qdrant/index.ts index 229d7a39..d2328686 100644 --- a/templates/components/vectordbs/typescript/qdrant/index.ts +++ b/templates/components/vectordbs/typescript/qdrant/index.ts @@ -7,7 +7,10 @@ dotenv.config(); export async function getDataSource() { checkRequiredEnvVars(); const collectionName = process.env.QDRANT_COLLECTION; - const store = new QdrantVectorStore(collectionName, getQdrantClient()); + const store = new QdrantVectorStore({ + collectionName, + client: getQdrantClient(), + }); return await VectorStoreIndex.fromVectorStore(store); } -- GitLab