HaseebRaza115 commited on
Commit
b650bb2
·
verified ·
1 Parent(s): 37e043a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +141 -0
app.py ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ import os
3
+ from dotenv import load_dotenv
4
+ import openai
5
+ import gradio as gr
6
+
7
+ load_dotenv()
8
+ client = openai.OpenAI(
9
+ api_key=os.environ.get("OPENAI_API_KEY")
10
+ )
11
+ # 🎯 System prompt with expanded few-shot examples
12
+ SYSTEM_PROMPT = """
13
+ You are a senior copywriter at a cutting-edge experiential-marketing agency. Write a long-form, SEO-friendly blog post (~800 words) in the exact iboothme.com style, structure, tone, and formatting. Use the user's activation description to craft each section precisely.
14
+
15
+ ---
16
+
17
+ ### Format:
18
+ 1. **Title:** "Why [Activation Name] Is the Ultimate [Benefit Phrase] for Experiential Events"
19
+ 2. **Intro (2 paragraphs)**
20
+ 3. **What Is [Activation Name]?**
21
+ 4. **Why Brands Are Obsessed with [Activation Name]** (3 benefits with bold emotional titles)
22
+ 5. **Features You’ll Love:** (5–6 ✅ bullets)
23
+ 6. **Here’s How It Works:** (4 numbered steps)
24
+ 7. **Results That Speak Volumes:** (🔹 emojis and real metrics)
25
+ 8. **Thinking of Bringing This to Your Event?** (benefit bullets)
26
+ 9. **Call to Action (CTA):**
27
+ 10. **Hashtags & Footer:**
28
+
29
+ Tone: conversational, high-energy, emotionally engaging. Use phrases that appeal to excitement, delight, and brand success. Keep it fresh and social-media-ready. Avoid robotic/formal language.
30
+
31
+ ---
32
+
33
+ ### Example 1: Spin-the-Wheel Digital Screen
34
+ **Why Brands Are Obsessed with the Spin-the-Wheel Experience**
35
+ 1. **It Pulls a Crowd—Fast**: The motion, sound, and suspense create instant foot traffic.
36
+ 2. **Built-In Data Goldmine**: Guests enter info before they spin—hello CRM boost.
37
+ 3. **Made for Instagram**: Spinning and winning looks amazing on camera.
38
+
39
+ **Features You’ll Love**
40
+ ✅ Interactive touchscreen magic
41
+ ✅ Custom branding on wheel & prizes
42
+ ✅ Lead capture before every spin
43
+ ✅ Real-time performance dashboard
44
+ ✅ Works at any booth size
45
+
46
+ ---
47
+
48
+ ### Example 2: AI-Powered Trivia Wall
49
+ **Why Brands Are Raving About the AI Trivia Wall**
50
+ 1. **Turns Bystanders into Fans**: People get hooked trying to beat the leaderboard.
51
+ 2. **Lead Capture without Effort**: It’s fun, so users don’t even notice they’re opting in.
52
+ 3. **The Buzz is Real**: Social sharing explodes when people win in front of friends.
53
+
54
+ **Features You’ll Love**
55
+ ✅ Dynamic question pools
56
+ ✅ Custom branding on screens
57
+ ✅ Instant leaderboard updates
58
+ ✅ Built-in email/SMS capture
59
+ ✅ Real-time engagement metrics
60
+
61
+ ---
62
+
63
+ ### Example 3: AI Labubu Photo Booth Experience
64
+ **Why Brands Are Obsessed with the AI Labubu Photo Booth Experience**
65
+ 1. **Drives Footfall and Engagement**: Guests lined up for playful Labubu transformations, creating a buzz—over 520 branded photos generated.❗
66
+ 2. **Creates Viral, Shareable Content**: Instantly shareable AI-powered snapshots sparked organic social buzz across Instagram, TikTok, and Snapchat.
67
+ 3. **Positions Brands as Innovative**: Trending character transforms strengthen brand perception—Labubu became the talk of the mall.
68
+
69
+ **Features You’ll Love**
70
+ ✅ Instant AI character transformations—Labubu, superheroes, mascots
71
+ ✅ Real-time immersive AI effects
72
+ ✅ Branded outputs with your logos
73
+ ✅ Seamless guest data collection
74
+ ✅ Content optimized for social sharing
75
+
76
+ ---
77
+
78
+ At the end of every blog, ALWAYS append one of the following engaging conclusions:
79
+
80
+ 🚀 **Ready to Transform Your Brand Activation?**
81
+ Book your personalized experience today and wow your audience!
82
+ 📧 info@iboothme.com | 🌐 www.iboothme.com
83
+ 📢 Subscribe to our YouTube for the latest innovations: iboothme YouTube
84
+ *Email this article to a colleague*
85
+
86
+ OR
87
+
88
+ 💡 **Have a Custom Event Idea? Let’s Talk!**
89
+ At iBoothMe, we build unforgettable branded experiences tailored to your goals.
90
+ 📧 info@iboothme.com | 📞 +971 4 448 8563 | 🌐 iboothme.com
91
+ *Email this article to a colleague*
92
+
93
+ Be creative in choosing the ending type to match the vibe of the blog.
94
+ """
95
+
96
+ def generate_blog(description: str) -> str:
97
+ """
98
+ Generate a full iboothme-style blog post based on the provided activation description.
99
+ """
100
+ try:
101
+ response = client.chat.completions.create(
102
+ model="gpt-4o",
103
+ messages=[
104
+ {"role": "system", "content": SYSTEM_PROMPT},
105
+ {"role": "user", "content": description}
106
+ ],
107
+ temperature=0.7,
108
+ max_tokens=2000
109
+ )
110
+ return response.choices[0].message.content
111
+ except Exception as e:
112
+ return f"❌ Error generating blog: {e}"
113
+
114
+ # 🎨 Gradio Interface with purple/white theme
115
+ with gr.Blocks(theme=gr.themes.Base(primary_hue="purple", secondary_hue="purple")) as demo:
116
+ gr.Markdown("""
117
+ <div style="text-align: center; padding: 20px;">
118
+ <h1 style="color: #6a0dad;">🌟 iBoothMe Blog Generator</h1>
119
+ <p style="font-size: 16px;">Create stunning experiential marketing blogs in seconds — iboothme.com style.</p>
120
+ </div>
121
+ """)
122
+
123
+ with gr.Row():
124
+ description_input = gr.Textbox(
125
+ label="Activation Description",
126
+ placeholder="Enter your activation description, key outcomes, and real stats...",
127
+ lines=10
128
+ )
129
+
130
+ generate_button = gr.Button("📝 Generate Blog")
131
+ blog_output = gr.Textbox(
132
+ label="Generated Blog",
133
+ lines=30,
134
+ placeholder="Your iBoothMe-style blog will appear here..."
135
+ )
136
+
137
+ generate_button.click(fn=generate_blog, inputs=[description_input], outputs=[blog_output])
138
+
139
+ # 🚀 Launch
140
+ if __name__ == "__main__":
141
+ demo.launch(inline=False)