Github: https://github.com/zeynallow/pdf-qa-agent
This project lets users upload a PDF and ask questions about its content using OpenAI's GPT models via LangChain.
git clone https://github.com/zeynallow/pdf-qa-agent.git cd pdf-qa-agent python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows pip install -r requirements.txt
Create a .env
file:
OPENAI_API_KEY=your-api-key-here
uvicorn main:app --reload
POST /upload
GET /ask?q=your-question
curl -X POST -F 'file=@example.pdf' http://localhost:8000/upload curl "http://localhost:8000/ask?q=What is this document about?"