Renamed all indicies to vectors to avoid confusion of vocab (#246)

* renamed all indicies to vectors to avoid confusion of vocab

* removing unneeded files

* changed indicies on frontend sidebar to vectors
This commit is contained in:
Sean Hatfield 2023-09-21 12:04:17 -07:00 committed by GitHub
parent a505928934
commit ce6951b21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 18 deletions

View File

@ -26,7 +26,7 @@ export default function IndexCount() {
<div className="flex w-full items-center justify-end gap-x-2">
<div className="flex items-center gap-x-1 px-2 rounded-full">
<p className="text-slate-400 leading-tight text-sm">
{numberWithCommas(indexes)} {pluralize("index", indexes)}
{numberWithCommas(indexes)} {pluralize("vector", indexes)}
</p>
</div>
</div>

View File

@ -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"

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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(

View File

@ -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;

View File

@ -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;