Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from new import chat_with_chatseo | |
| import pandas as pd | |
| st.set_page_config(layout="wide") | |
| i, j = st.columns(2) | |
| #set title | |
| with i: | |
| st.title("Chat with ChatSEO") | |
| #create 3 input boxes for the 3 input variables | |
| issue = st.text_input("Issue") | |
| description = st.text_input("Description") | |
| url = st.text_input("URL") | |
| #create button and on press, run the chain | |
| if st.button("Run"): | |
| #run the chain | |
| output = chat_with_chatseo(issue, description, url).content | |
| #display the output | |
| st.write(output) | |
| with j: | |
| st.write("## Upload a csv file") | |
| # Upload a csv file using streamlit and show the data | |
| uploaded_file = st.file_uploader("Choose a CSV file") | |
| if uploaded_file is not None: | |
| df = pd.read_csv(uploaded_file) | |
| result_df = df[df["Issue Priority"] == "High"].drop(["URLs", "% of Total", "How To Fix"], axis=1) | |
| st.write(result_df) | |
| for index, row in result_df.iterrows(): | |
| with st.expander(row["Issue Name"]): | |
| st.write(row["Description"]) | |
| if st.button("Fix Issue", key=index): | |
| output = chat_with_chatseo(row["Issue Name"], row["Description"], "https://www.upthrust.io").content | |
| st.write(output) |