{"record":{"id":"762a4eafd354359f","repo":"run-llama/llama_index","slug":"configured-node-parser-does-not-have-chunk-overlap","errorCode":null,"errorMessage":"Configured node parser does not have chunk overlap.","messagePattern":"Configured node parser does not have chunk overlap\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/settings.py","lineNumber":177,"sourceCode":"            return self.node_parser.chunk_size\n        else:\n            raise ValueError(\"Configured node parser does not have chunk size.\")\n\n    @chunk_size.setter\n    def chunk_size(self, chunk_size: int) -> None:\n        \"\"\"Set the chunk size.\"\"\"\n        if hasattr(self.node_parser, \"chunk_size\"):\n            self.node_parser.chunk_size = chunk_size\n        else:\n            raise ValueError(\"Configured node parser does not have chunk size.\")\n\n    @property\n    def chunk_overlap(self) -> int:\n        \"\"\"Get the chunk overlap.\"\"\"\n        if hasattr(self.node_parser, \"chunk_overlap\"):\n            return self.node_parser.chunk_overlap\n        else:\n            raise ValueError(\"Configured node parser does not have chunk overlap.\")\n\n    @chunk_overlap.setter\n    def chunk_overlap(self, chunk_overlap: int) -> None:\n        \"\"\"Set the chunk overlap.\"\"\"\n        if hasattr(self.node_parser, \"chunk_overlap\"):\n            self.node_parser.chunk_overlap = chunk_overlap\n        else:\n            raise ValueError(\"Configured node parser does not have chunk overlap.\")\n\n    # ---- Node parser alias ----\n\n    @property\n    def text_splitter(self) -> NodeParser:\n        \"\"\"Get the text splitter.\"\"\"\n        return self.node_parser\n\n    @text_splitter.setter\n    def text_splitter(self, text_splitter: NodeParser) -> None:","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/settings.py#L159-L195","documentation":"Settings.chunk_overlap getter proxies to Settings.node_parser.chunk_overlap. If the installed node parser does not expose chunk_overlap (anything other than chunking splitters like SentenceSplitter/SentenceAwareNodeParser, or a custom parser without the attribute), the read raises this ValueError.","triggerScenarios":"Reading Settings.chunk_overlap after setting Settings.node_parser to HierarchicalNodeParser, SentenceWindowNodeParser, MarkdownNodeParser, or a custom NodeParser; or a library reading the property to compute embedding-context defaults.","commonSituations":"Advanced ingestion strategies (hierarchical retrieval, sentence-window retrieval) replace the default splitter; later code that reads chunk_overlap for logging, validation, or downstream window sizing then blows up.","solutions":["Read chunk_overlap from the concrete splitter instance you constructed instead of from Settings.","Keep a chunking splitter installed if the proxy must work: Settings.node_parser = SentenceSplitter(chunk_size=512, chunk_overlap=50).","Guard reads with hasattr(Settings.node_parser, 'chunk_overlap') before accessing.","Expose chunk_overlap on custom NodeParser subclasses so the Settings contract keeps working."],"exampleFix":"# before\nSettings.node_parser = SentenceWindowNodeParser.from_defaults()\noverlap = Settings.chunk_overlap  # ValueError\n\n# after\nSettings.node_parser = SentenceWindowNodeParser.from_defaults()\n# keep a splitter reference for chunking parameters\n_splitter = SentenceSplitter(chunk_size=512, chunk_overlap=50)\noverlap = _splitter.chunk_overlap","handlingStrategy":"type-guard","validationCode":"from llama_index.core import Settings\n\ndef settings_chunk_overlap(default: int | None = None) -> int | None:\n    parser = Settings.node_parser\n    return parser.chunk_overlap if hasattr(parser, 'chunk_overlap') else default","typeGuard":"def parser_has_chunk_overlap(parser) -> bool:\n    return hasattr(parser, 'chunk_overlap')","tryCatchPattern":"try:\n    ov = Settings.chunk_overlap\nexcept ValueError:\n    ov = 0  # non-chunking parser: no overlap concept","preventionTips":["Store a reference to the splitter you configured and read chunk_overlap from it.","Treat Settings.chunk_overlap as valid only when the default-style splitter is installed.","Log the installed node parser type at startup so config mismatches are visible."],"tags":["settings","node-parser","chunking","configuration","llama-index"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}