Demo how to use Azure hosted Search and AI to answer questions based on documents
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
source venv/bin/activate # On Windows use `venv\Scripts\activate`
python rebuild_database.py
The questions are stored in questions.csv
update that file, but keep the
header line.
source venv/bin/activate # On Windows use `venv\Scripts\activate`
python add_questions.py
source venv/bin/activate # On Windows use `venv\Scripts\activate`
python process.py
source venv/bin/activate # On Windows use `venv\Scripts\activate`
python show_results.py
The code depends on the following environment variables to be set. Either via export commands in the current shell, or stored in a .env file. (Don't commit the .env)
- DB_USER
- DB_PASS
- DEBUG (optionally)
- AISEARCH_API_KEY
- OPENAI_API_KEY
- LOCAL (optionally, use sqlite database)