Ani14 commited on
Commit
2dc258f
·
verified ·
1 Parent(s): b6a234b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -210,7 +210,7 @@ if research_button and topic:
210
  citations.append(generate_apa_citation(m['title'], m['url'], m['source']))
211
 
212
  with st.spinner("Synthesizing report..."):
213
- if report_type == "Summary - Short and fast (~2 min)":
214
  prompt = f"""
215
  You are a research assistant. Based on the following sources related to the topic **{topic}**, provide a concise and informative overview.
216
  Analyze and summarize based on the selected sources: {'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid (Web + Academic)'}.
@@ -218,7 +218,7 @@ Use a clear and accessible tone suitable for readers who want a quick understand
218
 
219
  """
220
 
221
- elif report_type == "Detailed Report (~5 min)":
222
  prompt = f"""
223
  You are a research analyst tasked with writing a structured research brief on the topic **{topic}**.
224
  Use the following sources ({'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid'}) to:
@@ -229,7 +229,7 @@ Use the following sources ({'Web Only' if source_type == 'Web Only' else 'Academ
229
 
230
  """
231
 
232
- else: # Thorough Academic Research (~10 min)
233
  prompt = f"""
234
  You are an expert researcher writing a full academic paper on the topic **{topic}** using sources from {'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid'}.
235
 
@@ -246,10 +246,10 @@ The paper should include the following sections:
246
 
247
  final_output = call_llm([{"role": "user", "content": prompt}])
248
 
249
- st.markdown(f"### {report_type}")
250
  st.markdown(final_output, unsafe_allow_html=True)
251
 
252
- if report_type == "Thorough Academic Research (~10 min)":
253
  with st.spinner("Preparing PDF and LaTeX..."):
254
  pdf_file = generate_pdf(final_output)
255
  latex_file = generate_latex(final_output)
 
210
  citations.append(generate_apa_citation(m['title'], m['url'], m['source']))
211
 
212
  with st.spinner("Synthesizing report..."):
213
+ if report_type == "Summary - Short and fast )":
214
  prompt = f"""
215
  You are a research assistant. Based on the following sources related to the topic **{topic}**, provide a concise and informative overview.
216
  Analyze and summarize based on the selected sources: {'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid (Web + Academic)'}.
 
218
 
219
  """
220
 
221
+ elif report_type == "Detailed Report ":
222
  prompt = f"""
223
  You are a research analyst tasked with writing a structured research brief on the topic **{topic}**.
224
  Use the following sources ({'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid'}) to:
 
229
 
230
  """
231
 
232
+ else: # Thorough Academic Research
233
  prompt = f"""
234
  You are an expert researcher writing a full academic paper on the topic **{topic}** using sources from {'Web Only' if source_type == 'Web Only' else 'Academic Only' if source_type == 'Academic Only' else 'Hybrid'}.
235
 
 
246
 
247
  final_output = call_llm([{"role": "user", "content": prompt}])
248
 
249
+ st.markdown(f" {report_type}")
250
  st.markdown(final_output, unsafe_allow_html=True)
251
 
252
+ if report_type == "Thorough Academic Research ":
253
  with st.spinner("Preparing PDF and LaTeX..."):
254
  pdf_file = generate_pdf(final_output)
255
  latex_file = generate_latex(final_output)