Skip to content

Commit 97fa4d5

Browse files
waleedlatif1claude
andcommitted
fix(knowledge): use .count from estimateTokenCount return value
estimateTokenCount returns a TokenEstimate object, not a number — access .count so the integer token count is stored instead of an object. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 53624f3 commit 97fa4d5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/lib/knowledge/documents/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ export async function processDocumentAsync(
545545
chunkHash: sha256Hex(chunk.text),
546546
content: chunk.text,
547547
contentLength: chunk.text.length,
548-
tokenCount: estimateTokenCount(chunk.text, tokenizerProvider),
548+
tokenCount: estimateTokenCount(chunk.text, tokenizerProvider).count,
549549
embedding: embeddings[chunkIndex] || null,
550550
embeddingModel: kbEmbeddingModel,
551551
startOffset: chunk.metadata.startIndex,

0 commit comments

Comments
 (0)