nniehaus commited on
Commit
e91311e
·
verified ·
1 Parent(s): a4ce1f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -29
app.py CHANGED
@@ -91,15 +91,20 @@ Advanced Strategy: {framework_strategy}
91
 
92
  Your Mission: Create 10 subject lines that would make someone instantly stop scrolling and click. Each should feel fresh, compelling, and impossible to ignore.
93
 
94
- Critical Requirements:
95
- 1. Maximum 33 characters (mobile-first optimization)
96
- 2. 2-4 words for maximum impact
97
- 3. Apply {psychology_framework} psychology masterfully, not obviously
98
- 4. Include power words that trigger emotional response
99
- 5. Use numbers strategically (proven to increase opens by 45%)
100
- 6. Add 1 relevant emoji only if it genuinely enhances appeal
101
- 7. Make each line feel unique and scroll-stopping
102
- 8. Avoid clichés, generic phrases, or obvious sales language
 
 
 
 
 
103
 
104
  Examples of compelling techniques:
105
  - Specific numbers: "2-min trick", "73% faster", "$847 saved"
@@ -108,23 +113,22 @@ Examples of compelling techniques:
108
  - Personal urgency: "Your deadline", "Behind schedule?", "Missing this?"
109
 
110
  CRITICAL: Output format must be exactly:
111
-
112
- **1.** [subject line]
113
  [preheader text]
114
 
115
- **2.** [subject line]
116
  [preheader text]
117
 
118
- **3.** [subject line]
119
  [preheader text]
120
 
121
- Continue for all 10 options. Make each subject line feel like it was crafted by a master copywriter, not an AI tool."""
122
 
123
  if OPENAI_V1:
124
  response = client.chat.completions.create(
125
  model="gpt-4o",
126
  messages=[{"role": "user", "content": prompt_text}],
127
- max_tokens=800,
128
  temperature=0.7
129
  )
130
  return response.choices[0].message.content
@@ -132,7 +136,7 @@ Continue for all 10 options. Make each subject line feel like it was crafted by
132
  response = client.ChatCompletion.create(
133
  model="gpt-4o",
134
  messages=[{"role": "user", "content": prompt_text}],
135
- max_tokens=800,
136
  temperature=0.7
137
  )
138
  return response.choices[0].message.content
@@ -166,9 +170,16 @@ OPTIMIZATION BRIEF:
166
 
167
  YOUR MISSION: Transform this into 5 compelling alternatives that would dramatically outperform the original.
168
 
 
 
 
 
 
 
 
169
  Advanced Optimization Strategies:
170
  1. Apply {psychology_framework} psychology masterfully
171
- 2. Maximize mobile impact (33 characters max)
172
  3. Use power words that trigger immediate action
173
  4. Include specific numbers or percentages when relevant
174
  5. Create genuine intrigue without being misleading
@@ -179,35 +190,34 @@ Quality Standards:
179
  - Each subject line should feel like it was written by the world's best copywriter
180
  - Avoid generic, cliché, or obviously promotional language
181
  - Create genuine curiosity and emotional pull
182
- - Ensure mobile-first optimization
183
  - Focus on what makes people instantly want to click
184
 
185
  EXACT OUTPUT FORMAT:
186
-
187
  **Current:** {existing_subject} (Score: {analysis['score']}/10)
188
 
189
- **Option 1:** [compelling subject line]
190
  [irresistible preheader]
191
 
192
- **Option 2:** [compelling subject line]
193
  [irresistible preheader]
194
 
195
- **Option 3:** [compelling subject line]
196
  [irresistible preheader]
197
 
198
- **Option 4:** [compelling subject line]
199
  [irresistible preheader]
200
 
201
- **Option 5:** [compelling subject line]
202
  [irresistible preheader]
203
 
204
- Make each option significantly more compelling than the original."""
205
 
206
  if OPENAI_V1:
207
  response = client.chat.completions.create(
208
  model="gpt-4o",
209
  messages=[{"role": "user", "content": prompt_text}],
210
- max_tokens=1000,
211
  temperature=0.7
212
  )
213
  return response.choices[0].message.content
@@ -215,7 +225,7 @@ Make each option significantly more compelling than the original."""
215
  response = client.ChatCompletion.create(
216
  model="gpt-4o",
217
  messages=[{"role": "user", "content": prompt_text}],
218
- max_tokens=1000,
219
  temperature=0.7
220
  )
221
  return response.choices[0].message.content
@@ -320,8 +330,9 @@ def main():
320
  **Mobile First:** 33 chars max
321
  **Optimal:** 2-4 words
322
  **Numbers:** +45% opens
323
- **Emojis:** +39% (use 1 max)
324
- **Personalization:** +26% opens
 
325
  """)
326
 
327
  with st.expander("🧠 Psychology Guide", expanded=False):
@@ -421,6 +432,7 @@ def main():
421
  - Personalized subject lines are 26% more likely to be opened
422
  - Emojis can increase open rates by 39% when used appropriately
423
  - 2-4 word subject lines achieve the highest engagement
 
