pymupdf / RAG

RAG (Retrieval-Augmented Generation) Chatbot Examples Using PyMuPDF
https://pymupdf.readthedocs.io/en/latest/pymupdf4llm
GNU Affero General Public License v3.0
539 stars 82 forks source link

Update pymupdf_rag.py to fix compatibility issue with Python 3.9 #27

Closed shenyimings closed 5 months ago

shenyimings commented 5 months ago

The pdf4llm library currently uses the | operator for type hinting in its code. However, this operator is only supported in Python 3.10 and above. When running the library on Python 3.9, the following error is encountered:

TypeError: unsupported operand type(s) for |: 'type' and 'type' This issue prevents users from utilizing the pdf4llm library with Python 3.9, limiting its compatibility and usability.

To address this problem, the code should be modified to use a compatible syntax that works with Python 3.9. This will allow the library to be used seamlessly across different Python versions, including Python 3.9.

Please consider updating the code to remove the usage of the | operator and replace it with a compatible alternative. This will greatly enhance the library's compatibility and make it accessible to a wider range of users.

Thank you for your attention to this matter.

image

JorjMcKie commented 5 months ago

Fixed in version 0.0.4.