JeCabrera commited on
Commit
6ab0e7c
·
verified ·
1 Parent(s): 53e29c5

Upload 4 files

Browse files
Files changed (1) hide show
  1. formulas.py +81 -132
formulas.py CHANGED
@@ -1,6 +1,24 @@
1
- import random
 
 
2
 
3
  # Add this function at the beginning of the file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  def create_offer_instruction(avatar_description, product_name, selected_formula_name):
5
  """
6
  Creates instructions for generating an offer based on the selected formula.
@@ -16,15 +34,6 @@ def create_offer_instruction(avatar_description, product_name, selected_formula_
16
  # Get the selected formula
17
  selected_formula = offer_formulas[selected_formula_name]
18
 
19
- # Get random examples (1-3 examples)
20
- num_examples = min(3, len(selected_formula["examples"]))
21
- random_examples = random.sample(selected_formula["examples"], num_examples)
22
-
23
- # Format examples
24
- examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(random_examples)])
25
-
26
- # Add specific instructions for Sueño-Obstáculo formula
27
- # Add specific instructions for handling uploaded content
28
  # Add specific instructions for each formula
29
  additional_instructions = ""
30
  if selected_formula_name == "Fórmula Sueño-Obstáculo":
@@ -74,12 +83,6 @@ SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
74
  - "Ahora puedes acceder a un..."
75
  - "Tenemos para ti un..."
76
  - "Disfruta de un..."
77
-
78
- 8. CRITICAL: Output ONLY the offer itself with NO introductory text, explanations, or additional commentary.
79
- - DO NOT include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
80
- - DO NOT include any text before or after the offer
81
- - Start directly with one of the opening phrases from point 7
82
- - The entire response should be ONLY the offer itself
83
  """
84
 
85
  elif selected_formula_name == "Oferta Dorada":
@@ -90,37 +93,23 @@ SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
90
  - Select a powerful attention hook that DIRECTLY connects with the avatar's current reality
91
  - DO NOT use questions as hooks - use statements, statistics, or shocking revelations instead
92
  - CUSTOMIZE the hook specifically for this avatar - don't use generic examples
93
- - CRITICAL: Ensure the hook is DIRECTLY RELATED to the promise and benefit that follow
94
  - The hook MUST address the SAME problem that your promise will solve
95
 
96
- Choose randomly from these hooks (avoiding questions) and CUSTOMIZE for your avatar:
97
- - "El 83% de los emprendedores pierden dinero en anuncios que nadie convierte."
98
- - "9 de cada 10 negocios online fracasan en sus primeros 6 meses por este error."
99
- - "Lo que nadie te dice sobre el marketing digital es que la mayoría fracasa en los primeros 3 meses."
100
- - "El secreto que las agencias de marketing no quieren que sepas sobre tu tráfico web."
101
- - "Ah, otro día más tirando dinero en anuncios que no convierten... ¡Qué divertido!"
102
- - "Felicidades, acabas de unirte al club de 'Invertí miles en mi web y nadie la visita'."
103
- - "Tu lista de email está tan muerta que hasta los mensajes de spam tienen más aperturas."
104
- - "Tu página de ventas convierte tan poco que hasta tu mamá cerró la pestaña sin comprar."
105
- - "Mientras algunos facturan $10,000 al mes, tú sigues preguntándote por qué nadie compra."
106
- - "Tus competidores están cerrando ventas mientras tú sigues 'perfeccionando' tu oferta."
107
- - "La mayoría de cursos de marketing digital son una pérdida total de tiempo y dinero."
108
- - "Tu estrategia actual de contenido está ahuyentando a tus clientes ideales."
109
- - "Hace 6 meses estaba exactamente donde tú estás: creando contenido que nadie veía."
110
- - "Recuerdo cuando mi negocio estaba al borde del colapso por no tener un sistema de ventas."
111
 
112
  2. MAINTAIN THEMATIC CONSISTENCY:
113
  - The attention hook, quantifiable promise, and benefit statement MUST all address the SAME problem
