SIGN IN SIGN UP

fix: prevent Document nodes from bypassing chunking pipeline (#509)

LlamaIndex's Document class inherits from BaseNode, so the previous
isinstance(doc, BaseNode) check classified all Documents as pre-embedded
nodes, skipping SentenceSplitter entirely. This sent full-document text
(1M+ chars) to the embedding API, triggering HTTP 400 input-length errors.

Replace the type check with an explicit embedding-presence check that
correctly distinguishes pre-embedded nodes (e.g. ImageNode from multimodal
loaders) from regular Documents that still require splitting.
W
washi4 committed
5c0af9983ab84c2ef782d6b1db9f0949576fce27
Parent: c90fae5
Committed by GitHub <noreply@github.com> on 5/27/2026, 12:21:57 PM