From 9f0edc3c382da1201906aa2fbab2dffd18ed8e28 Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Wed, 20 Sep 2023 18:12:13 -0700 Subject: [PATCH 1/3] renamed all indicies to vectors to avoid confusion of vocab --- server/endpoints/api/system/index.js | 22 +++++++++--------- server/endpoints/system.js | 2 +- server/prisma/storage/anythingllm.db-journal | Bin 0 -> 512 bytes .../utils/vectorDbProviders/chroma/index.js | 2 +- server/utils/vectorDbProviders/lance/index.js | 2 +- .../utils/vectorDbProviders/pinecone/index.js | 2 +- .../utils/vectorDbProviders/qdrant/index.js | 2 +- .../utils/vectorDbProviders/weaviate/index.js | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 server/prisma/storage/anythingllm.db-journal diff --git a/server/endpoints/api/system/index.js b/server/endpoints/api/system/index.js index dd5f59b75dd..3548c3068a1 100644 --- a/server/endpoints/api/system/index.js +++ b/server/endpoints/api/system/index.js @@ -8,7 +8,7 @@ function apiSystemEndpoints(app) { if (!app) return; app.get("/v1/system/env-dump", async (_, response) => { - /* + /* #swagger.tags = ['System Settings'] #swagger.description = 'Dump all settings to file storage' #swagger.responses[403] = { @@ -29,7 +29,7 @@ function apiSystemEndpoints(app) { }); app.get("/v1/system", [validApiKey], async (_, response) => { - /* + /* #swagger.tags = ['System Settings'] #swagger.description = 'Get all current system settings that are defined.' #swagger.responses[200] = { @@ -48,9 +48,9 @@ function apiSystemEndpoints(app) { } } } - } + } } - } + } #swagger.responses[403] = { schema: { "$ref": "#/definitions/InvalidAPIKey" @@ -67,7 +67,7 @@ function apiSystemEndpoints(app) { }); app.get("/v1/system/vector-count", [validApiKey], async (_, response) => { - /* + /* #swagger.tags = ['System Settings'] #swagger.description = 'Number of all vectors in connected vector database' #swagger.responses[200] = { @@ -79,9 +79,9 @@ function apiSystemEndpoints(app) { "vectorCount": 5450 } } - } + } } - } + } #swagger.responses[403] = { schema: { "$ref": "#/definitions/InvalidAPIKey" @@ -90,7 +90,7 @@ function apiSystemEndpoints(app) { */ try { const VectorDb = getVectorDbClass(); - const vectorCount = await VectorDb.totalIndicies(); + const vectorCount = await VectorDb.totalVectors(); response.status(200).json({ vectorCount }); } catch (e) { console.log(e.message, e); @@ -102,7 +102,7 @@ function apiSystemEndpoints(app) { "/v1/system/update-env", [validApiKey], async (request, response) => { - /* + /* #swagger.tags = ['System Settings'] #swagger.description = 'Update a system setting or preference.' #swagger.requestBody = { @@ -128,9 +128,9 @@ function apiSystemEndpoints(app) { error: 'error goes here, otherwise null' } } - } + } } - } + } #swagger.responses[403] = { schema: { "$ref": "#/definitions/InvalidAPIKey" diff --git a/server/endpoints/system.js b/server/endpoints/system.js index f7fa13cbc3a..5ce3a7ed6f1 100644 --- a/server/endpoints/system.js +++ b/server/endpoints/system.js @@ -166,7 +166,7 @@ function systemEndpoints(app) { app.get("/system/system-vectors", [validatedRequest], async (_, response) => { try { const VectorDb = getVectorDbClass(); - const vectorCount = await VectorDb.totalIndicies(); + const vectorCount = await VectorDb.totalVectors(); response.status(200).json({ vectorCount }); } catch (e) { console.log(e.message, e); diff --git a/server/prisma/storage/anythingllm.db-journal b/server/prisma/storage/anythingllm.db-journal new file mode 100644 index 0000000000000000000000000000000000000000..a64a5a93fb4aef4d5f63d79cb2582731b9ac5063 GIT binary patch literal 512 NcmZQz7zHCa1ONg600961 literal 0 HcmV?d00001 diff --git a/server/utils/vectorDbProviders/chroma/index.js b/server/utils/vectorDbProviders/chroma/index.js index cff592f7897..40966e5e102 100644 --- a/server/utils/vectorDbProviders/chroma/index.js +++ b/server/utils/vectorDbProviders/chroma/index.js @@ -26,7 +26,7 @@ const Chroma = { const { client } = await this.connect(); return { heartbeat: await client.heartbeat() }; }, - totalIndicies: async function () { + totalVectors: async function () { const { client } = await this.connect(); const collections = await client.listCollections(); var totalVectors = 0; diff --git a/server/utils/vectorDbProviders/lance/index.js b/server/utils/vectorDbProviders/lance/index.js index 23872ad7979..f87e35c34a0 100644 --- a/server/utils/vectorDbProviders/lance/index.js +++ b/server/utils/vectorDbProviders/lance/index.js @@ -28,7 +28,7 @@ const LanceDb = { const dirs = fs.readdirSync(client.uri); return dirs.map((folder) => folder.replace(".lance", "")); }, - totalIndicies: async function () { + totalVectors: async function () { const { client } = await this.connect(); const tables = await this.tables(); let count = 0; diff --git a/server/utils/vectorDbProviders/pinecone/index.js b/server/utils/vectorDbProviders/pinecone/index.js index 1b523b24bec..f5a4d2c76bd 100644 --- a/server/utils/vectorDbProviders/pinecone/index.js +++ b/server/utils/vectorDbProviders/pinecone/index.js @@ -24,7 +24,7 @@ const Pinecone = { if (!status.ready) throw new Error("Pinecode::Index not ready."); return { client, pineconeIndex, indexName: process.env.PINECONE_INDEX }; }, - totalIndicies: async function () { + totalVectors: async function () { const { pineconeIndex } = await this.connect(); const { namespaces } = await pineconeIndex.describeIndexStats1(); return Object.values(namespaces).reduce( diff --git a/server/utils/vectorDbProviders/qdrant/index.js b/server/utils/vectorDbProviders/qdrant/index.js index eb122d9d6b4..e61a3688856 100644 --- a/server/utils/vectorDbProviders/qdrant/index.js +++ b/server/utils/vectorDbProviders/qdrant/index.js @@ -30,7 +30,7 @@ const QDrant = { await this.connect(); return { heartbeat: Number(new Date()) }; }, - totalIndicies: async function () { + totalVectors: async function () { const { client } = await this.connect(); const { collections } = await client.getCollections(); var totalVectors = 0; diff --git a/server/utils/vectorDbProviders/weaviate/index.js b/server/utils/vectorDbProviders/weaviate/index.js index 99e0859fe6d..ea1849cbac7 100644 --- a/server/utils/vectorDbProviders/weaviate/index.js +++ b/server/utils/vectorDbProviders/weaviate/index.js @@ -32,7 +32,7 @@ const Weaviate = { await this.connect(); return { heartbeat: Number(new Date()) }; }, - totalIndicies: async function () { + totalVectors: async function () { const { client } = await this.connect(); const collectionNames = await this.allNamespaces(client); var totalVectors = 0; From fec55080c72edec9aa676c9cac539d9b4cab0b02 Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Wed, 20 Sep 2023 18:14:25 -0700 Subject: [PATCH 2/3] removing unneeded files --- server/prisma/storage/anythingllm.db-journal | Bin 512 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 server/prisma/storage/anythingllm.db-journal diff --git a/server/prisma/storage/anythingllm.db-journal b/server/prisma/storage/anythingllm.db-journal deleted file mode 100644 index a64a5a93fb4aef4d5f63d79cb2582731b9ac5063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 NcmZQz7zHCa1ONg600961 From 0e2eddd5b228375f5046216392f52d6a9a1e38e2 Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Thu, 21 Sep 2023 09:18:39 -0700 Subject: [PATCH 3/3] changed indicies on frontend sidebar to vectors --- frontend/src/components/Sidebar/IndexCount.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Sidebar/IndexCount.jsx b/frontend/src/components/Sidebar/IndexCount.jsx index 3565ca5f32d..a31a1b72b60 100644 --- a/frontend/src/components/Sidebar/IndexCount.jsx +++ b/frontend/src/components/Sidebar/IndexCount.jsx @@ -26,7 +26,7 @@ export default function IndexCount() {

- {numberWithCommas(indexes)} {pluralize("index", indexes)} + {numberWithCommas(indexes)} {pluralize("vector", indexes)}