114
- - If the hook mentions language learning struggles, the promise and benefit must also focus on language learning
115
- - If the hook addresses marketing challenges, the promise and benefit must provide marketing solutions
116
  - Create a LOGICAL PROGRESSION from problem (hook) to solution (promise) to implementation (benefit)
117
 
118
- 3. Analyze ALL available information:
119
- - Target audience description (avatar_description) - THIS IS YOUR PRIMARY SOURCE OF TRUTH
120
- - Product/service name (product_name variable)
121
- - Content from uploaded files (if any)
122
-
123
- 4. Create a compelling QUANTIFIABLE PROMISE that:
124
  - Is written COMPLETELY IN CAPITAL LETTERS
125
  - Includes concrete numbers (money, time, results)
126
  - Uses powerful action verbs (EARN, MULTIPLY, ACHIEVE, MASTER)
@@ -129,37 +118,21 @@ SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
129
  - NEVER uses exclamation marks (!)
130
  - DIRECTLY addresses the same problem mentioned in the hook
131
 
132
- 5. Craft a benefit statement that:
133
  - Clearly explains the result they will obtain
134
  - Includes an authority element (proven method, studies, experience)
135
  - Establishes a realistic timeframe or effort needed
136
  - CONTINUES the same theme established in the hook and promise
137
-
138
- 6. CRITICAL: Output ONLY the offer itself with NO introductory text, explanations, or additional commentary.
139
- - DO NOT include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
140
- - DO NOT include any text before or after the offer
141
- - Start directly with the attention hook
142
- - The entire response should be ONLY the offer itself following the formula structure
143
  """
144
 
145
- # Create the instruction
146
- instruction = f"""
147
- You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience.
148
-
149
- OBJECTIVE:
150
- - Generate a convincing offer in Spanish using the {selected_formula_name}
151
- - Connect emotionally with the audience: {avatar_description}
152
- - Address real desires, problems, and motivations
153
- - Maintain natural and conversational language
154
 
155
  FORMULA TO USE:
156
  {selected_formula["description"]}
157
 
158
  {additional_instructions}
159
 
160
- EXAMPLES (Use these as inspiration but create something unique):
161
- {examples_text}
162
-
163
  PRODUCT/SERVICE:
164
  {product_name}
165
 
@@ -169,6 +142,11 @@ TARGET AUDIENCE:
169
  Create a compelling offer following the formula structure exactly.
170
  """
171
 
 
 
 
 
 
172
  return instruction
173
 
174
  # The rest of your offer_formulas dictionary remains unchanged
@@ -189,27 +167,6 @@ Analyze first:
189
  - What are they trying to achieve without success?
190
  - What limiting beliefs do they have?
191
 
192
- Then, randomly choose one of the following formats and CUSTOMIZE it for the specific avatar:
193
-
194
- **Correct examples:**
195
- "El 83% de los emprendedores pierden dinero en anuncios que nadie convierte."
196
- "9 de cada 10 negocios online fracasan en sus primeros 6 meses por este error."
197
- "Lo que nadie te dice sobre el marketing digital es que la mayoría fracasa en los primeros 3 meses."
198
- "El secreto que las agencias de marketing no quieren que sepas sobre tu tráfico web."
199
- "Ah, otro día más tirando dinero en anuncios que no convierten... ¡Qué divertido!"
200
- "Felicidades, acabas de unirte al club de 'Invertí miles en mi web y nadie la visita'."
201
- "¿Has pasado horas escribiendo emails y nadie los abre?"
202
- "Tu lista de email está tan muerta que hasta los mensajes de spam tienen más aperturas."
203
- "Tu página de ventas convierte tan poco que hasta tu mamá cerró la pestaña sin comprar."
204
- "Mientras algunos facturan $10,000 al mes, tú sigues preguntándote por qué nadie compra."
205
- "Tus competidores están cerrando ventas mientras tú sigues 'perfeccionando' tu oferta."
206
- "La mayoría de cursos de marketing digital son una pérdida total de tiempo y dinero."
207
- "Tu estrategia actual de contenido está ahuyentando a tus clientes ideales."
208
- "Hace 6 meses estaba exactamente donde tú estás: creando contenido que nadie veía."
209
- "Recuerdo cuando mi negocio estaba al borde del colapso por no tener un sistema de ventas."
210
-
211
- The important thing is that it connects directly with the avatar's current reality and frustration, USING A VARIETY OF FORMATS AND CUSTOMIZING TO THE SPECIFIC AVATAR.
212
-
213
  ---
214
 
215
  #### 2 **QUANTIFIABLE PROMISE IN ALL CAPS**
@@ -233,13 +190,22 @@ This is the most important part. You must create a specific, quantifiable promis
233
  #### 3 **Benefit + Authority + Time or Effort**
234
  In this part, we explain the result they will obtain, supported by an authority factor (proven method, studies, experience, validations) and establishing a time frame or necessary effort to achieve it.
235
 
 
 
 
 
 
 
 
236
  **Incorrect example:**
237
  "Grow your business with our strategy." (Doesn't say how long it will take or how reliable the strategy is).
238
 
239
- **Correct example:**
240
- "Generate responses and sales with our strategy used by more than 500 entrepreneurs, with just 15 minutes a day."
241
-
242
- This format clearly states the benefit, backs up the solution with authority, and establishes a realistic effort to achieve it.
 
 
243
 
244
  ---
245
 
@@ -248,42 +214,43 @@ This format clearly states the benefit, backs up the solution with authority, an
248
 
249
  [QUANTIFIABLE PROMISE IN ALL CAPS]
250
 
251
- [Benefit] with [Authority element] in [Time or effort]"
252
-
253
- ---
254
-
255
- ### **Examples of the applied formula:**
256
  """,
