# app.py import streamlit as st import requests API_URL = " http://127.0.0.1:8000" # Update this if deploying via Docker/Spaces st.set_page_config(page_title="Research Assistant", layout="wide") st.title("📚 LangChain-Powered Research Assistant") query = st.text_input("Enter your research question") if st.button("Ask"): if query.strip(): with st.spinner("Searching documents..."): try: response = requests.post(API_URL, json={"query": query}) result = response.json() st.success("Answer:") st.markdown(result["answer"]) except Exception as e: st.error(f"Error: {e}")