Spaces:
Sleeping
Sleeping
File size: 818 Bytes
bf01420 14749b0 bf01420 8fd3f77 f6a6c9b 8fd3f77 bf01420 14749b0 bf01420 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import streamlit as st
from ai_agent import AIAgent
agent = AIAgent()
# Create a title and description
st.title("Pandas AI Agent App 🤖")
st.markdown("""
AI agent to answer questions about a CSV file using the pandas library.
This app is a demo of my [GitHub repository](https://github.com/0xrsydn/Data-AI-Agent)
""")
# Get user input
file = st.file_uploader("Upload CSV file")
agent_input = st.text_input("Enter question")
if st.button('Execute'):
if file is not None and agent_input != "":
# Create a loading spinner
with st.spinner('Running the agent...'):
# Call the pandas_agent function
output = agent.pandas_agent(file, agent_input)
# Display the output
st.write(output)
else:
st.write("Please upload a file and enter a question.") |