257
  "examples": [
 
258
  """El 83% de los emprendedores pierden dinero en anuncios que nadie convierte.
259
-
260
- CONVIERTE EL 30% DE TUS VISITANTES EN COMPRADORES Y REDUCE TU COSTO DE ADQUISICIÓN A LA MITAD EN SOLO 14 DÍAS.
261
-
262
- Convierte más visitas en ventas con una estructura de copy validada en solo 5 días.""",
263
-
 
264
  """Tu lista de email está tan muerta que hasta los mensajes de spam tienen más aperturas.
265
-
266
- AUMENTA TU TASA DE APERTURA AL 35% Y GENERA $2.500 EN VENTAS CON CADA CAMPAÑA DE EMAIL QUE ENVIES.
267
-
268
- Haz que tus correos se lean con una estrategia usada por expertos en solo 30 minutos por campaña.""",
269
-
 
270
  """Mientras algunos facturan $10,000 al mes, tú sigues preguntándote por qué nadie compra.
271
-
272
- FACTURA EL DOBLE SIN BAJAR TUS PRECIOS Y CONVIERTE EL 80% DE TUS PROPUESTAS EN CLIENTES PAGANDO.
273
-
274
- Cierra más ventas con un método probado por 300 freelancers sin necesidad de descuentos en solo 7 días.""",
275
-
 
276
  """Lo que nadie te dice sobre el marketing de contenidos es que el 95% nunca genera un solo cliente.
277
-
278
- MULTIPLICA POR 5 TUS COMENTARIOS Y CONSIGUE 3 CLIENTES NUEVOS CADA SEMANA CON SOLO 20 MINUTOS DE TRABAJO DIARIO.
279
-
280
- Consigue comentarios y clientes con una estrategia de contenido validada en solo 10 minutos al día.""",
281
-
 
282
  """Ah, otro día más publicando en redes sociales y hablándole a las paredes... Qué divertido.
283
-
284
- CONSIGUE 100 NUEVOS SEGUIDORES CUALIFICADOS POR SEMANA Y CONVIERTE EL 10% EN LEADS INTERESADOS EN TUS SERVICIOS.
285
-
286
- Crea contenido irresistible con una estrategia validada en solo 15 minutos al día."""
287
  ]
288
  },
