import streamlit as st import pandas as pd import numpy as np from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_google_genai import GoogleGenerativeAI st.markdown("

AI Chat Over Your Docs

",unsafe_allow_html=True) st.title("📄 Document Uploader") # File uploader accepts any type of file uploaded_file = st.file_uploader("Upload your document", type=None) if uploaded_file is not None: st.success(f"✅ Uploaded: {uploaded_file.name}") # Display file content (if it's text-based) try: content = uploaded_file.read().decode("utf-8") st.text_area("File Content", content, height=300) except: st.warning("Cannot display this file type directly.") # Optional: Save the file with open(f"saved_{uploaded_file.name}", "wb") as f: f.write(uploaded_file.getbuffer()) st.info(f"Saved to: saved_{uploaded_file.name}")