Spaces:
Sleeping
Sleeping
up
Browse files
app.py
CHANGED
|
@@ -1,30 +1,16 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from
|
| 3 |
-
import pandas as pd
|
| 4 |
-
from langchain_openai import OpenAI
|
| 5 |
-
import os
|
| 6 |
-
from langchain_openai import ChatOpenAI
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
st.title("Let's do some analysis on your CSV")
|
| 12 |
st.header("Please upload your CSV file here:")
|
| 13 |
|
| 14 |
# Capture the CSV file
|
| 15 |
data = st.file_uploader("Upload CSV file",type="csv")
|
| 16 |
-
|
| 17 |
-
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
| 18 |
-
agent_executor = create_pandas_dataframe_agent(
|
| 19 |
-
llm,
|
| 20 |
-
df,
|
| 21 |
-
agent_type="tool-calling",
|
| 22 |
-
verbose=True
|
| 23 |
-
)
|
| 24 |
query = st.text_area("Enter your query")
|
| 25 |
button = st.button("Generate Response")
|
| 26 |
|
| 27 |
if button:
|
| 28 |
# Get Response
|
| 29 |
-
answer =
|
| 30 |
st.write(answer)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from utils import query_agent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
st.title("Let's do some analysis on your CSV")
|
| 5 |
st.header("Please upload your CSV file here:")
|
| 6 |
|
| 7 |
# Capture the CSV file
|
| 8 |
data = st.file_uploader("Upload CSV file",type="csv")
|
| 9 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
query = st.text_area("Enter your query")
|
| 11 |
button = st.button("Generate Response")
|
| 12 |
|
| 13 |
if button:
|
| 14 |
# Get Response
|
| 15 |
+
answer = query_agent(data,query)
|
| 16 |
st.write(answer)
|