UNPKG

closevector-common

Version:

27 lines (26 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CloseVectorSaveableVectorStore = void 0; class CloseVectorSaveableVectorStore { embeddings; credentials; constructor(embeddings, credentials) { this.embeddings = embeddings; this.credentials = credentials; } static load(_directory, _embeddings) { throw new Error('Not implemented'); } // eslint-disable-next-line @typescript-eslint/no-explicit-any async delete(_params) { throw new Error('Not implemented.'); } async similaritySearch(query, k = 4, filter = undefined) { const results = await this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(query), k, filter); return results.map(result => result[0]); } async similaritySearchWithScore(query, k = 4, filter = undefined) { return this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(query), k, filter); } } exports.CloseVectorSaveableVectorStore = CloseVectorSaveableVectorStore;