A lightweight Flask web app that answers questions about a CSV-based product catalog using the OpenAI API.
- Uses the
sample_data.csvcatalog for grounded responses. - Simple web UI with running chat history stored in the user session.
- Safe prompts that encourage product-focused answers.
- Install dependencies:
pip install -r requirements.txt
- Set your API key:
export OPENAI_API_KEY=your_key_here # Optional: export SECRET_KEY=your_session_secret
- Run the server:
flask --app app run --host 0.0.0.0 --port 5000
- Open
http://localhost:5000and ask about the catalog (e.g., "Do you have a backpack for hikes?").
- The app reads from
sample_data.csv; update that file with your own catalog rows to change the knowledge base. - If no API key is present, the bot will remind you to set
OPENAI_API_KEYinstead of calling the API.