Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
18c58db
feat: Add multimodal support for Office documents
takeruhukushima Nov 1, 2025
95e6e25
solve dependencies problem
takeruhukushima Nov 1, 2025
2f32c8a
fix bug
takeruhukushima Nov 1, 2025
f7cc49d
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Nov 1, 2025
e42e636
Merge remote-tracking branch 'origin/feature/new-doc-types'
takeruhukushima Nov 1, 2025
c801103
fix:pre-commit fail src/paperqa/readers.py
takeruhukushima Nov 2, 2025
5e49ca1
add .docx,.pptx,.xlsx in settings.py
takeruhukushima Nov 2, 2025
65c5097
refactor(chunks):consolidating the chunk code for office and pdf
takeruhukushima Nov 2, 2025
5ead779
edit README.md:add .docx, .xlsx, .pptx, and code files (e.g., .py, .t…
takeruhukushima Nov 2, 2025
a7c5e3a
refactor: Unify chunking algorithm name for PDF and office documents
takeruhukushima Nov 2, 2025
5fe86c1
feat: Add unstructured version to office document parsing metadata
takeruhukushima Nov 2, 2025
d4619bd
feat: Implement lazy import for unstructured in office document parsing
takeruhukushima Nov 2, 2025
0be33fe
feat: Add unit test for office document parsing
takeruhukushima Nov 2, 2025
0775523
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Nov 2, 2025
84c6bf2
feat: Update test_parse_office_doc for Gemini models and RAG query
takeruhukushima Nov 2, 2025
e218d91
add mailmap takerufukushima
takeruhukushima Nov 2, 2025
4933f16
fix pre-commit error
takeruhukushima Nov 2, 2025
77b95cc
Merge branch 'feature/new-doc-types' of https://github.com/takeruhuku…
takeruhukushima Nov 2, 2025
280c381
Fix: Address linting issues in test_paperqa.py
takeruhukushima Nov 2, 2025
d95ed9f
feat: Improve questions and assertions in test_parse_office_doc
takeruhukushima Nov 3, 2025
057c7f8
feat: Enhance office document parsing tests and assertions
takeruhukushima Nov 3, 2025
f4975fc
Minor tweaks to test_parse_office_doc
jamesbraza Nov 3, 2025
7bfad14
Updating assertions in other tests for this PR's changes
jamesbraza Nov 3, 2025
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
Prev Previous commit
Updating assertions in other tests for this PR's changes
  • Loading branch information
jamesbraza committed Nov 3, 2025
commit 7bfad1447316e559fc973fc586cf24fd397e921f
12 changes: 8 additions & 4 deletions tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ async def test_get_directory_index(
], "Incorrect fields in index"
assert not index.changed, "Expected index to not have changes at this point"
# bates.txt + empty.txt + flag_day.html + gravity_hill.md + influence.pdf
# + obama.txt + paper.pdf + pasa.pdf + duplicate_media.pdf,
# + obama.txt + paper.pdf + pasa.pdf + duplicate_media.pdf
# + dummy.docx + dummy.pptx + dummy.xlsx,
# but empty.txt fails to be added
path_to_id = await index.index_files
assert (
sum(id_ != FAILED_DOCUMENT_ADD_ID for id_ in path_to_id.values()) == 8
sum(id_ != FAILED_DOCUMENT_ADD_ID for id_ in path_to_id.values()) == 11
), "Incorrect number of parsed index files"

with subtests.test(msg="check-txt-query"):
Expand Down Expand Up @@ -159,9 +160,9 @@ async def test_get_directory_index(
),
):
index = await get_directory_index(settings=agent_test_settings)
# Subtract 1 for the removed obama.txt file,
# Subtract 4 for the removed obama.txt, dummy.docx, dummy.pptx, and dummy.xlsx files,
# and another 1 for the filtered out flag_day.html
assert len(await index.index_files) == len(path_to_id) - 2
assert len(await index.index_files) == len(path_to_id) - 4 - 1
mock_aadd.assert_not_awaited(), "Expected we didn't re-add files"

# Note let's delete files.zip, and confirm we can't load the index
Expand Down Expand Up @@ -261,6 +262,9 @@ async def test_getting_manifest(
"obama.txt",
"paper.pdf",
"pasa.pdf",
"dummy.docx",
"dummy.pptx",
"dummy.xlsx",
}


Expand Down
2 changes: 1 addition & 1 deletion tests/test_paperqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ async def test_chunk_metadata_reader(
assert "pdf" in metadata.name
assert isinstance(metadata.chunk_metadata, ChunkMetadata)
assert metadata.chunk_metadata.name
assert "overlap-pdf" in metadata.chunk_metadata.name
assert "overlap-document" in metadata.chunk_metadata.name
assert metadata.chunk_metadata.overlap == 100
assert metadata.chunk_metadata.size == 3000
assert len(chunk_text) > 2, "Expected multiple chunks, for meaningful assertions"
Expand Down
Loading