-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (29 loc) · 1.07 KB
/
app.py
File metadata and controls
36 lines (29 loc) · 1.07 KB
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
import streamlit as st
from gemini_client import generate_response
from prompt_templates import research_prompt
from utils import create_output_directory, save_as_markdown
st.set_page_config(
page_title="Gen-AI Research Assistant",
page_icon="🧠",
layout="centered"
)
st.title("🧠 Gen-AI Research Assistant")
st.markdown(
"Generate structured, research-grade explanations using Google Gemini."
)
topic = st.text_input(
"Enter a Computer Science topic:",
placeholder="e.g., Bloom Filters, Recursion, Transformers, ACID Properties"
)
if st.button("Generate Research"):
if not topic.strip():
st.warning("Please enter a topic.")
else:
with st.spinner("Generating research content..."):
prompt = research_prompt(topic)
response = generate_response(prompt)
output_dir = create_output_directory()
file_path = save_as_markdown(topic, response, output_dir)
st.success("Research content generated successfully!")
st.markdown(response)
st.caption(f"Saved to: `{file_path}`")