Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed chunk_size/overlap references missed in #1160
  • Loading branch information
jamesbraza committed Oct 29, 2025
commit 110e853971b65e820785d518ae771933876073e1
9 changes: 4 additions & 5 deletions src/paperqa/contrib/openreview_paper_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ async def fetch_relevant_papers(self, question: str) -> dict[str, Any]:
submissions = self.get_submissions()
submission_string = self.create_submission_string(submissions)

if len(submission_string) > self.settings.parsing.chunk_size:
chunk_size = self.settings.parsing.reader_config["chunk_chars"]
if len(submission_string) > chunk_size:
chunks = [
submission_string[i : i + self.settings.parsing.chunk_size]
for i in range(
0, len(submission_string), self.settings.parsing.chunk_size
)
submission_string[i : i + chunk_size]
for i in range(0, len(submission_string), chunk_size)
]
else:
chunks = [submission_string]
Expand Down
4 changes: 2 additions & 2 deletions src/paperqa/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,8 @@ def get_index_name(self) -> str:
str(self.agent.index.use_absolute_paper_directory),
self.embedding,
str(self.parsing.parse_pdf), # Don't use __name__ as lambda wouldn't differ
str(self.parsing.chunk_size),
str(self.parsing.overlap),
str(self.parsing.reader_config["chunk_chars"]),
str(self.parsing.reader_config["overlap"]),
self.parsing.chunking_algorithm,
str(self.parsing.multimodal),
]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ async def test_propagate_options(agent_test_settings: Settings) -> None:
assert len(result.contexts) >= 2, "Test expects a few contexts"
# Subtract 2 to allow tolerance for chunks with leading/trailing whitespace
num_contexts_sufficient_length = sum(
len(c.context) >= agent_test_settings.parsing.chunk_size - 2
len(c.context) >= agent_test_settings.parsing.reader_config["chunk_chars"] - 2
for c in result.contexts
)
# Check most contexts have the expected length
Expand Down