Spaces:
Running
Running
import streamlit as st | |
def render_sidebar(): | |
""" | |
Sidebar with all controls for the research companion app. | |
Returns: | |
- query (str): The user's main research query. | |
- num_results (int): Max number of papers to show. | |
- theme (str): 'Light' or 'Dark'. | |
- search_clicked (bool): Did user click Search? | |
- gemini_prompt (str): Optional Gemini Q&A question. | |
""" | |
st.sidebar.title("π MCP Research Companion") | |
# Main research topic input | |
query = st.sidebar.text_input( | |
label="Enter your research topic:", | |
value="", | |
placeholder="e.g. CRISPR delivery" | |
) | |
# Number of results slider | |
num_results = st.sidebar.slider( | |
label="Max papers to display", | |
min_value=1, | |
max_value=20, | |
value=5 | |
) | |
# Theme toggle | |
theme = st.sidebar.selectbox( | |
label="Theme", | |
options=["Light", "Dark"], | |
index=0 | |
) | |
# Gemini question input (for Q&A at any time) | |
gemini_prompt = st.sidebar.text_input( | |
label="π‘ Ask Gemini (about anything!):", | |
value="", | |
placeholder="e.g. Summarize the latest CRISPR techniques" | |
) | |
# Search button | |
search_clicked = st.sidebar.button("Search") | |
return query, num_results, theme, search_clicked, gemini_prompt | |