Build a chatbot powered by LlamaIndex that augments GPT 3.5 with the content of the Twilio SMS docs.
- Takes user queries via Streamlit's
st.chat_input
and displays both user queries and model responses withst.chat_message
- Uses LlamaIndex to load and index data and create a chat engine that will retrieve context from that data to respond to each user query
Create a secrets.toml
file with the following contents.
- You can add secrets while developing locally. To do this, add a file called secrets.toml in a folder called .streamlit at the root of your app repo and paste your secrets into that file.
openai_key = "<your OpenAI API key here>"
If you're working on your local machine, install dependencies using pip:
pip install streamlit openai llama-index nltk
If you're planning to deploy this app on Streamlit Community Cloud, create a requirements.txt file with the following contents:
streamlit
openai
llama-index
nltk
To run the app locally, use following command in the app route:
streamlit run app.py
You can get your own OpenAI API key by following the following instructions:
- Go to https://platform.openai.com/account/api-keys.
- Click on the
+ Create new secret key
button. - Next, enter an identifier name (optional) and click on the
Create secret key
button.
Once the app is loaded, enter your question about Twilio SMS senders for supported country.