Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files- app.py +51 -27
- formulas.py +81 -161
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import time
|
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
from styles import get_custom_css, get_response_html_wrapper
|
| 7 |
from formulas import offer_formulas
|
|
|
|
| 8 |
import PyPDF2
|
| 9 |
import docx
|
| 10 |
from PIL import Image
|
|
@@ -20,8 +21,8 @@ load_dotenv()
|
|
| 20 |
genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
|
| 21 |
model = genai.GenerativeModel('gemini-2.0-flash')
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
from formulas import create_offer_instruction, offer_formulas
|
| 25 |
|
| 26 |
# Initialize session state variables if they don't exist
|
| 27 |
if 'submitted' not in st.session_state:
|
|
@@ -53,48 +54,46 @@ col1, col2 = st.columns([4, 6])
|
|
| 53 |
# Main input section in left column
|
| 54 |
with col1:
|
| 55 |
# Define the generate_offer function first
|
| 56 |
-
def handle_generate_button():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
has_manual_input = bool(skills or product_service)
|
| 58 |
has_file_input = bool(uploaded_file is not None and not is_image)
|
| 59 |
has_image_input = bool(uploaded_file is not None and is_image)
|
| 60 |
-
|
| 61 |
-
# Simple validation - check if we have at least one input type
|
| 62 |
if not (has_manual_input or has_file_input or has_image_input):
|
| 63 |
st.error('Por favor ingresa texto o sube un archivo/imagen')
|
| 64 |
return
|
| 65 |
|
|
|
|
| 66 |
st.session_state.submitted = True
|
| 67 |
-
st.session_state.generated = False
|
| 68 |
|
| 69 |
-
# Store inputs
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
| 73 |
|
| 74 |
if has_file_input:
|
| 75 |
st.session_state.file_content = file_content
|
| 76 |
|
| 77 |
if has_image_input:
|
| 78 |
-
st.session_state.
|
| 79 |
|
| 80 |
-
#
|
| 81 |
if has_image_input:
|
| 82 |
-
if has_manual_input
|
| 83 |
-
st.session_state.input_type = "manual_image"
|
| 84 |
-
else:
|
| 85 |
-
st.session_state.input_type = "image"
|
| 86 |
else:
|
| 87 |
-
if has_manual_input and has_file_input
|
| 88 |
-
st.session_state.input_type = "both"
|
| 89 |
-
elif has_file_input:
|
| 90 |
-
st.session_state.input_type = "file"
|
| 91 |
-
elif has_manual_input:
|
| 92 |
-
st.session_state.input_type = "manual"
|
| 93 |
|
| 94 |
-
#
|
| 95 |
-
|
| 96 |
-
st.session_state.temperature = temperature
|
| 97 |
-
st.session_state.formula_type = formula_type
|
| 98 |
|
| 99 |
# Keep only the manual input tab
|
| 100 |
with st.container():
|
|
@@ -196,12 +195,37 @@ with col2:
|
|
| 196 |
product_name = "Producto/Servicio"
|
| 197 |
|
| 198 |
# Get the instruction using the formula
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
instruction = create_offer_instruction(
|
| 200 |
avatar_description=avatar_description,
|
| 201 |
product_name=product_name,
|
| 202 |
-
selected_formula_name=
|
|
|
|
| 203 |
)
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
# Add additional context based on input type
|
| 206 |
if st.session_state.input_type == "manual":
|
| 207 |
additional_context = f"""
|
|
|
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
from styles import get_custom_css, get_response_html_wrapper
|
| 7 |
from formulas import offer_formulas
|
| 8 |
+
from prompts import create_offer_instruction, create_promise_instruction
|
| 9 |
import PyPDF2
|
| 10 |
import docx
|
| 11 |
from PIL import Image
|
|
|
|
| 21 |
genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
|
| 22 |
model = genai.GenerativeModel('gemini-2.0-flash')
|
| 23 |
|
| 24 |
+
# Remove duplicate import
|
| 25 |
+
# from formulas import create_offer_instruction, offer_formulas
|
| 26 |
|
| 27 |
# Initialize session state variables if they don't exist
|
| 28 |
if 'submitted' not in st.session_state:
|
|
|
|
| 54 |
# Main input section in left column
|
| 55 |
with col1:
|
| 56 |
# Define the generate_offer function first
|
| 57 |
+
def handle_generate_button():
|
| 58 |
+
# Get file type if file is uploaded
|
| 59 |
+
is_image = False
|
| 60 |
+
if uploaded_file is not None:
|
| 61 |
+
file_type = uploaded_file.name.split('.')[-1].lower()
|
| 62 |
+
is_image = file_type in ['jpg', 'jpeg', 'png']
|
| 63 |
+
|
| 64 |
+
# Validate inputs
|
| 65 |
has_manual_input = bool(skills or product_service)
|
| 66 |
has_file_input = bool(uploaded_file is not None and not is_image)
|
| 67 |
has_image_input = bool(uploaded_file is not None and is_image)
|
| 68 |
+
|
|
|
|
| 69 |
if not (has_manual_input or has_file_input or has_image_input):
|
| 70 |
st.error('Por favor ingresa texto o sube un archivo/imagen')
|
| 71 |
return
|
| 72 |
|
| 73 |
+
# Update session state
|
| 74 |
st.session_state.submitted = True
|
| 75 |
+
st.session_state.generated = False
|
| 76 |
|
| 77 |
+
# Store inputs
|
| 78 |
+
st.session_state.skills = skills
|
| 79 |
+
st.session_state.product_service = product_service
|
| 80 |
+
st.session_state.target_audience = target_audience
|
| 81 |
+
st.session_state.formula_type = formula_type
|
| 82 |
|
| 83 |
if has_file_input:
|
| 84 |
st.session_state.file_content = file_content
|
| 85 |
|
| 86 |
if has_image_input:
|
| 87 |
+
st.session_state.image = uploaded_file.getvalue()
|
| 88 |
|
| 89 |
+
# Determine input type
|
| 90 |
if has_image_input:
|
| 91 |
+
st.session_state.input_type = "manual_image" if has_manual_input else "image"
|
|
|
|
|
|
|
|
|
|
| 92 |
else:
|
| 93 |
+
st.session_state.input_type = "both" if (has_manual_input and has_file_input) else ("file" if has_file_input else "manual")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
+
# Call generate_offer function to create the offer
|
| 96 |
+
generate_offer()
|
|
|
|
|
|
|
| 97 |
|
| 98 |
# Keep only the manual input tab
|
| 99 |
with st.container():
|
|
|
|
| 195 |
product_name = "Producto/Servicio"
|
| 196 |
|
| 197 |
# Get the instruction using the formula
|
| 198 |
+
# Usar la función actualizada
|
| 199 |
+
# In the generate_offer function or wherever the error is occurring
|
| 200 |
+
# The function definition needs proper indentation for its body
|
| 201 |
+
# Where you're generating the offer
|
| 202 |
+
def generate_offer():
|
| 203 |
+
# Get necessary variables
|
| 204 |
+
selected_formula_name = st.session_state.formula_type
|
| 205 |
+
avatar_description = st.session_state.target_audience
|
| 206 |
+
product_name = st.session_state.product_service
|
| 207 |
+
|
| 208 |
+
# Create the base instruction
|
| 209 |
instruction = create_offer_instruction(
|
| 210 |
avatar_description=avatar_description,
|
| 211 |
product_name=product_name,
|
| 212 |
+
selected_formula_name=selected_formula_name,
|
| 213 |
+
offer_formulas=offer_formulas
|
| 214 |
)
|
| 215 |
|
| 216 |
+
# Add file content if available
|
| 217 |
+
if st.session_state.input_type in ["file", "both"]:
|
| 218 |
+
additional_context = f"\n\nAdditional context from uploaded file:\n{st.session_state.file_content}"
|
| 219 |
+
instruction += additional_context
|
| 220 |
+
|
| 221 |
+
# Generate the response
|
| 222 |
+
response = model.generate_content(instruction)
|
| 223 |
+
offer_result = response.text
|
| 224 |
+
|
| 225 |
+
# Update session state
|
| 226 |
+
st.session_state.offer_result = offer_result
|
| 227 |
+
st.session_state.generated = True
|
| 228 |
+
|
| 229 |
# Add additional context based on input type
|
| 230 |
if st.session_state.input_type == "manual":
|
| 231 |
additional_context = f"""
|
formulas.py
CHANGED
|
@@ -1,155 +1,3 @@
|
|
| 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.
|
| 25 |
-
|
| 26 |
-
Args:
|
| 27 |
-
avatar_description: Description of the target audience
|
| 28 |
-
product_name: Name of the product or service
|
| 29 |
-
selected_formula_name: Name of the formula to use ("Fórmula Sueño-Obstáculo" or "Oferta Dorada")
|
| 30 |
-
|
| 31 |
-
Returns:
|
| 32 |
-
str: Complete instruction for generating the offer
|
| 33 |
-
"""
|
| 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":
|
| 40 |
-
additional_instructions = """
|
| 41 |
-
SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
|
| 42 |
-
1. PRODUCT/SERVICE NAME HANDLING:
|
| 43 |
-
- If product_name is provided and not empty, use it EXACTLY as written
|
| 44 |
-
- If product_name is empty, generic (like "Producto/Servicio"), or contains placeholders, CREATE a compelling name that:
|
| 45 |
-
* Reflects the target audience's desires and challenges
|
| 46 |
-
* Communicates the main benefit or transformation
|
| 47 |
-
* Sounds professional and memorable
|
| 48 |
-
* Is specific to the niche or industry mentioned in avatar_description
|
| 49 |
-
- If product_name contains a full phrase like "Un curso llamado Inglés sin problemas", extract only the real name ("Inglés sin problemas")
|
| 50 |
-
|
| 51 |
-
2. Analyze ALL available information:
|
| 52 |
-
- Product/service name (product_name variable) or create one if needed
|
| 53 |
-
- Target audience description (avatar_description)
|
| 54 |
-
- Content from uploaded files (if any)
|
| 55 |
-
|
| 56 |
-
3. Determine the most appropriate type (curso, webinar, entrenamiento, etc.) based on:
|
| 57 |
-
- Any type mentioned in product_name
|
| 58 |
-
- The nature of the solution described in avatar_description
|
| 59 |
-
- The most suitable format for the target audience's needs
|
| 60 |
-
|
| 61 |
-
4. Create a comprehensive offer by combining:
|
| 62 |
-
- The appropriate type (determined in step 3)
|
| 63 |
-
- The exact product name (if provided) or your created name (if needed)
|
| 64 |
-
- A compelling dream based on avatar_description
|
| 65 |
-
- A relevant obstacle based on avatar_description
|
| 66 |
-
|
| 67 |
-
5. The dream should be ambitious but believable, incorporating:
|
| 68 |
-
- Target audience desires from avatar_description
|
| 69 |
-
- Explicit goals mentioned in uploaded content (if any)
|
| 70 |
-
|
| 71 |
-
6. The obstacle should reflect:
|
| 72 |
-
- Real problems mentioned in avatar_description
|
| 73 |
-
- Challenges that would normally prevent achieving the dream
|
| 74 |
-
|
| 75 |
-
7. IMPORTANT: Vary the way you start the phrase. Instead of always using "Se trata de un...", use different openings such as:
|
| 76 |
-
- "Presentamos un..."
|
| 77 |
-
- "Te ofrecemos un..."
|
| 78 |
-
- "Descubre nuestro..."
|
| 79 |
-
- "Conoce el..."
|
| 80 |
-
- "Hemos creado un..."
|
| 81 |
-
- "Imagina tener acceso a un..."
|
| 82 |
-
- "Por fin existe un..."
|
| 83 |
-
- "Ahora puedes acceder a un..."
|
| 84 |
-
- "Tenemos para ti un..."
|
| 85 |
-
- "Disfruta de un..."
|
| 86 |
-
"""
|
| 87 |
-
|
| 88 |
-
elif selected_formula_name == "Oferta Dorada":
|
| 89 |
-
additional_instructions = """
|
| 90 |
-
SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
|
| 91 |
-
1. ATTENTION HOOK HANDLING:
|
| 92 |
-
- Analyze the avatar_description DEEPLY to understand their specific pain points, frustrations, and desires
|
| 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], tú 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 tú 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)
|
| 116 |
-
- Specifies the exact result they will obtain
|
| 117 |
-
- Optionally includes time or effort required
|
| 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 |
-
|
| 139 |
-
TARGET AUDIENCE:
|
| 140 |
-
{avatar_description}
|
| 141 |
-
|
| 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
|
| 153 |
offer_formulas = {
|
| 154 |
"Oferta Dorada": {
|
| 155 |
"description": """
|
|
@@ -190,13 +38,6 @@ This is the most important part. You must create a specific, quantifiable promis
|
|
| 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 |
|
|
@@ -251,7 +92,35 @@ In this part, we explain the result they will obtain, supported by an authority
|
|
| 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": {
|
| 257 |
"description": """
|
|
@@ -297,6 +166,57 @@ This formula connects directly with the client's desires and concerns:
|
|
| 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 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
offer_formulas = {
|
| 2 |
"Oferta Dorada": {
|
| 3 |
"description": """
|
|
|
|
| 38 |
#### 3 **Benefit + Authority + Time or Effort**
|
| 39 |
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.
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
**Incorrect example:**
|
| 42 |
"Grow your business with our strategy." (Doesn't say how long it will take or how reliable the strategy is).
|
| 43 |
|
|
|
|
| 92 |
CONSIGUE 100 NUEVOS SEGUIDORES CUALIFICADOS POR SEMANA Y CONVIERTE EL 10% EN LEADS INTERESADOS EN TUS SERVICIOS.
|
| 93 |
|
| 94 |
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."""
|
| 95 |
+
],
|
| 96 |
+
"custom_instructions": """
|
| 97 |
+
SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
|
| 98 |
+
1. ATTENTION HOOK HANDLING:
|
| 99 |
+
- Analyze the avatar_description DEEPLY to understand their specific pain points, frustrations, and desires
|
| 100 |
+
- Select a powerful attention hook that DIRECTLY connects with the avatar's current reality
|
| 101 |
+
- Use statements, statistics, or shocking revelations, questions as hooks
|
| 102 |
+
- CUSTOMIZE the hook specifically for this avatar - don't use generic examples
|
| 103 |
+
- The hook MUST address the SAME problem that your promise will solve
|
| 104 |
+
|
| 105 |
+
2. MAINTAIN THEMATIC CONSISTENCY:
|
| 106 |
+
- The attention hook, quantifiable promise, and benefit statement MUST all address the SAME problem
|
| 107 |
+
- Create a LOGICAL PROGRESSION from problem (hook) to solution (promise) to implementation (benefit)
|
| 108 |
+
|
| 109 |
+
3. Create a compelling QUANTIFIABLE PROMISE that:
|
| 110 |
+
- Is written COMPLETELY IN CAPITAL LETTERS
|
| 111 |
+
- Includes concrete numbers (money, time, results)
|
| 112 |
+
- Uses powerful action verbs (EARN, MULTIPLY, ACHIEVE, MASTER)
|
| 113 |
+
- Specifies the exact result they will obtain
|
| 114 |
+
- Optionally includes time or effort required
|
| 115 |
+
- NEVER uses exclamation marks (!)
|
| 116 |
+
- DIRECTLY addresses the same problem mentioned in the hook
|
| 117 |
+
|
| 118 |
+
4. Craft a benefit statement that:
|
| 119 |
+
- Clearly explains the result they will obtain
|
| 120 |
+
- Includes an authority element (proven method, studies, experience)
|
| 121 |
+
- Establishes a realistic timeframe or effort needed
|
| 122 |
+
- CONTINUES the same theme established in the hook and promise
|
| 123 |
+
"""
|
| 124 |
},
|
| 125 |
"Fórmula Sueño-Obstáculo": {
|
| 126 |
"description": """
|
|
|
|
| 166 |
**Structure Format (Classic example):**
|
| 167 |
"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)"
|
| 168 |
""",
|
| 169 |
+
"examples": [
|
| 170 |
+
"Se trata de un entrenamiento llamado \"Método Flujo Creativo\" que te va a permitir escribir contenido de alto impacto todos los días aún y cuando creas que no tienes talento para la escritura.",
|
| 171 |
+
"Se trata de un servicio llamado \"Transformación Financiera Total\" que te va a permitir duplicar tus ingresos en 90 días aún y cuando ahora mismo estés endeudado hasta el cuello.",
|
| 172 |
+
"Se trata de un producto llamado \"Sistema de Meditación Rápida\" que te va a permitir alcanzar estados profundos de calma en solo 5 minutos aún y cuando tengas una mente hiperactiva que no para de pensar."
|
| 173 |
+
],
|
| 174 |
+
"custom_instructions": """
|
| 175 |
+
SPECIFIC INSTRUCTIONS FOR THIS FORMULA:
|
| 176 |
+
1. PRODUCT/SERVICE NAME HANDLING:
|
| 177 |
+
- If product_name is provided and not empty, use it EXACTLY as written
|
| 178 |
+
- If product_name is empty, generic (like "Producto/Servicio"), or contains placeholders, CREATE a compelling name that:
|
| 179 |
+
* Reflects the target audience's desires and challenges
|
| 180 |
+
* Communicates the main benefit or transformation
|
| 181 |
+
* Sounds professional and memorable
|
| 182 |
+
* Is specific to the niche or industry mentioned in avatar_description
|
| 183 |
+
- If product_name contains a full phrase like "Un curso llamado Inglés sin problemas", extract only the real name ("Inglés sin problemas")
|
| 184 |
+
|
| 185 |
+
2. Analyze ALL available information:
|
| 186 |
+
- Product/service name (product_name variable) or create one if needed
|
| 187 |
+
- Target audience description (avatar_description)
|
| 188 |
+
- Content from uploaded files (if any)
|
| 189 |
+
|
| 190 |
+
3. Determine the most appropriate type (curso, webinar, entrenamiento, etc.) based on:
|
| 191 |
+
- Any type mentioned in product_name
|
| 192 |
+
- The nature of the solution described in avatar_description
|
| 193 |
+
- The most suitable format for the target audience's needs
|
| 194 |
+
|
| 195 |
+
4. Create a comprehensive offer by combining:
|
| 196 |
+
- The appropriate type (determined in step 3)
|
| 197 |
+
- The exact product name (if provided) or your created name (if needed)
|
| 198 |
+
- A compelling dream based on avatar_description
|
| 199 |
+
- A relevant obstacle based on avatar_description
|
| 200 |
+
|
| 201 |
+
5. The dream should be ambitious but believable, incorporating:
|
| 202 |
+
- Target audience desires from avatar_description
|
| 203 |
+
- Explicit goals mentioned in uploaded content (if any)
|
| 204 |
+
|
| 205 |
+
6. The obstacle should reflect:
|
| 206 |
+
- Real problems mentioned in avatar_description
|
| 207 |
+
- Challenges that would normally prevent achieving the dream
|
| 208 |
+
|
| 209 |
+
7. IMPORTANT: Vary the way you start the phrase. Instead of always using "Se trata de un...", use different openings such as:
|
| 210 |
+
- "Presentamos un..."
|
| 211 |
+
- "Te ofrecemos un..."
|
| 212 |
+
- "Descubre nuestro..."
|
| 213 |
+
- "Conoce el..."
|
| 214 |
+
- "Hemos creado un..."
|
| 215 |
+
- "Imagina tener acceso a un..."
|
| 216 |
+
- "Por fin existe un..."
|
| 217 |
+
- "Ahora puedes acceder a un..."
|
| 218 |
+
- "Tenemos para ti un..."
|
| 219 |
+
- "Disfruta de un..."
|
| 220 |
+
"""
|
| 221 |
}
|
| 222 |
}
|