In this cookbook recipe, we are going to show how we can index a SQL Table to perform question answering on the table using llama-index and Prem AI. We also Streamlit to provide a nice UI of the overall project.
The step by step tutorial is available here
It's quite simple. First clone the repository:
git clone https://github.com/premAI-io/cookbook.git
cd cookbook/chat-with-sql
After that, create a virtual environment and install the requirements.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Before running the app, please do not forget to add the following values:
premai_api_key = "xxxx-xxxx-xxxx"
premai_project_id = xxxx
username = 'xxxxx'
password = 'xxxxx'
database = 'xxxxx'
inside secrets.toml.template
file and remove .template
from it. To run the app, type the following command:
streamlit run app.py