-
Notifications
You must be signed in to change notification settings - Fork 787
Feature/new doc types #1169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jamesbraza
merged 23 commits into
Future-House:main
from
takeruhukushima:feature/new-doc-types
Nov 4, 2025
+523
−34
Merged
Feature/new doc types #1169
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 95e6e25
solve dependencies problem
takeruhukushima 2f32c8a
fix bug
takeruhukushima f7cc49d
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] e42e636
Merge remote-tracking branch 'origin/feature/new-doc-types'
takeruhukushima c801103
fix:pre-commit fail src/paperqa/readers.py
takeruhukushima 5e49ca1
add .docx,.pptx,.xlsx in settings.py
takeruhukushima 65c5097
refactor(chunks):consolidating the chunk code for office and pdf
takeruhukushima 5ead779
edit README.md:add .docx, .xlsx, .pptx, and code files (e.g., .py, .t…
takeruhukushima a7c5e3a
refactor: Unify chunking algorithm name for PDF and office documents
takeruhukushima 5fe86c1
feat: Add unstructured version to office document parsing metadata
takeruhukushima d4619bd
feat: Implement lazy import for unstructured in office document parsing
takeruhukushima 0be33fe
feat: Add unit test for office document parsing
takeruhukushima 0775523
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 84c6bf2
feat: Update test_parse_office_doc for Gemini models and RAG query
takeruhukushima e218d91
add mailmap takerufukushima
takeruhukushima 4933f16
fix pre-commit error
takeruhukushima 77b95cc
Merge branch 'feature/new-doc-types' of https://github.com/takeruhuku…
takeruhukushima 280c381
Fix: Address linting issues in test_paperqa.py
takeruhukushima d95ed9f
feat: Improve questions and assertions in test_parse_office_doc
takeruhukushima 057c7f8
feat: Enhance office document parsing tests and assertions
takeruhukushima f4975fc
Minor tweaks to test_parse_office_doc
jamesbraza 7bfad14
Updating assertions in other tests for this PR's changes
jamesbraza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: Add unit test for office document parsing
- Add a unit test for to verify parsing of .docx, .pptx, and .xlsx files.
- Add dummy office files to for testing purposes.
- Update test configuration to use OpenRouter and a non-OpenAI embedding model to avoid authentication
issues during testing.- Loading branch information
commit 0be33feb09eb4d73f533452ee7fcb6d8b464bbb0
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3108,3 +3108,30 @@ async def test_reader_config_propagation(stub_data_dir: Path) -> None: | |||||
| assert mock_read_doc.call_args.kwargs["chunk_chars"] == 2000 | ||||||
| assert mock_read_doc.call_args.kwargs["overlap"] == 50 | ||||||
| assert mock_read_doc.call_args.kwargs["dpi"] == 144 | ||||||
|
|
||||||
|
|
||||||
| @pytest.mark.asyncio | ||||||
| @pytest.mark.parametrize("filename", ["dummy.docx", "dummy.pptx", "dummy.xlsx"]) | ||||||
| async def test_parse_office_doc(stub_data_dir: Path, filename: str) -> None: | ||||||
| # This test requires the user to create dummy office files in tests/stub_data | ||||||
| # For example: | ||||||
| # touch tests/stub_data/dummy.docx | ||||||
| # touch tests/stub_data/dummy.pptx | ||||||
| # touch tests/stub_data/dummy.xlsx | ||||||
| file_path = stub_data_dir / filename | ||||||
| if not file_path.exists(): | ||||||
| pytest.skip(f"{filename} not found in stub_data") | ||||||
|
|
||||||
| docs = Docs() | ||||||
| settings = Settings( | ||||||
| llm="openrouter/google/gemma-7b-it", | ||||||
| llm_config={"api_key": os.environ.get("OPEN_ROUTER_API_KEY")}, | ||||||
| parsing=ParsingSettings( | ||||||
| use_doc_details=False, disable_doc_valid_check=True, defer_embedding=True | ||||||
|
||||||
| use_doc_details=False, disable_doc_valid_check=True, defer_embedding=True | |
| use_doc_details=False, disable_doc_valid_check=True |
I think you don't need to defer embeddings, we can embed right away
jamesbraza marked this conversation as resolved.
Show resolved
Hide resolved
jamesbraza marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you look at lint CI to fix this part
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you shouldn't need this,
litellmshould just auto checkOPENROUTER_API_KEY: https://docs.litellm.ai/docs/providers/openrouterSo maybe update your local env to have
OPENROUTER_API_KEY