289
  "Fórmula Sueño-Obstáculo": {
@@ -330,24 +297,6 @@ This formula connects directly with the client's desires and concerns:
330
  **Structure Format (Classic example):**
331
  "Se trata de un (training, product or service) llamado ("name of your solution") que te va a permitir (big dream) aún y cuando (big obstacle)"
332
  """,
333
- "examples": [
334
- "Presentamos un programa llamado \"Desbloqueo Creativo Total\" que te va a permitir generar ideas brillantes a demanda aún y cuando tu cerebro esté más seco que el desierto de Atacama.",
335
-
336
- "Te ofrecemos un curso online llamado \"Máquina de Ventas Imparable\" que te va a permitir vender hasta a tu peor enemigo aún y cuando antes no podrías vender agua en el infierno.",
337
-
338
- "Imagina tener acceso a un sistema llamado \"Productividad Sobrehumana\" que te va a permitir hacer en 2 horas lo que otros hacen en 2 días aún y cuando ahora mismo tu relación con la procrastinación sea más estable que tu último noviazgo.",
339
-
340
- "Por fin existe una mentoría llamada \"Libertad Financiera Express\" que te va a permitir generar ingresos pasivos mientras duermes aún y cuando ahora mismo tu cuenta bancaria esté tan vacía que haga eco.",
341
-
342
- "Hemos creado un método llamado \"Conquista Digital\" que te va a permitir posicionar tu marca en el top 1% de tu industria aún y cuando ahora mismo seas más invisible que un ninja en la oscuridad.",
343
-
344
- "Conoce el taller llamado \"Oratoria Magnética\" que te va a permitir cautivar a cualquier audiencia aún y cuando ahora mismo hablar en público te cause más terror que una película de Stephen King.",
345
-
346
- "Disfruta de una comunidad llamada \"Conexiones Estratégicas VIP\" que te va a permitir rodearte de personas que catapulten tu negocio aún y cuando tu red de contactos actual sea más pequeña que la lista de personas que han visitado Marte.",
347
-
348
- "Ahora puedes acceder a un webinar llamado \"Dominio del Tiempo\" que te va a permitir recuperar 10 horas productivas a la semana aún y cuando ahora mismo tu agenda esté más saturada que el metro en hora punta.",
349
-
350
- "Tenemos para ti una consultoría llamada \"Transformación de Marca 360°\" que te va a permitir destacar en un océano de competidores aún y cuando ahora mismo tu negocio pase más desapercibido que un camaleón en la selva."
351
- ]
352
  }
353
  }
 
1
+ # The function create_offer_instruction remains unchanged
2
+ # Remove the random import since we no longer need it
3
+ # import random
4
 
5
  # Add this function at the beginning of the file
6
+ # Define a single system prompt at the top of the file
7
+ offer_system_prompt = """You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience.
8
+
9
+ OBJECTIVE:
10
+ - Generate a convincing offer in Spanish
11
+ - Connect emotionally with the audience
12
+ - Address real desires, problems, and motivations
13
+ - Maintain natural and conversational language
14
+
15
+ CRITICAL OUTPUT RULES:
16
+ - Output ONLY the offer itself with NO introductory text, explanations, or additional commentary
17
+ - Start directly with the attention hook or opening phrase
18
+ - The entire response should be ONLY the offer itself following the formula structure
19
+ - Do not include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
20
+ """
21
+
22
  def create_offer_instruction(avatar_description, product_name, selected_formula_name):
23
  """
24
  Creates instructions for generating an offer based on the selected formula.
 
34
  # Get the selected formula
35
  selected_formula = offer_formulas[selected_formula_name]
36
 
 
 
 
 
 
 
 
 
 
37
  # Add specific instructions for each formula
38
  additional_instructions = ""
39
  if selected_formula_name == "Fórmula Sueño-Obstáculo":
 
83
  - "Ahora puedes acceder a un..."
84
  - "Tenemos para ti un..."
85
  - "Disfruta de un..."
 
 
 
 
 
 
86
  """
87
 
88
  elif selected_formula_name == "Oferta Dorada":
 
93
  - Select a powerful attention hook that DIRECTLY connects with the avatar's current reality
94
  - DO NOT use questions as hooks - use statements, statistics, or shocking revelations instead
95
  - CUSTOMIZE the hook specifically for this avatar - don't use generic examples
 
96
  - The hook MUST address the SAME problem that your promise will solve
97
 
98
+ Choose randomly from these statement hooks and CUSTOMIZE for your avatar:
99
+ - "El 83% de los [avatar's profession/role] pierden [specific resource] en [specific activity] que nadie aprovecha."
100
+ - "9 de cada 10 [avatar's field] fracasan en sus primeros 6 meses por este error."
101
+ - "Lo que nadie te dice sobre [avatar's challenge] es que la mayoría fracasa en los primeros 3 meses."
102
+ - "El secreto que [competitors/industry] no quieren que sepas sobre [avatar's goal]."
103
+ - "Tu [avatar's current strategy/approach] está ahuyentando a tus [avatar's desired outcome]."
104
+ - "Mientras algunos [positive outcome], sigues [negative current situation]."
105
+ - "La mayoría de [current solutions] son una pérdida total de [resources]."
106
+ - "Hace 6 meses estaba exactamente donde estás: [avatar's current struggle]."
 
 
 
 
 
 
107
 
108
  2. MAINTAIN THEMATIC CONSISTENCY:
109
  - The attention hook, quantifiable promise, and benefit statement MUST all address the SAME problem
 
 
110
  - Create a LOGICAL PROGRESSION from problem (hook) to solution (promise) to implementation (benefit)
111
 
112
+ 3. Create a compelling QUANTIFIABLE PROMISE that:
 
 
 
 
 
113
  - Is written COMPLETELY IN CAPITAL LETTERS
114
  - Includes concrete numbers (money, time, results)
115
  - Uses powerful action verbs (EARN, MULTIPLY, ACHIEVE, MASTER)
 
118
  - NEVER uses exclamation marks (!)
119
  - DIRECTLY addresses the same problem mentioned in the hook
120
 
121
+ 4. Craft a benefit statement that:
122
  - Clearly explains the result they will obtain
123
  - Includes an authority element (proven method, studies, experience)
124
  - Establishes a realistic timeframe or effort needed
125
  - CONTINUES the same theme established in the hook and promise
 
 
 
 
 
 
126
  """
127
 
128
+ # Create the instruction using the system prompt at the beginning
129
+ instruction = f"""{offer_system_prompt}
 
 
 
 
 
 
 
130
 
131
  FORMULA TO USE:
132
  {selected_formula["description"]}
133
 
134
  {additional_instructions}
135
 
 
 
 
136
  PRODUCT/SERVICE:
137
  {product_name}
138
 
 
142
  Create a compelling offer following the formula structure exactly.
143
  """
144
 
145
+ # Add examples if available
146
+ if selected_formula.get("examples") and len(selected_formula["examples"]) > 0:
147
+ examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"][:3])])
148
+ instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
149
+
150
  return instruction
151
 
152
  # The rest of your offer_formulas dictionary remains unchanged
 
167
  - What are they trying to achieve without success?
168
  - What limiting beliefs do they have?
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  ---
171
 
172
  #### 2 **QUANTIFIABLE PROMISE IN ALL CAPS**
 
190
  #### 3 **Benefit + Authority + Time or Effort**
191
  In this part, we explain the result they will obtain, supported by an authority factor (proven method, studies, experience, validations) and establishing a time frame or necessary effort to achieve it.
192
 
193
+ **Structure Formats:**
194
+ 1. "[Feature] para que puedas [Benefit] con lo que [Meaning]"
195
+ 2. "Con [Feature] podrás [Benefit] permitiéndote [Meaning]"
196
+ 3. "Gracias a [Feature] lograrás [Benefit] haciendo que [Meaning]"
197
+ 4. "Mediante [Feature] conseguirás [Benefit] lo que significa [Meaning]"
198
+ 5. "Usando [Feature] alcanzarás [Benefit] transformando [Meaning]"
199
+
200
  **Incorrect example:**
201
  "Grow your business with our strategy." (Doesn't say how long it will take or how reliable the strategy is).
202
 
203
+ **Correct examples:**
204
+ "El Sistema de emails persuasivos para que puedas convertir lectores en clientes con lo que multiplicarás tus ventas en solo 30 días."
205
+ "Con nuestra metodología de copywriting podrás crear ofertas irresistibles permitiéndote aumentar tu tasa de conversión en un 200% con solo 15 minutos al día."
206
+ "Gracias a nuestro framework de contenido lograrás posicionarte como autoridad haciendo que tu audiencia te busque a ti en lugar de a tu competencia."
207
+ "Mediante nuestro sistema de automatización conseguirás generar ventas mientras duermes lo que significa libertad financiera real en menos de 90 días."
208
+ "Usando nuestra estrategia de redes sociales alcanzarás 10.000 seguidores cualificados transformando tu presencia digital en una máquina de generación de leads."
209
 
210
  ---
211
 
 
214
 
215
  [QUANTIFIABLE PROMISE IN ALL CAPS]
216
 
217
+ [Choose one of the 5 structure formats for Benefit + Authority + Time or Effort]"
 
 
 
 
218
  """,
219
  "examples": [
220
+ # Example 1
221
  """El 83% de los emprendedores pierden dinero en anuncios que nadie convierte.
222
+
223
+ CONVIERTE EL 30% DE TUS VISITANTES EN COMPRADORES Y REDUCE TU COSTO DE ADQUISICIÓN A LA MITAD EN SOLO 14 DÍAS.
224
+
225
+ El Sistema de copywriting persuasivo para que puedas transformar visitantes en clientes con lo que multiplicarás tu ROI en menos de dos semanas.""",
226
+
227
+ # Example 2
228
  """Tu lista de email está tan muerta que hasta los mensajes de spam tienen más aperturas.
229
+
230
+ AUMENTA TU TASA DE APERTURA AL 35% Y GENERA $2.500 EN VENTAS CON CADA CAMPAÑA DE EMAIL QUE ENVIES.
231
+
232
+ Con nuestra metodología de asuntos irresistibles podrás captar la atención inmediata permitiéndote convertir suscriptores dormidos en compradores activos en solo 30 minutos por campaña.""",
233
+
234
+ # Example 3
235
  """Mientras algunos facturan $10,000 al mes, tú sigues preguntándote por qué nadie compra.
236
+
237
+ FACTURA EL DOBLE SIN BAJAR TUS PRECIOS Y CONVIERTE EL 80% DE TUS PROPUESTAS EN CLIENTES PAGANDO.
238
+
239
+ Gracias a nuestro framework de propuestas de alto valor lograrás posicionarte como la opción premium haciendo que los clientes te elijan a ti sin cuestionar tus tarifas.""",
240
+
241
+ # Example 4
242
  """Lo que nadie te dice sobre el marketing de contenidos es que el 95% nunca genera un solo cliente.
243
+
244
+ MULTIPLICA POR 5 TUS COMENTARIOS Y CONSIGUE 3 CLIENTES NUEVOS CADA SEMANA CON SOLO 20 MINUTOS DE TRABAJO DIARIO.
245
+
246
+ Mediante nuestro sistema de contenido estratégico conseguirás crear publicaciones que convierten lo que significa un flujo constante de leads cualificados sin invertir en publicidad.""",
247
+
248
+ # Example 5
249
  """Ah, otro día más publicando en redes sociales y hablándole a las paredes... Qué divertido.
250
+
251
+ CONSIGUE 100 NUEVOS SEGUIDORES CUALIFICADOS POR SEMANA Y CONVIERTE EL 10% EN LEADS INTERESADOS EN TUS SERVICIOS.
252
+
253
+ Usando nuestra estrategia de contenido viral alcanzarás visibilidad exponencial transformando tu presencia en redes en un canal de captación automático en menos de 30 días."""
254
  ]
255
  },
256
  "Fórmula Sueño-Obstáculo": {
 
297
  **Structure Format (Classic example):**
298
  "Se trata de un (training, product or service) llamado ("name of your solution") que te va a permitir (big dream) aún y cuando (big obstacle)"
299
  """,
300
+ "examples": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
302
  }