Replicate the app from the image.
Drop files here
or click to upload
import streamlit as st
import os
st.title("Talk 2 Data: For Streamlit")
st.caption("Submit Data Handover Team")
# Sidebar
with st.sidebar:
# File upload
uploaded_file = st.file_uploader("File Upload")
# Drop & Drop area
st.text_area("Drop & Drop", height=100)
# Clear Cache button
if st.button("Clear Cache"):
st.cache_data.clear()
st.rerun()
# Main error message
if not uploaded_file:
st.error("Error msg if file is not uploaded")
# Chat history section
st.subheader("Show Chat History")
# Initialize chat history
if "messages" not in st.session_state:
st.session_state.messages = []
# Display chat messages from history
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.write(message["content"])
# Chat input
if prompt := st.chat_input("User prompt:"):
# Add user message to chat history
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
st.write(prompt)
# Add system response
with st.chat_message("assistant"):
response = "This is a system response"
st.write(response)
st.session_state.messages.append({"role": "assistant", "content": response})
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?