LANGCHAIN
COMPLETE
TUTORIAL FOR
BEGINNERS
Create An AI App To Talk With Your
Csv File Using Langchain &
Streamlit
TUTORIAL : 5
What is Streamlit
Streamlit turns data scripts into shareable web apps in minutes.
All in pure Python. No front‑end experience required.
AI App To Talk with csv file using pandas
dataframe agent and OpenAI
import streamlit as st
from [Link] import OpenAI
from [Link].agent_types import AgentType
from [Link] import create_pandas_dataframe_agent
import pandas as pd
st.set_page_config(page_title="AI APP TO TALK WITH CSV")
[Link]="ASK ANYTHING"
csv_file=st.file_uploader("upload your csv file",type="csv")
if csv_file is not None:
df=pd.read_csv("[Link]")
agent=create_pandas_dataframe_agent(llm=OpenAI(temperature=0),df=df,max_execution_time=1600,max_iterations=1000,verbose=True,agent_type=AgentType.ZERO_
SHOT_REACT_DESCRIPTION)
query=st.text_input("ask question to your csv")
if [Link]("Submit",type="primary"):
if query is not None:
response=[Link](query)
[Link](response)