A PDF question answering tool using various LLMs
Project description
PDF QA
PDF QA is a command-line tool that allows you to ask questions about the content of PDF documents using various Language Models (LLMs).
Features
- Supports multiple LLMs: OpenAI, Anthropic, and Google
- Handles both local PDF files and online PDF URLs
- Maintains conversation history for each PDF session
- Provides concise answers based on the PDF content
Installation
You can install PDF QA using pip:
pip install pdf_qa
Usage
To use PDF QA, run the following command:
pdf_qa <pdf_path_or_url> [options]
Options
-l, --llm: Choose the LLM to use (openai, anthropic, or google). Default is openai.-q, --question: Ask a single question and exit.
Examples
-
Interactive mode with a local PDF:
pdf_qa /path/to/your/document.pdf -
Using a specific LLM with an online PDF:
pdf_qa https://example.com/sample.pdf -l anthropic
-
Asking a single question:
pdf_qa /path/to/your/document.pdf -q "What is the main topic of this document?"
API Keys
On first use, you'll be prompted to enter your API key for the chosen LLM. The key will be saved for future use.
Chat History
Chat histories are saved in the chat_histories directory, allowing you to resume conversations in future sessions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_qa-0.1.10.tar.gz.
File metadata
- Download URL: pdf_qa-0.1.10.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
052448a333a73040bf3fc9e65e77b49c1c4eda01a24268fb6fe39a5757539313
|
|
| MD5 |
e8593078c115f84a14cebaab971ba227
|
|
| BLAKE2b-256 |
caad4de22701ecfc005ed3df78223119bd7a2a36509084cc42dcf671717a9dc7
|
File details
Details for the file pdf_qa-0.1.10-py3-none-any.whl.
File metadata
- Download URL: pdf_qa-0.1.10-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a5fd94ff317f5c9be783c9493523a230a134fad290e13e77f4fbb93784a9aa8
|
|
| MD5 |
6943f030530511858c4e1354909eba57
|
|
| BLAKE2b-256 |
ab2c6cd62a57002545ff69d77b5b9ef41e20dbc848073ca678da4d017fe3eb79
|