Syntax changes in front and back end dirs. These do not affect functionality and are purely intended to better capture and describe the app's functionality and purpose
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import logger from '../logger.js';
|
||||
import * as vectorStore from '../stores/vectorStore.js';
|
||||
import * as notebookStore from '../stores/notebookStore.js';
|
||||
import * as sourceCorpusStore from '../stores/sourceCorpusStore.js';
|
||||
|
||||
const VOYAGE_API_URL = 'https://api.voyageai.com/v1';
|
||||
const EMBED_MODEL = 'voyage-3';
|
||||
@@ -72,8 +72,8 @@ export function storeChunkEmbeddings(chunks: TextChunk[], embeddings: number[][]
|
||||
logger.debug({ count: chunks.length }, 'stored chunk embeddings');
|
||||
}
|
||||
|
||||
export function search(queryEmbedding: number[], notebookId: string, topK = 10): ScoredChunk[] {
|
||||
const chunks = notebookStore.getChunksForNotebook(notebookId) as TextChunk[];
|
||||
export function search(queryEmbedding: number[], sourceCorpusId: string, topK = 10): ScoredChunk[] {
|
||||
const chunks = sourceCorpusStore.getChunksForSourceCorpus(sourceCorpusId) as TextChunk[];
|
||||
if (chunks.length === 0) return [];
|
||||
|
||||
const scored: ScoredChunk[] = [];
|
||||
|
||||
Reference in New Issue
Block a user