continue refactor of backend to utilize ts, deprecate js

This commit is contained in:
KS Jannette
2026-05-09 16:57:37 -04:00
parent 1a1161b509
commit c9a69a4d27
20 changed files with 509 additions and 240 deletions

View File

@@ -0,0 +1,21 @@
'use strict';
const vectors = new Map<string, Float32Array>();
export function storeVector(chunkId: string, embedding: number[]): void {
vectors.set(chunkId, new Float32Array(embedding));
}
export function getVector(chunkId: string): Float32Array | null {
return vectors.get(chunkId) || null;
}
export function getAllVectors(): Map<string, Float32Array> {
return vectors;
}
export function deleteVectorsForChunks(chunkIds: string[]): void {
for (const id of chunkIds) {
vectors.delete(id);
}
}