Spaces:
Sleeping
Sleeping
File size: 1,324 Bytes
0f01ba2 c08b7b9 c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a c6758aa 81bcd1a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
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
|