fix: preserve zero LlamaIndex chunk overlap#602
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix LlamaIndex chunk geometry so an explicit
chunk_overlapof0is preserved instead of falling back to DeepTutor's default overlap.Description
chunk_geometry()previously usedsettings.get("chunk_overlap", 50) or 50, which treated a valid configured0as missing and silently returned50. The runtime settings layer and UI already allowchunk_overlap=0, so this made the indexing runtime ignore a user's attempt to disable overlap.This change distinguishes
Nonefrom other falsy values when applying defaults, preserving explicit zero overlap while keeping the existing512/50fallback for missing or unreadable settings.Related Issues
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstestsservices/rag/pipelines/llamaindexChecklist
pre-commit run --all-filesand fixed any issues.Additional Notes
Evidence:
Before this change, this runtime settings payload:
{"chunk_size": 512, "chunk_overlap": 0}was interpreted by
chunk_geometry()as(512, 50)because0 or 50selected the fallback. After this change, the same payload returns(512, 0).Possible call chain / impact:
This PR is scoped to LlamaIndex chunk geometry configuration. It does not change document loading, parser selection, vector indexing, reranking, or chat retrieval UI behavior.
Validation:
mamba run -n prw-deeptutor-py311 pytest -q tests/services/config/test_llamaindex_settings.py- passed, 5 testsmamba run -n prw-deeptutor-py311 python -m ruff check deeptutor/services/rag/pipelines/llamaindex/config.py tests/services/config/test_llamaindex_settings.py- passedmamba run -n prw-deeptutor-py311 ruff format --check deeptutor/services/rag/pipelines/llamaindex/config.py tests/services/config/test_llamaindex_settings.py- passedgit diff --check- passedLimitation: I did not run the full
pre-commit run --all-files; validation was focused on the touched Python files and the relevant configuration tests.