Rename package.json to app.py
Browse files- app.py +85 -0
- package.json +0 -40
app.py
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# File: app.py
|
2 |
+
import streamlit as st
|
3 |
+
import json
|
4 |
+
import zipfile
|
5 |
+
import io
|
6 |
+
import time
|
7 |
+
from agents import TopicAgent, ContentAgent, SlideAgent, CodeAgent
|
8 |
+
|
9 |
+
# Initialize agents
|
10 |
+
topic_agent = TopicAgent()
|
11 |
+
content_agent = ContentAgent()
|
12 |
+
slide_agent = SlideAgent()
|
13 |
+
code_agent = CodeAgent()
|
14 |
+
|
15 |
+
# Streamlit UI
|
16 |
+
st.set_page_config(page_title="Workshop in a Box", layout="wide")
|
17 |
+
st.image("https://i.imgur.com/3fXQ0DB.png", width=200)
|
18 |
+
st.title("🤖 Workshop in a Box")
|
19 |
+
st.caption("Generate corporate AI training workshops in minutes")
|
20 |
+
|
21 |
+
# Sidebar configuration
|
22 |
+
with st.sidebar:
|
23 |
+
st.header("Configuration")
|
24 |
+
workshop_topic = st.text_input("Workshop Topic", "Advanced Prompt Engineering")
|
25 |
+
duration = st.slider("Duration (hours)", 1.0, 8.0, 2.0)
|
26 |
+
difficulty = st.selectbox("Difficulty", ["Beginner", "Intermediate", "Advanced"])
|
27 |
+
include_code = st.checkbox("Include Code Labs", True)
|
28 |
+
include_voiceover = st.checkbox("Include Voiceovers", False)
|
29 |
+
|
30 |
+
if st.button("✨ Generate Workshop", type="primary"):
|
31 |
+
with st.spinner("Creating your workshop materials..."):
|
32 |
+
# Agent pipeline
|
33 |
+
start_time = time.time()
|
34 |
+
outline = topic_agent.generate_outline(workshop_topic, duration, difficulty)
|
35 |
+
content = content_agent.generate_content(outline)
|
36 |
+
slides = slide_agent.generate_slides(content)
|
37 |
+
code_labs = code_agent.generate_code(content) if include_code else {}
|
38 |
+
|
39 |
+
# Prepare download package
|
40 |
+
zip_buffer = io.BytesIO()
|
41 |
+
with zipfile.ZipFile(zip_buffer, "a") as zip_file:
|
42 |
+
zip_file.writestr("outline.json", json.dumps(outline, indent=2))
|
43 |
+
zip_file.writestr("content.json", json.dumps(content, indent=2))
|
44 |
+
zip_file.writestr("slides.md", slides)
|
45 |
+
if code_labs:
|
46 |
+
zip_file.writestr("code_labs.ipynb", code_labs)
|
47 |
+
|
48 |
+
st.session_state.outline = outline
|
49 |
+
st.session_state.content = content
|
50 |
+
st.session_state.slides = slides
|
51 |
+
st.session_state.code_labs = code_labs
|
52 |
+
st.session_state.zip_buffer = zip_buffer
|
53 |
+
st.session_state.gen_time = round(time.time() - start_time, 2)
|
54 |
+
|
55 |
+
# Results display
|
56 |
+
if "outline" in st.session_state:
|
57 |
+
st.success(f"Generated workshop materials in {st.session_state.gen_time} seconds!")
|
58 |
+
|
59 |
+
# Download button
|
60 |
+
st.download_button(
|
61 |
+
label="📥 Download Workshop Package",
|
62 |
+
data=st.session_state.zip_buffer.getvalue(),
|
63 |
+
file_name=f"{workshop_topic.replace(' ', '_')}_workshop.zip",
|
64 |
+
mime="application/zip"
|
65 |
+
)
|
66 |
+
|
67 |
+
# Preview sections
|
68 |
+
with st.expander("Workshop Outline"):
|
69 |
+
st.json(st.session_state.outline)
|
70 |
+
|
71 |
+
with st.expander("Content Script"):
|
72 |
+
st.write(st.session_state.content)
|
73 |
+
|
74 |
+
with st.expander("Slide Deck Preview"):
|
75 |
+
st.markdown(st.session_state.slides)
|
76 |
+
|
77 |
+
if st.session_state.code_labs:
|
78 |
+
with st.expander("Code Labs"):
|
79 |
+
st.code(st.session_state.code_labs)
|
80 |
+
|
81 |
+
# Sales CTA
|
82 |
+
st.divider()
|
83 |
+
st.subheader("Ready to deliver this workshop?")
|
84 |
+
st.write("**$10K per corporate engagement | $1K refundable pilot deposit**")
|
85 |
+
st.link_button("🚀 Book Pilot Workshop", "https://calendly.com/your-link")
|
package.json
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
|
2 |
-
"name": "ai-workshop-generator",
|
3 |
-
"version": "1.0.0",
|
4 |
-
"private": true,
|
5 |
-
"dependencies": {
|
6 |
-
"lucide-react": "^0.395.0",
|
7 |
-
"react": "^18.3.1",
|
8 |
-
"react-dom": "^18.3.1"
|
9 |
-
},
|
10 |
-
"scripts": {
|
11 |
-
"start": "react-scripts start",
|
12 |
-
"build": "react-scripts build",
|
13 |
-
"test": "react-scripts test",
|
14 |
-
"eject": "react-scripts eject"
|
15 |
-
},
|
16 |
-
"eslintConfig": {
|
17 |
-
"extends": [
|
18 |
-
"react-app",
|
19 |
-
"react-app/jest"
|
20 |
-
]
|
21 |
-
},
|
22 |
-
"browserslist": {
|
23 |
-
"production": [
|
24 |
-
">0.2%",
|
25 |
-
"not dead",
|
26 |
-
"not op_mini all"
|
27 |
-
],
|
28 |
-
"development": [
|
29 |
-
"last 1 chrome version",
|
30 |
-
"last 1 firefox version",
|
31 |
-
"last 1 safari version"
|
32 |
-
]
|
33 |
-
},
|
34 |
-
"devDependencies": {
|
35 |
-
"autoprefixer": "^10.4.19",
|
36 |
-
"postcss": "^8.4.38",
|
37 |
-
"react-scripts": "5.0.1",
|
38 |
-
"tailwindcss": "^3.4.4"
|
39 |
-
}
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|