TitanBot is a Python chatbot that leverages the OpenAI API to query ChatGPT and interact with your transportation database. It allows users to ask natural language questions, query SQL databases, and receive insightful responses with interactive visuals. TitanBot can also dynamically generate and execute Python code, enabling real-time data analysis and customized outputs based on user queries.
Follow these steps to install and configure TitanBot locally:
Make sure you have:
- Python 3.7 or later (https://www.python.org/downloads/)
- OpenAI API key (https://platform.openai.com/api-keys)
- Docker Installed and Running (https://docs.docker.com/engine/install/)
git clone https://github.com/Conj43/TitanBot.git
cd TitanBot/'TitanBot Code'
python -m venv venv
venv\Scripts\activate
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
set OPENAI_API_KEY=your-openai-api-key
$env:OPENAI_API_KEY="your-openai-api-key"
export OPENAI_API_KEY=your-openai-api-key
deactivate
venv\Scripts\activate
deactivate
source venv/bin/activate
streamlit run main.py
streamlit run main.py --server.maxUploadSize 400
You'll need to upload a database in order to chat with TitanBot. You may use a SQLite database, one or multiple CSV files, or an API link to a database. Databases are opened in Read-Only mode, and CSV files and API links are queried by creating temporary SQLite databases, so no need to worry about data corruption.
- Make sure Docker is running, you can check by running
docker info
in your terminal - Check to see if you have Python downloaded by running
python --version
orpython3 --version
- Double check your OPENAI API KEY is set correctly (run one of the following depending on your OS and it should print your api key)
echo %OPENAI_API_KEY%
on Windows (Command Prompt)$env:OPENAI_API_KEY
on Windows (PowerShell)echo $OPENAI_API_KEY
on Linux/macOS
SQL_Schema_Demo.mp4
One_Year_Speed_Index_Demo.mp4
Accident_Map_Demo.mp4
Average_TMC_Speed_Plot.mp4
TTI_to_CSV_Demo.mp4
If you have any questions, suggestions, or feedback, please feel free to reach out to us via one of our emails. We would love to hear from you!
- Neema Jakisa Owor: nodyv@missouri.edu
- Connor Joyce: cpjtdx@missouri.edu
We welcome and encourage contributions from the community! If you have ideas on how to expand or improve this project, please fork the repository and submit a pull request. Let's make this project even better together.