424
  """)
425
 
426
  if __name__ == "__main__":
 
91
 
92
  Your Mission: Create 10 subject lines that would make someone instantly stop scrolling and click. Each should feel fresh, compelling, and impossible to ignore.
93
 
94
+ CRITICAL EMOJI REQUIREMENT: Include emojis in at least 6 out of 10 subject lines (60%+). Emojis increase open rates by 39% when used appropriately. Place them strategically at the beginning or end for maximum impact.
95
+
96
+ LENGTH VARIATION REQUIREMENT:
97
+ - 7 subject lines: Ultra-short (2-4 words, max 33 characters) for mobile optimization
98
+ - 2 subject lines: Medium length (5-7 words, 34-50 characters) for desktop impact
99
+ - 1 subject line: Longer format (8+ words, 51-65 characters) for storytelling appeal
100
+
101
+ Quality Requirements:
102
+ 1. Apply {psychology_framework} psychology masterfully, not obviously
103
+ 2. Include power words that trigger emotional response
104
+ 3. Use numbers strategically (proven to increase opens by 45%)
105
+ 4. Make each line feel unique and scroll-stopping
106
+ 5. Avoid clichés, generic phrases, or obvious sales language
107
+ 6. Ensure emojis enhance rather than distract from the message
108
 
109
  Examples of compelling techniques:
110
  - Specific numbers: "2-min trick", "73% faster", "$847 saved"
 
113
  - Personal urgency: "Your deadline", "Behind schedule?", "Missing this?"
114
 
115
  CRITICAL: Output format must be exactly:
116
+ **1.** [subject line] (Length: Short/Medium/Long)
 
117
  [preheader text]
118
 
119
+ **2.** [subject line] (Length: Short/Medium/Long)
120
  [preheader text]
121
 
122
+ **3.** [subject line] (Length: Short/Medium/Long)
123
  [preheader text]
124
 
125
+ Continue for all 10 options. Make each subject line feel like it was crafted by a master copywriter, not an AI tool. Remember: 6+ must have emojis, vary the lengths as specified."""
126
 
127
  if OPENAI_V1:
128
  response = client.chat.completions.create(
129
  model="gpt-4o",
130
  messages=[{"role": "user", "content": prompt_text}],
131
+ max_tokens=1000,
132
  temperature=0.7
133
  )
134
  return response.choices[0].message.content
 
136
  response = client.ChatCompletion.create(
137
  model="gpt-4o",
138
  messages=[{"role": "user", "content": prompt_text}],
139
+ max_tokens=1000,
140
  temperature=0.7
141
  )
142
  return response.choices[0].message.content
 
170
 
171
  YOUR MISSION: Transform this into 5 compelling alternatives that would dramatically outperform the original.
172
 
173
+ CRITICAL EMOJI REQUIREMENT: Include emojis in at least 3 out of 5 optimized options (60%+). Emojis increase open rates by 39% when used strategically.
174
+
175
+ LENGTH VARIATION REQUIREMENT:
176
+ - 3 options: Ultra-short (2-4 words, max 33 characters) for mobile optimization
177
+ - 1 option: Medium length (5-7 words, 34-50 characters) for desktop impact
178
+ - 1 option: Longer format (8+ words, 51-65 characters) for storytelling appeal
179
+
180
  Advanced Optimization Strategies:
181
  1. Apply {psychology_framework} psychology masterfully
182
+ 2. Maximize mobile impact while offering variety
183
  3. Use power words that trigger immediate action
184
  4. Include specific numbers or percentages when relevant
185
  5. Create genuine intrigue without being misleading
 
190
  - Each subject line should feel like it was written by the world's best copywriter
191
  - Avoid generic, cliché, or obviously promotional language
192
  - Create genuine curiosity and emotional pull
193
+ - Ensure mobile-first optimization with strategic longer options
194
  - Focus on what makes people instantly want to click
195
 
196
  EXACT OUTPUT FORMAT:
 
197
  **Current:** {existing_subject} (Score: {analysis['score']}/10)
198
 
199
+ **Option 1:** [compelling subject line] (Length: Short/Medium/Long)
200
  [irresistible preheader]
201
 
202
+ **Option 2:** [compelling subject line] (Length: Short/Medium/Long)
203
  [irresistible preheader]
204
 
205
+ **Option 3:** [compelling subject line] (Length: Short/Medium/Long)
206
  [irresistible preheader]
207
 
208
+ **Option 4:** [compelling subject line] (Length: Short/Medium/Long)
209
  [irresistible preheader]
210
 
211
+ **Option 5:** [compelling subject line] (Length: Short/Medium/Long)
212
  [irresistible preheader]
213
 
214
+ Make each option significantly more compelling than the original. Remember: 3+ must have emojis, vary lengths as specified."""
215
 
216
  if OPENAI_V1:
217
  response = client.chat.completions.create(
218
  model="gpt-4o",
219
  messages=[{"role": "user", "content": prompt_text}],
220
+ max_tokens=1200,
221
  temperature=0.7
222
  )
223
  return response.choices[0].message.content
 
225
  response = client.ChatCompletion.create(
226
  model="gpt-4o",
227
  messages=[{"role": "user", "content": prompt_text}],
228
+ max_tokens=1200,
229
  temperature=0.7
230
  )
231
  return response.choices[0].message.content
 
330
  **Mobile First:** 33 chars max
331
  **Optimal:** 2-4 words
332
  **Numbers:** +45% opens
333
+ **Emojis:** +39% (use in 60%+ of options)
334
+ **Personalization:** +26% opens
335
+ **Length Variety:** Mix short & medium options
336
  """)
337
 
338
  with st.expander("🧠 Psychology Guide", expanded=False):
 
432
  - Personalized subject lines are 26% more likely to be opened
433
  - Emojis can increase open rates by 39% when used appropriately
434
  - 2-4 word subject lines achieve the highest engagement
435
+ - Length variety provides options for different audiences and contexts
436
  """)
437
 
438
  if __name__ == "__main__":