Spaces:
Sleeping
Sleeping
Download component/sidebar.py from mgbam/MCP_Research: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/mgbam/MCP_Research/resolve/75e32f7da4167bce4cb03e860da9f44c4f9a0b3a/component/sidebar.py
- Command line
-
hf download hf://spaces/mgbam/MCP_Research@75e32f7da4167bce4cb03e860da9f44c4f9a0b3a/component/sidebar.py
-
curl -L -o sidebar.py https://huggingface.co/spaces/mgbam/MCP_Research/resolve/75e32f7da4167bce4cb03e860da9f44c4f9a0b3a/component/sidebar.py
1.11 kB
| # Sidebar component | |
| # File: components/sidebar.py | |
| import streamlit as st | |
| def render_sidebar(): | |
| """ | |
| Display the sidebar UI for user query input. | |
| Returns: | |
| query (str): The research query text. | |
| search_clicked (bool): Whether the search button was clicked. | |
| """ | |
| st.sidebar.header("π Research Query") | |
| query = st.sidebar.text_input("Enter your research topic:", "") | |
| search_clicked = st.sidebar.button("Search") | |
| return query, search_clicked | |
| # File: components/paper_list.py | |
| import streamlit as st | |
| def render_paper_list(papers): | |
| """ | |
| Display a list of papers with titles, authors, and abstracts. | |
| Args: | |
| papers (List[dict]): Each dict should have 'id', 'title', 'authors', 'abstract'. | |
| """ | |
| st.header("π Papers Found") | |
| if not papers: | |
| st.info("No papers found for this query.") | |
| return | |
| for paper in papers: | |
| with st.expander(paper.get("title", "Unknown Title")): | |
| st.markdown(f"**Authors:** {', '.join(paper.get('authors', []))}") | |
| st.write(paper.get("abstract", "No abstract available.")) |