Spaces:
Sleeping
Sleeping
# The function create_offer_instruction remains unchanged | |
# Remove the random import since we no longer need it | |
# import random | |
# Import the system prompt from prompts.py | |
from prompts import offer_system_prompt | |
def create_offer_instruction(avatar_description, product_name, selected_formula_name): | |
""" | |
Creates instructions for generating an offer based on the selected formula. | |
Args: | |
avatar_description: Description of the target audience | |
product_name: Name of the product or service | |
selected_formula_name: Name of the formula to use ("Fórmula Sueño-Obstáculo" or "Oferta Dorada") | |
Returns: | |
str: Complete instruction for generating the offer | |
""" | |
# Get the selected formula | |
selected_formula = offer_formulas[selected_formula_name] | |
# Add specific instructions for each formula | |
additional_instructions = "" | |
if selected_formula_name == "Fórmula Sueño-Obstáculo": | |
additional_instructions = """ | |
SPECIFIC INSTRUCTIONS FOR THIS FORMULA: | |
1. PRODUCT/SERVICE NAME HANDLING: | |
- If product_name is provided and not empty, use it EXACTLY as written | |
- If product_name is empty, generic (like "Producto/Servicio"), or contains placeholders, CREATE a compelling name that: | |
* Reflects the target audience's desires and challenges | |
* Communicates the main benefit or transformation | |
* Sounds professional and memorable | |
* Is specific to the niche or industry mentioned in avatar_description | |
- If product_name contains a full phrase like "Un curso llamado Inglés sin problemas", extract only the real name ("Inglés sin problemas") | |
2. Analyze ALL available information: | |
- Product/service name (product_name variable) or create one if needed | |
- Target audience description (avatar_description) | |
- Content from uploaded files (if any) | |
3. Determine the most appropriate type (curso, webinar, entrenamiento, etc.) based on: | |
- Any type mentioned in product_name | |
- The nature of the solution described in avatar_description | |
- The most suitable format for the target audience's needs | |
4. Create a comprehensive offer by combining: | |
- The appropriate type (determined in step 3) | |
- The exact product name (if provided) or your created name (if needed) | |
- A compelling dream based on avatar_description | |
- A relevant obstacle based on avatar_description | |
5. The dream should be ambitious but believable, incorporating: | |
- Target audience desires from avatar_description | |
- Explicit goals mentioned in uploaded content (if any) | |
6. The obstacle should reflect: | |
- Real problems mentioned in avatar_description | |
- Challenges that would normally prevent achieving the dream | |
7. IMPORTANT: Vary the way you start the phrase. Instead of always using "Se trata de un...", use different openings such as: | |
- "Presentamos un..." | |
- "Te ofrecemos un..." | |
- "Descubre nuestro..." | |
- "Conoce el..." | |
- "Hemos creado un..." | |
- "Imagina tener acceso a un..." | |
- "Por fin existe un..." | |
- "Ahora puedes acceder a un..." | |
- "Tenemos para ti un..." | |
- "Disfruta de un..." | |
""" | |
elif selected_formula_name == "Oferta Dorada": | |
additional_instructions = """ | |
SPECIFIC INSTRUCTIONS FOR THIS FORMULA: | |
1. ATTENTION HOOK HANDLING: | |
- Analyze the avatar_description DEEPLY to understand their specific pain points, frustrations, and desires | |
- Select a powerful attention hook that DIRECTLY connects with the avatar's current reality | |
- DO NOT use questions as hooks - use statements, statistics, or shocking revelations instead | |
- CUSTOMIZE the hook specifically for this avatar - don't use generic examples | |
- The hook MUST address the SAME problem that your promise will solve | |
Choose randomly from these statement hooks and CUSTOMIZE for your avatar: | |
- "El 83% de los [avatar's profession/role] pierden [specific resource] en [specific activity] que nadie aprovecha." | |
- "9 de cada 10 [avatar's field] fracasan en sus primeros 6 meses por este error." | |
- "Lo que nadie te dice sobre [avatar's challenge] es que la mayoría fracasa en los primeros 3 meses." | |
- "El secreto que [competitors/industry] no quieren que sepas sobre [avatar's goal]." | |
- "Tu [avatar's current strategy/approach] está ahuyentando a tus [avatar's desired outcome]." | |
- "Mientras algunos [positive outcome], tú sigues [negative current situation]." | |
- "La mayoría de [current solutions] son una pérdida total de [resources]." | |
- "Hace 6 meses estaba exactamente donde tú estás: [avatar's current struggle]." | |
2. MAINTAIN THEMATIC CONSISTENCY: | |
- The attention hook, quantifiable promise, and benefit statement MUST all address the SAME problem | |
- Create a LOGICAL PROGRESSION from problem (hook) to solution (promise) to implementation (benefit) | |
3. Create a compelling QUANTIFIABLE PROMISE that: | |
- Is written COMPLETELY IN CAPITAL LETTERS | |
- Includes concrete numbers (money, time, results) | |
- Uses powerful action verbs (EARN, MULTIPLY, ACHIEVE, MASTER) | |
- Specifies the exact result they will obtain | |
- Optionally includes time or effort required | |
- NEVER uses exclamation marks (!) | |
- DIRECTLY addresses the same problem mentioned in the hook | |
4. Craft a benefit statement that: | |
- Clearly explains the result they will obtain | |
- Includes an authority element (proven method, studies, experience) | |
- Establishes a realistic timeframe or effort needed | |
- CONTINUES the same theme established in the hook and promise | |
""" | |
# Create the instruction using the system prompt at the beginning | |
instruction = f"""{offer_system_prompt} | |
FORMULA TO USE: | |
{selected_formula["description"]} | |
{additional_instructions} | |
PRODUCT/SERVICE: | |
{product_name} | |
TARGET AUDIENCE: | |
{avatar_description} | |
Create a compelling offer following the formula structure exactly. | |
""" | |
# Add examples if available | |
if selected_formula.get("examples") and len(selected_formula["examples"]) > 0: | |
examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"][:3])]) | |
instruction += f"\n\nGet inspired by these examples:\n{examples_text}" | |
return instruction | |
# Keep only the offer_formulas dictionary in this file | |
# The offer_formulas dictionary containing formula definitions | |
offer_formulas = { | |
"Oferta Dorada": { | |
"description": """ | |
Formula: [Attention Hook + QUANTIFIABLE PROMISE IN ALL CAPS + Benefit + Authority + Time or Effort] | |
This formula is designed to speak directly to the avatar, capturing their attention immediately, reflecting their current situation, and showing the transformation they desire. | |
### **How to apply it?** | |
#### 1 **Attention Hook** | |
The first step is to capture the avatar's attention with a powerful hook that can be a shocking revelation, an unexpected question, or a dramatic fact. IMPORTANT: CUSTOMIZE THE HOOK BASED ON THE AVATAR AND THEIR SPECIFIC PROBLEMS. Don't use generic examples, but adapt them to the client's situation. | |
Analyze first: | |
- What is the avatar's biggest pain or frustration? | |
- What are they trying to achieve without success? | |
- What limiting beliefs do they have? | |
--- | |
#### 2 **QUANTIFIABLE PROMISE IN ALL CAPS** | |
This is the most important part. You must create a specific, quantifiable promise written COMPLETELY IN CAPITAL LETTERS that immediately captures attention. It must include: | |
- Concrete numbers (money, time, results) | |
- Powerful action verbs (EARN, MULTIPLY, ACHIEVE, MASTER) | |
- The specific result they will obtain | |
- Optionally, the time or effort required | |
- IMPORTANT: DO NOT USE EXCLAMATION MARKS (!) IN THIS SECTION UNDER ANY CIRCUMSTANCES | |
**Incorrect example:** | |
"Improve your sales with our system." (Vague, no numbers, no impact). | |
"¡MULTIPLY YOUR SALES IN RECORD TIME!" (Uses exclamation marks, NEVER use them). | |
**Correct example:** | |
"FACTURA MAS DE $1.000 USD USANDO 15 EMAILS ESCRITOS EN 15 MINUTOS CADA UNO" (Specific, quantifiable, impactful). | |
"MULTIPLICA POR 3 TUS INTERACCIONES EN REDES SOCIALES EN SOLO 2 SEMANAS" (Clear, measurable, with defined time). | |
--- | |
#### 3 **Benefit + Authority + Time or Effort** | |
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. | |
# Fórmulas con ejemplos y explicaciones | |
# Only keep the offer_formulas dictionary in this file | |
offer_formulas = { | |
"La Fórmula 3 en 1": { | |
"description": """ | |
Formula: [Feature + Benefit + Meaning] | |
This formula creates an instant connection by linking three key elements: | |
1. Feature: The main characteristic or aspect of your offer | |
2. Benefit: What it allows the user to achieve or obtain | |
3. Meaning: The deeper impact or transformation in their life | |
**Instructions for Creating Connection Bullets:** | |
1. Identify Your Core Feature: | |
- What makes your offer unique? | |
- What's the main characteristic? | |
- What's the standout element? | |
2. Transform into Benefits: | |
- How does this feature help them? | |
- What can they achieve with it? | |
- What becomes possible? | |
3. Add Deeper Meaning: | |
- How does it transform their life? | |
- What's the emotional impact? | |
- What does it mean for their identity? | |
**Structure Formats:** | |
1. "[Feature] para que puedas [Benefit] con lo que [Meaning]" | |
2. "Con [Feature] podrás [Benefit] permitiéndote [Meaning]" | |
3. "Gracias a [Feature] lograrás [Benefit] haciendo que [Meaning]" | |
4. "Mediante [Feature] conseguirás [Benefit] lo que significa [Meaning]" | |
5. "Usando [Feature] alcanzarás [Benefit] transformando [Meaning]" | |
""", | |
"examples": [ | |
# Examples remain unchanged | |
] | |
}, | |
# Other formulas remain unchanged | |
} | |
**Incorrect example:** | |
"Grow your business with our strategy." (Doesn't say how long it will take or how reliable the strategy is). | |
**Correct examples:** | |
"El Sistema de emails persuasivos para que puedas convertir lectores en clientes con lo que multiplicarás tus ventas en solo 30 días." | |
"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." | |
"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." | |
"Mediante nuestro sistema de automatización conseguirás generar ventas mientras duermes lo que significa libertad financiera real en menos de 90 días." | |
"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." | |
--- | |
### **Fixed structure:** | |
"[Varied Attention Hook] | |
[QUANTIFIABLE PROMISE IN ALL CAPS] | |
[Choose one of the 5 structure formats for Benefit + Authority + Time or Effort]" | |
""", | |
"examples": [ | |
# Example 1 | |
"""El 83% de los emprendedores pierden dinero en anuncios que nadie convierte. | |
CONVIERTE EL 30% DE TUS VISITANTES EN COMPRADORES Y REDUCE TU COSTO DE ADQUISICIÓN A LA MITAD EN SOLO 14 DÍAS. | |
El Sistema de copywriting persuasivo para que puedas transformar visitantes en clientes con lo que multiplicarás tu ROI en menos de dos semanas.""", | |
# Example 2 | |
"""Tu lista de email está tan muerta que hasta los mensajes de spam tienen más aperturas. | |
AUMENTA TU TASA DE APERTURA AL 35% Y GENERA $2.500 EN VENTAS CON CADA CAMPAÑA DE EMAIL QUE ENVIES. | |
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.""", | |
# Example 3 | |
"""Mientras algunos facturan $10,000 al mes, tú sigues preguntándote por qué nadie compra. | |
FACTURA EL DOBLE SIN BAJAR TUS PRECIOS Y CONVIERTE EL 80% DE TUS PROPUESTAS EN CLIENTES PAGANDO. | |
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.""", | |
# Example 4 | |
"""Lo que nadie te dice sobre el marketing de contenidos es que el 95% nunca genera un solo cliente. | |
MULTIPLICA POR 5 TUS COMENTARIOS Y CONSIGUE 3 CLIENTES NUEVOS CADA SEMANA CON SOLO 20 MINUTOS DE TRABAJO DIARIO. | |
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.""", | |
# Example 5 | |
"""Ah, otro día más publicando en redes sociales y hablándole a las paredes... Qué divertido. | |
CONSIGUE 100 NUEVOS SEGUIDORES CUALIFICADOS POR SEMANA Y CONVIERTE EL 10% EN LEADS INTERESADOS EN TUS SERVICIOS. | |
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.""" | |
] | |
}, | |
"Fórmula Sueño-Obstáculo": { | |
"description": """ | |
Formula: [Type + Name + Dream + Obstacle] | |
This formula connects directly with the client's desires and concerns: | |
1. Type: The type of solution (training, product, or service) | |
2. Name: The name of your solution | |
3. Dream: The big dream or result that the client wants to achieve | |
4. Obstacle: The obstacle that would normally prevent achieving that dream | |
**Suggested solution types:** | |
- Online course | |
- Webinar | |
- Training | |
- Program | |
- Workshop | |
- Mentorship | |
- Consulting | |
- Membership | |
- System | |
- Method | |
- Service | |
- Product | |
- Application | |
- Community | |
- Masterclass | |
**Suggested opening variations:** | |
- "Se trata de un..." | |
- "Presentamos un..." | |
- "Te ofrecemos un..." | |
- "Descubre nuestro..." | |
- "Conoce el..." | |
- "Hemos creado un..." | |
- "Imagina tener acceso a un..." | |
- "Por fin existe un..." | |
- "Ahora puedes acceder a un..." | |
- "Tenemos para ti un..." | |
- "Disfruta de un..." | |
**Structure Format (Classic example):** | |
"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)" | |
""", | |
"examples": [] | |
} | |
} |