Skip to content

A CLI tool for chatting with any PDF using AI. Includes Vector Store and RAG Implementation with LangChain.

Notifications You must be signed in to change notification settings

umutbozdag/pdf-qa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Interactive mode with a local PDF:

    pdf_qa /path/to/your/document.pdf
  2. Using a specific LLM with an online PDF:

    pdf_qa https://example.com/sample.pdf -l anthropic
  3. 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.

About

A CLI tool for chatting with any PDF using AI. Includes Vector Store and RAG Implementation with LangChain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages