PDF QA is a command-line tool that allows you to ask questions about the content of PDF documents using various Language Models (LLMs).
- 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
You can install PDF QA using pip:
pip install pdf_qa
To use PDF QA, run the following command:
pdf_qa <pdf_path_or_url> [options]
-l, --llm
: Choose the LLM to use (openai, anthropic, or google). Default is openai.-q, --question
: Ask a single question and exit.
-
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?"
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 histories are saved in the chat_histories
directory, allowing you to resume conversations in future sessions.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.