cryogenic22 commited on
Commit
b54644d
·
verified ·
1 Parent(s): cf8ac9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -84
app.py CHANGED
@@ -204,87 +204,55 @@ def main():
204
  report = st.session_state.current_report
205
  topic = st.session_state.current_topic
206
 
207
- st.markdown("""
208
- <div class="report-container">
209
- <!-- AI Disclaimer -->
210
- <div class="disclaimer">
211
- ⚠️ This report was generated using AI. While we strive for accuracy,
212
- please verify critical information independently before making decisions.
213
- </div>
214
-
215
- <!-- Report Title -->
216
- <h1 class="section-heading">📊 Market Research Report: {}</h1>
217
-
218
- <!-- Executive Summary -->
219
- <div class="report-section executive-summary">
220
- <h2 class="section-heading">Executive Summary</h2>
221
- <div class="content-block">{}</div>
222
-
223
- <h3 class="subsection-heading">Key Market Highlights</h3>
224
- <div class="content-block">{}</div>
225
-
226
- <h3 class="subsection-heading">Strategic Implications</h3>
227
- <div class="content-block">{}</div>
228
-
229
- <h3 class="subsection-heading">Recommendations</h3>
230
- <div class="content-block">{}</div>
231
- </div>
232
-
233
- <!-- Market Analysis -->
234
- <div class="report-section market-analysis">
235
- <h2 class="section-heading">Market Analysis</h2>
236
-
237
- <h3 class="subsection-heading">Market Overview</h3>
238
- <div class="content-block">{}</div>
239
-
240
- <h3 class="subsection-heading">Industry Dynamics</h3>
241
- <div class="content-block">{}</div>
242
-
243
- <h3 class="subsection-heading">Competitive Landscape</h3>
244
- <div class="content-block">{}</div>
245
-
246
- <h3 class="subsection-heading">Strategic Analysis</h3>
247
- <div class="content-block">{}</div>
248
- </div>
249
-
250
- <!-- Future Outlook -->
251
- <div class="report-section future-outlook">
252
- <h2 class="section-heading">Future Outlook</h2>
253
- <div class="content-block">{}</div>
254
- </div>
255
-
256
- <!-- Sources -->
257
- <div class="report-section sources-section">
258
- <h2 class="section-heading">Sources</h2>
259
- {}
260
- </div>
261
- </div>
262
- """.format(
263
- topic,
264
- report['exec_summary']['summary'],
265
- report['exec_summary']['market_highlights'],
266
- report['exec_summary']['strategic_implications'],
267
- report['exec_summary']['recommendations'],
268
- report['market_analysis']['overview'],
269
- report['market_analysis']['dynamics'],
270
- report['market_analysis']['competitive_landscape'],
271
- report['market_analysis']['strategic_analysis'],
272
- report['future_outlook'],
273
- '\n'.join([f'<div class="source-item">• {source}</div>' for source in report['sources']])
274
- ), unsafe_allow_html=True)
275
-
276
- # Download button with custom styling
277
- st.markdown("""
278
- <div style="text-align: center; margin-top: 30px;">
279
- <button class="download-button" onclick="alert('Use the Streamlit download button below')">
280
- 📥 Download Complete Report
281
- </button>
282
- </div>
283
- """, unsafe_allow_html=True)
284
-
285
- # Actual download functionality
286
  st.download_button(
287
- "Download Report",
288
  data=f"""# Market Research Report: {topic}
289
 
290
  ## Executive Summary
@@ -317,16 +285,14 @@ def main():
317
  {report['future_outlook']}
318
 
319
  ## Sources
320
- {chr(10).join([f" {source}" for source in report['sources']])}""",
321
  file_name=f"{topic.lower().replace(' ', '_')}_market_research.md",
322
  mime="text/markdown",
323
- key='download_button',
324
- help="Click to download the complete report"
325
  )
326
 
327
  except Exception as e:
328
  st.error(f"Error displaying report: {str(e)}")
329
  st.write("Raw report data:", report) # Debug information
330
-
331
  if __name__ == "__main__":
332
  main()
 
204
  report = st.session_state.current_report
205
  topic = st.session_state.current_topic
206
 
207
+ # Display AI Disclaimer
208
+ st.warning("⚠️ This report was generated using AI. While we strive for accuracy, please verify critical information independently.")
209
+
210
+ # Report Title
211
+ st.title(f"📊 Market Research Report: {topic}")
212
+
213
+ # Executive Summary Section
214
+ st.header("Executive Summary")
215
+ st.write(report['exec_summary']['summary'])
216
+
217
+ with st.expander("Key Market Highlights", expanded=True):
218
+ st.write(report['exec_summary']['market_highlights'])
219
+
220
+ with st.expander("Strategic Implications", expanded=True):
221
+ st.write(report['exec_summary']['strategic_implications'])
222
+
223
+ with st.expander("Key Recommendations", expanded=True):
224
+ st.write(report['exec_summary']['recommendations'])
225
+
226
+ # Market Analysis Section
227
+ st.header("Market Analysis")
228
+
229
+ col1, col2 = st.columns(2)
230
+ with col1:
231
+ st.subheader("Market Overview")
232
+ st.write(report['market_analysis']['overview'])
233
+
234
+ st.subheader("Industry Dynamics")
235
+ st.write(report['market_analysis']['dynamics'])
236
+
237
+ with col2:
238
+ st.subheader("Competitive Landscape")
239
+ st.write(report['market_analysis']['competitive_landscape'])
240
+
241
+ st.subheader("Strategic Analysis")
242
+ st.write(report['market_analysis']['strategic_analysis'])
243
+
244
+ # Future Outlook
245
+ st.header("Future Outlook")
246
+ st.write(report['future_outlook'])
247
+
248
+ # Sources
249
+ st.header("Sources")
250
+ for source in report['sources']:
251
+ st.markdown(f"- {source}")
252
+
253
+ # Download Report
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  st.download_button(
255
+ label="📥 Download Complete Report",
256
  data=f"""# Market Research Report: {topic}
257
 
258
  ## Executive Summary
 
285
  {report['future_outlook']}
286
 
287
  ## Sources
288
+ {chr(10).join([f"- {source}" for source in report['sources']])}""",
289
  file_name=f"{topic.lower().replace(' ', '_')}_market_research.md",
290
  mime="text/markdown",
 
 
291
  )
292
 
293
  except Exception as e:
294
  st.error(f"Error displaying report: {str(e)}")
295
  st.write("Raw report data:", report) # Debug information
296
+
297
  if __name__ == "__main__":
298
  main()