Build an LLM powered Ask the Data App with LangChain (using the Pandas DataFrame Agent) and Streamlit.
This app uses the Pandas DataFrame Agent from LangChain to allow you to ask questions about a Pandas DataFrame.
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, do the following in sequential order:
- Upload a CSV file (you can also tweak the underlying code to have it read in other tabular formats such as Excel or tab delimited files.
- Select an example query from the drop-down menu or provide your own custom query (by selecting the Other option)
- Enter your OpenAI API key
That's all and the Pandas DataFrame Agent will start to work on your query.