This project demonstrates how to build a simple Q&A system using Python, Django, and OpenAI's GPT. The system can answer questions based on the context provided from a specific article. The user interface is built using HTML and Tailwind.
- Clone the repository:
git clone https://github.com/amirtds/python-openai
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the root directory of the project and add your OpenAI API key:
OPENAI_API_KEY=your_api_key
- Run migration and start the server:
cd llm_api
python manage.py migrate
python manage.py runserver
- Run the frontend:
cd frontend
python -m http.server 8080