Update app.py
Browse files
app.py
CHANGED
|
@@ -94,6 +94,13 @@ st.markdown("""
|
|
| 94 |
margin: 10px 0;
|
| 95 |
border: 1px solid #0d8bf2;
|
| 96 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
</style>
|
| 98 |
""", unsafe_allow_html=True)
|
| 99 |
|
|
@@ -147,7 +154,6 @@ with st.sidebar:
|
|
| 147 |
voices = voiceover_agent.get_voices()
|
| 148 |
|
| 149 |
if voices:
|
| 150 |
-
# Fixed selectbox syntax
|
| 151 |
selected_voice = st.selectbox(
|
| 152 |
"Choose a voice:",
|
| 153 |
options=[v['voice_id'] for v in voices],
|
|
@@ -196,7 +202,7 @@ if st.session_state.generating:
|
|
| 196 |
|
| 197 |
# Prepare download package
|
| 198 |
zip_buffer = io.BytesIO()
|
| 199 |
-
with zipfile.ZipFile(zip_buffer, "a") as zip_file:
|
| 200 |
zip_file.writestr("executive_summary.json", json.dumps(outline, indent=2))
|
| 201 |
zip_file.writestr("workshop_content.json", json.dumps(content, indent=2))
|
| 202 |
zip_file.writestr("boardroom_slides.md", slides)
|
|
@@ -206,8 +212,8 @@ if st.session_state.generating:
|
|
| 206 |
try:
|
| 207 |
img_data = requests.get(design_url).content
|
| 208 |
zip_file.writestr("slide_design.png", img_data)
|
| 209 |
-
except:
|
| 210 |
-
|
| 211 |
# Add voiceovers to ZIP
|
| 212 |
for filename, audio_data in voiceovers.items():
|
| 213 |
zip_file.writestr(f"voiceovers/{filename}", audio_data)
|
|
@@ -239,6 +245,7 @@ if st.session_state.generated:
|
|
| 239 |
|
| 240 |
# Executive summary
|
| 241 |
with st.expander("📊 Executive Overview", expanded=True):
|
|
|
|
| 242 |
st.subheader(st.session_state.outline.get("title", "Strategic Workshop"))
|
| 243 |
st.caption(f"Duration: {st.session_state.outline.get('duration', '4 hours')} | Level: {st.session_state.outline.get('difficulty', 'Executive')}")
|
| 244 |
|
|
@@ -252,6 +259,7 @@ if st.session_state.generated:
|
|
| 252 |
"- Implementation toolkit\n"
|
| 253 |
"- ROI calculation framework\n"
|
| 254 |
"- Enterprise integration guide")
|
|
|
|
| 255 |
|
| 256 |
# Workshop content
|
| 257 |
with st.expander("📝 Strategic Content Framework"):
|
|
@@ -347,4 +355,23 @@ st.markdown("""
|
|
| 347 |
<div style="text-align: center; padding: 20px; color: #aaa;">
|
| 348 |
Workshop in a Box Pro® | Enterprise-Grade AI Training Solutions | © 2025
|
| 349 |
</div>
|
| 350 |
-
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
margin: 10px 0;
|
| 95 |
border: 1px solid #0d8bf2;
|
| 96 |
}
|
| 97 |
+
.executive-summary {
|
| 98 |
+
background: linear-gradient(to right, #1a2980, #26d0ce);
|
| 99 |
+
padding: 25px;
|
| 100 |
+
border-radius: 15px;
|
| 101 |
+
margin-bottom: 25px;
|
| 102 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
|
| 103 |
+
}
|
| 104 |
</style>
|
| 105 |
""", unsafe_allow_html=True)
|
| 106 |
|
|
|
|
| 154 |
voices = voiceover_agent.get_voices()
|
| 155 |
|
| 156 |
if voices:
|
|
|
|
| 157 |
selected_voice = st.selectbox(
|
| 158 |
"Choose a voice:",
|
| 159 |
options=[v['voice_id'] for v in voices],
|
|
|
|
| 202 |
|
| 203 |
# Prepare download package
|
| 204 |
zip_buffer = io.BytesIO()
|
| 205 |
+
with zipfile.ZipFile(zip_buffer, "a", zipfile.ZIP_DEFLATED) as zip_file:
|
| 206 |
zip_file.writestr("executive_summary.json", json.dumps(outline, indent=2))
|
| 207 |
zip_file.writestr("workshop_content.json", json.dumps(content, indent=2))
|
| 208 |
zip_file.writestr("boardroom_slides.md", slides)
|
|
|
|
| 212 |
try:
|
| 213 |
img_data = requests.get(design_url).content
|
| 214 |
zip_file.writestr("slide_design.png", img_data)
|
| 215 |
+
except Exception as e:
|
| 216 |
+
st.error(f"Design download error: {str(e)}")
|
| 217 |
# Add voiceovers to ZIP
|
| 218 |
for filename, audio_data in voiceovers.items():
|
| 219 |
zip_file.writestr(f"voiceovers/{filename}", audio_data)
|
|
|
|
| 245 |
|
| 246 |
# Executive summary
|
| 247 |
with st.expander("📊 Executive Overview", expanded=True):
|
| 248 |
+
st.markdown(f"<div class='executive-summary'>", unsafe_allow_html=True)
|
| 249 |
st.subheader(st.session_state.outline.get("title", "Strategic Workshop"))
|
| 250 |
st.caption(f"Duration: {st.session_state.outline.get('duration', '4 hours')} | Level: {st.session_state.outline.get('difficulty', 'Executive')}")
|
| 251 |
|
|
|
|
| 259 |
"- Implementation toolkit\n"
|
| 260 |
"- ROI calculation framework\n"
|
| 261 |
"- Enterprise integration guide")
|
| 262 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 263 |
|
| 264 |
# Workshop content
|
| 265 |
with st.expander("📝 Strategic Content Framework"):
|
|
|
|
| 355 |
<div style="text-align: center; padding: 20px; color: #aaa;">
|
| 356 |
Workshop in a Box Pro® | Enterprise-Grade AI Training Solutions | © 2025
|
| 357 |
</div>
|
| 358 |
+
""", unsafe_allow_html=True)
|
| 359 |
+
|
| 360 |
+
# Debug info
|
| 361 |
+
with st.sidebar:
|
| 362 |
+
st.divider()
|
| 363 |
+
if hasattr(voiceover_agent, 'api_key') and voiceover_agent.api_key:
|
| 364 |
+
st.success("ElevenLabs API Key Found")
|
| 365 |
+
elif include_voiceover:
|
| 366 |
+
st.warning("ElevenLabs API key not set")
|
| 367 |
+
|
| 368 |
+
st.info(f"""
|
| 369 |
+
**Current Workshop:**
|
| 370 |
+
{st.session_state.workshop_topic}
|
| 371 |
+
|
| 372 |
+
**Premium Features:**
|
| 373 |
+
- AI-generated voiceovers
|
| 374 |
+
- Professional slide designs
|
| 375 |
+
- Fortune 500 case studies
|
| 376 |
+
- Practical code labs
|
| 377 |
+
""")
|