Skip to content

Conversation

@jamesbraza
Copy link
Collaborator

This brief refactor moves our reader layer to allow for async readers.

@jamesbraza jamesbraza self-assigned this Nov 17, 2025
Copilot AI review requested due to automatic review settings November 17, 2025 22:31
@jamesbraza jamesbraza added the enhancement New feature or request label Nov 17, 2025
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 17, 2025
@dosubot
Copy link

dosubot bot commented Nov 17, 2025

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copilot finished reviewing on behalf of jamesbraza November 17, 2025 22:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the PDF parsing infrastructure to support both synchronous and asynchronous PDF parsers, allowing greater flexibility in how PDFs are processed.

Key Changes:

  • Introduces separate protocol definitions for sync (SyncPDFParserFn) and async (AsyncPDFParserFn) PDF parsers
  • Updates read_doc to detect and handle both sync and async PDF parsers using runtime inspection
  • Modifies the Zotero integration to handle async parser results

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/paperqa/readers.py Splits PDFParserFn into separate sync/async protocols and adds runtime detection logic in read_doc to handle both types
src/paperqa/contrib/zotero.py Adds handling for async PDF parser results in the iterate method using asyncio.run()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 18, 2025
@jamesbraza jamesbraza merged commit dc26780 into main Nov 18, 2025
7 checks passed
@jamesbraza jamesbraza deleted the async-reader branch November 18, 2025 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants