Spaces:
Runtime error
Runtime error
Download app.py from Nikpatil/chatbot_theme_identifier: direct link, hf CLI and curl.
- Browser
- Download file 713 Bytes
-
https://huggingface.co/spaces/Nikpatil/chatbot_theme_identifier/resolve/main/app.py
- Command line
-
hf download hf://spaces/Nikpatil/chatbot_theme_identifier/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Nikpatil/chatbot_theme_identifier/resolve/main/app.py
713 Bytes
| # 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}") | |