JeCabrera commited on
Commit
09a8159
verified
1 Parent(s): f18e78c

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +57 -0
prompts.py CHANGED
@@ -22,6 +22,9 @@ from ads_formulas import ads_formulas
22
  # Add this import at the top of the file
23
  from fb_policies import fb_policies, get_policy_checklist
24
 
 
 
 
25
  def create_fb_ad_instruction(target_audience, product, selected_formula, selected_angle, selected_persona, ad_objective=None, language="espa帽ol", story_prompt=""):
26
  """
27
  Creates an instruction for generating Facebook ad copy
@@ -189,6 +192,60 @@ def create_fb_ad_instruction(target_audience, product, selected_formula, selecte
189
 
190
  {persona_instruction}
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  Ad Requirements for EACH of the three ads:
193
  1. **Multiple Headline Options:** For EACH ad, create THREE distinct, powerful headline options that directly incorporate the story theme "{story_prompt if story_prompt else 'main benefit'}". Each headline should:
194
  - Be bold, unexpected, and memorable
 
22
  # Add this import at the top of the file
23
  from fb_policies import fb_policies, get_policy_checklist
24
 
25
+ # A帽adir esta importaci贸n al principio del archivo
26
+ from headline_generator import generate_random_headlines
27
+
28
  def create_fb_ad_instruction(target_audience, product, selected_formula, selected_angle, selected_persona, ad_objective=None, language="espa帽ol", story_prompt=""):
29
  """
30
  Creates an instruction for generating Facebook ad copy
 
192
 
193
  {persona_instruction}
194
 
195
+ # Generar titulares aleatorios con diferentes estructuras
196
+ random_headlines = generate_random_headlines(
197
+ target_audience=target_audience,
198
+ product=product,
199
+ angle=selected_angle,
200
+ story_prompt=story_prompt,
201
+ language=language
202
+ )
203
+
204
+ # Dividir los titulares en grupos de 3 para cada anuncio
205
+ ad1_headlines = random_headlines[0:3]
206
+ ad2_headlines = random_headlines[3:6]
207
+ ad3_headlines = random_headlines[6:9]
208
+
209
+ # Crear instrucci贸n espec铆fica para los titulares pre-generados
210
+ headline_instruction = f"""
211
+ **Pre-Generated Headlines:**
212
+ Para asegurar variedad en los tipos de titulares, considera estas opciones pre-generadas para cada anuncio:
213
+
214
+ Para el Anuncio #1:
215
+ 1. {ad1_headlines[0]}
216
+ 2. {ad1_headlines[1]}
217
+ 3. {ad1_headlines[2]}
218
+
219
+ Para el Anuncio #2:
220
+ 1. {ad2_headlines[0]}
221
+ 2. {ad2_headlines[1]}
222
+ 3. {ad2_headlines[2]}
223
+
224
+ Para el Anuncio #3:
225
+ 1. {ad3_headlines[0]}
226
+ 2. {ad3_headlines[1]}
227
+ 3. {ad3_headlines[2]}
228
+
229
+ IMPORTANTE: Estos titulares representan diferentes estructuras (preguntas, declaraciones, historias, advertencias, etc.).
230
+ Puedes usar estos titulares directamente, modificarlos para que se alineen mejor con la narrativa del anuncio,
231
+ o crear nuevos titulares inspirados en estos, pero ASEG脷RATE de mantener VARIEDAD en los tipos de estructura
232
+ entre los tres anuncios finales.
233
+ """
234
+
235
+ # Modificar la instrucci贸n principal para incluir los titulares pre-generados
236
+ instruction = f"""
237
+ {system_prompt}
238
+
239
+ Create three completely different high-converting Facebook ad copies for {product}, channeling the voice of {selected_persona['description']} while leveraging the selected angle to persuade {target_audience} to try it and share their positive experience.
240
+
241
+ {objective_instruction if ad_objective else ""}
242
+
243
+ {story_instruction if story_prompt else ""}
244
+
245
+ {persona_instruction}
246
+
247
+ {headline_instruction}
248
+
249
  Ad Requirements for EACH of the three ads:
250
  1. **Multiple Headline Options:** For EACH ad, create THREE distinct, powerful headline options that directly incorporate the story theme "{story_prompt if story_prompt else 'main benefit'}". Each headline should:
251
  - Be bold, unexpected, and memorable