We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2552edc commit c6fde92Copy full SHA for c6fde92
apps/sim/lib/knowledge/documents/service.ts
@@ -598,6 +598,12 @@ export async function processDocumentAsync(
598
599
logger.info(`[${documentId}] Creating embedding records with tags`)
600
601
+ if (embeddings.length !== processed.chunks.length) {
602
+ throw new Error(
603
+ `Embedding count mismatch: expected ${processed.chunks.length} embeddings for ${processed.chunks.length} chunks, got ${embeddings.length}`
604
+ )
605
+ }
606
+
607
const embeddingRecords = processed.chunks.map((chunk, chunkIndex) => ({
608
id: crypto.randomUUID(),
609
knowledgeBaseId,
0 commit comments