Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 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"
|
| 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()
|