Exposed reader_config setting to set DPI and simplify settings#1160
Merged
jamesbraza merged 2 commits intomainfrom Oct 29, 2025
Merged
Exposed reader_config setting to set DPI and simplify settings#1160jamesbraza merged 2 commits intomainfrom
reader_config setting to set DPI and simplify settings#1160jamesbraza merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors parsing configuration by introducing a reader_config dictionary field to centralize document reader parameters, while deprecating three existing fields (chunk_size, overlap, pdfs_use_block_parsing). The changes aim to improve API flexibility by allowing arbitrary keyword arguments to be passed to the document reader.
Key changes:
- Added
reader_configdictionary field toParsingSettingsfor passing custom parameters to the document reader - Implemented deprecation warnings for
chunk_size,overlap, andpdfs_use_block_parsingfields with automatic migration toreader_config - Updated default values for
chunk_chars(3000→5000) andoverlap(100→250) inread_docfunction
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/paperqa/settings.py |
Adds reader_config field and deprecation validator to migrate old fields |
src/paperqa/docs.py |
Removes explicit parameter passing in favor of reader_config unpacking |
src/paperqa/readers.py |
Updates default values for chunk_chars and overlap parameters |
tests/test_paperqa.py |
Adds tests for deprecation warnings and config propagation |
README.md |
Documents the new reader_config field |
Comments suppressed due to low confidence (1)
src/paperqa/settings.py:973
- The
get_index_namemethod still uses deprecated fieldschunk_sizeandoverlapdirectly for index name generation. This will cause issues when these fields are removed in version 6. Consider updating to usereader_configvalues (with fallback to deprecated fields) to ensure consistent index names across the deprecation transition period.
str(self.parsing.chunk_size),
str(self.parsing.overlap),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62b2606 to
944451b
Compare
jamesbraza
commented
Oct 29, 2025
| doc: Doc, | ||
| parsed_text_only: bool = False, | ||
| include_metadata: bool = False, | ||
| chunk_chars: int = 3000, |
Collaborator
Author
There was a problem hiding this comment.
These were lagging our defaults in Settings, so this re-syncs them
jamesbraza
added a commit
that referenced
this pull request
Oct 29, 2025
jamesbraza
added a commit
that referenced
this pull request
Oct 29, 2025
jamesbraza
added a commit
that referenced
this pull request
Oct 29, 2025
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.
This PR allows users to: