Spaces:
Sleeping
Sleeping
Upload 20 files
Browse files- app.py +17 -1
- avatar_analysis.py +89 -0
- prompts/solution_benefits.txt +50 -1
app.py
CHANGED
@@ -26,7 +26,8 @@ session_state_vars = {
|
|
26 |
'avatar_details': {},
|
27 |
'product_details': {},
|
28 |
'generated_sections': {},
|
29 |
-
'metadata': {}
|
|
|
30 |
}
|
31 |
|
32 |
for var, default in session_state_vars.items():
|
@@ -206,6 +207,19 @@ def generate_solution_section(audience, product, temperature=0.7, offer=None):
|
|
206 |
"""Generate the Solution & Benefits section."""
|
207 |
prompt_template = load_prompt_template("solution_benefits.txt")
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
# Create context dictionary with any existing session state data
|
210 |
context = {}
|
211 |
if 'headline_content' in st.session_state:
|
@@ -214,6 +228,8 @@ def generate_solution_section(audience, product, temperature=0.7, offer=None):
|
|
214 |
context['problem_content'] = st.session_state.problem_content
|
215 |
if 'avatar_details' in st.session_state:
|
216 |
context['avatar_details'] = st.session_state.avatar_details
|
|
|
|
|
217 |
|
218 |
# Create the prompt with the audience and product information
|
219 |
prompt = f"{prompt_template}\n\nAUDIENCE: {audience}\nPRODUCT/SERVICE: {product}\nCONTEXT: {context}"
|
|
|
26 |
'avatar_details': {},
|
27 |
'product_details': {},
|
28 |
'generated_sections': {},
|
29 |
+
'metadata': {},
|
30 |
+
'avatar_analysis': {} # Add this new session state variable
|
31 |
}
|
32 |
|
33 |
for var, default in session_state_vars.items():
|
|
|
207 |
"""Generate the Solution & Benefits section."""
|
208 |
prompt_template = load_prompt_template("solution_benefits.txt")
|
209 |
|
210 |
+
# Import the avatar analysis function
|
211 |
+
from avatar_analysis import analyze_avatar
|
212 |
+
|
213 |
+
# Generate avatar analysis if not already in session state
|
214 |
+
if not st.session_state.avatar_analysis:
|
215 |
+
avatar_analysis = analyze_avatar(
|
216 |
+
target_audience=audience,
|
217 |
+
product_service=product,
|
218 |
+
uploaded_content=None,
|
219 |
+
skills=None
|
220 |
+
)
|
221 |
+
st.session_state.avatar_analysis = avatar_analysis
|
222 |
+
|
223 |
# Create context dictionary with any existing session state data
|
224 |
context = {}
|
225 |
if 'headline_content' in st.session_state:
|
|
|
228 |
context['problem_content'] = st.session_state.problem_content
|
229 |
if 'avatar_details' in st.session_state:
|
230 |
context['avatar_details'] = st.session_state.avatar_details
|
231 |
+
if 'avatar_analysis' in st.session_state:
|
232 |
+
context['avatar_analysis'] = st.session_state.avatar_analysis
|
233 |
|
234 |
# Create the prompt with the audience and product information
|
235 |
prompt = f"{prompt_template}\n\nAUDIENCE: {audience}\nPRODUCT/SERVICE: {product}\nCONTEXT: {context}"
|
avatar_analysis.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def analyze_avatar(target_audience=None, product_service=None, uploaded_content=None, skills=None):
|
2 |
+
"""
|
3 |
+
Performs a deep analysis of the avatar based on provided information.
|
4 |
+
|
5 |
+
Args:
|
6 |
+
target_audience: Description of the target audience
|
7 |
+
product_service: Kind of product or service
|
8 |
+
uploaded_content: Content from uploaded files (if any)
|
9 |
+
skills: User's skills and expertise
|
10 |
+
|
11 |
+
Returns:
|
12 |
+
dict: Complete avatar analysis
|
13 |
+
"""
|
14 |
+
# Information available for analysis
|
15 |
+
info_section = f"""
|
16 |
+
INFORMACIÓN DISPONIBLE PARA ANÁLISIS:
|
17 |
+
|
18 |
+
1. DESCRIPCIÓN DEL PÚBLICO OBJETIVO:
|
19 |
+
{target_audience if target_audience else "No se ha proporcionado descripción específica del público objetivo."}
|
20 |
+
|
21 |
+
2. PRODUCTO/SERVICIO:
|
22 |
+
{product_service if product_service else "No se ha proporcionado nombre específico del producto/servicio."}
|
23 |
+
|
24 |
+
3. CONTENIDO ADICIONAL:
|
25 |
+
{uploaded_content if uploaded_content else "No se ha subido contenido adicional."}
|
26 |
+
|
27 |
+
4. HABILIDADES Y EXPERIENCIA:
|
28 |
+
{skills if skills else "No se han proporcionado habilidades específicas."}
|
29 |
+
|
30 |
+
IMPORTANTE: Analiza TODA la información disponible para identificar puntos de dolor específicos, objeciones y necesidades que puedan abordarse en la oferta principal.
|
31 |
+
"""
|
32 |
+
|
33 |
+
# Complete avatar analysis framework
|
34 |
+
avatar_analysis = f"""
|
35 |
+
FRAMEWORK DE ANÁLISIS PROFUNDO DEL AVATAR:
|
36 |
+
|
37 |
+
PASO 1: DEFINE CON PRECISIÓN EL AVATAR
|
38 |
+
Tu avatar no es solo un título profesional, sino una persona con miedos, aspiraciones y problemas específicos.
|
39 |
+
- Identifica quién es exactamente (demografía, psicografía, rol, estatus)
|
40 |
+
- Determina qué problema específico lo está frenando ahora mismo
|
41 |
+
- Comprende cómo este problema impacta su negocio o vida personal
|
42 |
+
- Clarifica en qué etapa se encuentra para resolver este problema
|
43 |
+
- Define su nivel de conciencia sobre las posibles soluciones
|
44 |
+
|
45 |
+
PASO 2: IDENTIFICA SUS DOLORES Y FRUSTRACIONES REALES
|
46 |
+
Los pains deben ir más allá de lo superficial. Enfócate en lo que realmente los mantiene despiertos por la noche.
|
47 |
+
- ¿Qué lo frustra día a día relacionado con este problema?
|
48 |
+
- ¿Qué pensamientos negativos o creencias limitantes lo están frenando?
|
49 |
+
- ¿Qué ha intentado antes que no ha funcionado?
|
50 |
+
- ¿Qué obstáculos específicos le impiden avanzar?
|
51 |
+
|
52 |
+
PASO 3: CONÉCTALO CON LA EMOCIÓN QUE LE PROVOCA EL PROBLEMA
|
53 |
+
Las emociones son el verdadero motor de la compra. Identifica cómo se sienten al enfrentar sus problemas.
|
54 |
+
- ¿Cómo se siente al enfrentar este problema? (avergonzado, abrumado, frustrado)
|
55 |
+
- ¿Qué impacto tiene esto en su confianza y autoestima?
|
56 |
+
- ¿Qué disparadores emocionales podrían impedirle tomar acción?
|
57 |
+
|
58 |
+
PASO 4: MUESTRA EL IMPACTO DEL PROBLEMA EN SU VIDA REAL
|
59 |
+
El cliente debe verse reflejado en escenarios concretos.
|
60 |
+
- ¿Cómo afecta específicamente a su negocio, relaciones o finanzas?
|
61 |
+
- ¿Qué consecuencias está sufriendo por no resolverlo?
|
62 |
+
- ¿Qué oportunidades está perdiendo?
|
63 |
+
- ¿Cuál es el costo de la inacción (financiero, emocional, tiempo)?
|
64 |
+
|
65 |
+
PASO 5: DEFINE SU DESEO MÁS PROFUNDO
|
66 |
+
El "deseo egoísta" es lo que realmente quiere, sin filtros ni justificaciones.
|
67 |
+
- ¿Qué quiere lograr realmente más allá del objetivo superficial?
|
68 |
+
- ¿Cómo sería su vida sin este problema?
|
69 |
+
- ¿Qué transformación está buscando realmente?
|
70 |
+
- ¿Qué cambio de estatus o identidad desea?
|
71 |
+
|
72 |
+
PASO 6: ILUSTRA ESE DESEO EN SU VIDA DIARIA
|
73 |
+
Haz tangible y concreto ese deseo profundo.
|
74 |
+
- ¿Cómo se vería un día típico después de lograr esa transformación?
|
75 |
+
- ¿Qué podría hacer o experimentar que ahora no puede?
|
76 |
+
- ¿Cómo cambiaría su relación con los demás?
|
77 |
+
- ¿Qué nuevas oportunidades se abrirían para él/ella?
|
78 |
+
|
79 |
+
PASO 7: IDENTIFICA LAS OBJECIONES PRINCIPALES
|
80 |
+
Las objeciones son las barreras mentales que impiden la compra.
|
81 |
+
- ¿Qué dudas o preocupaciones tiene sobre la solución?
|
82 |
+
- ¿Qué experiencias negativas previas podrían estar influyendo?
|
83 |
+
- ¿Qué garantías o pruebas necesitaría para sentirse seguro?
|
84 |
+
- ¿Qué factores externos podrían impedir su decisión?
|
85 |
+
|
86 |
+
{info_section}
|
87 |
+
"""
|
88 |
+
|
89 |
+
return avatar_analysis
|
prompts/solution_benefits.txt
CHANGED
@@ -20,6 +20,12 @@ THE EXPERT TEAM:
|
|
20 |
- Specializes in risk-reversal techniques and trust-building elements
|
21 |
- Ensures the solution feels safe, proven, and reliable
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
YOUR TASK:
|
24 |
Create the SOLUTION & BENEFITS section of a compelling sales page that offers a solution through the product/service.
|
25 |
|
@@ -44,6 +50,26 @@ SOLUTION STRUCTURE:
|
|
44 |
- Include specific results or transformations customers can expect
|
45 |
- Address common objections preemptively
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
# If previous sections were generated, use them as context
|
48 |
if 'headline_content' in context:
|
49 |
Align your solution with the promise made in the headline.
|
@@ -56,6 +82,17 @@ if 'problem_content' in context:
|
|
56 |
if 'avatar_details' in context:
|
57 |
Tailor the benefits to the specific needs and desires of the avatar.
|
58 |
Use language and examples that will resonate with the avatar's demographic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
if 'product_details' in context:
|
61 |
Highlight the specific features of the product that solve the problem.
|
@@ -77,7 +114,19 @@ A diferencia de otros cursos genéricos sobre inversiones, el Sistema IBRR te pr
|
|
77 |
|
78 |
María, quien mencioné anteriormente, utilizó exactamente este sistema para identificar su primera propiedad de inversión. En menos de 60 días, había completado su primera transacción con una rentabilidad del 22% sobre su inversión inicial.
|
79 |
|
80 |
-
Lo mejor de todo es que no necesitas experiencia previa ni grandes cantidades de capital para empezar. Nuestro sistema está diseñado específicamente para principiantes que quieren minimizar riesgos mientras maximizan sus retornos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
IMPORTANT INSTRUCTIONS:
|
83 |
- Write the entire section in Spanish
|
|
|
20 |
- Specializes in risk-reversal techniques and trust-building elements
|
21 |
- Ensures the solution feels safe, proven, and reliable
|
22 |
|
23 |
+
4. AVATAR ANALYST:
|
24 |
+
- Expert in deeply understanding the target audience's psychology
|
25 |
+
- Identifies specific pain points, desires, and objections
|
26 |
+
- Translates audience needs into compelling solution frameworks
|
27 |
+
- Ensures all content resonates with the avatar's emotional triggers
|
28 |
+
|
29 |
YOUR TASK:
|
30 |
Create the SOLUTION & BENEFITS section of a compelling sales page that offers a solution through the product/service.
|
31 |
|
|
|
50 |
- Include specific results or transformations customers can expect
|
51 |
- Address common objections preemptively
|
52 |
|
53 |
+
BENEFIT BULLETS SECTION:
|
54 |
+
After creating the main solution section, add a section with 5 powerful benefit bullets that reinforce the promise.
|
55 |
+
|
56 |
+
Start the bullets section with one of these creative introductions:
|
57 |
+
"**5 Cambios poderosos que notarás:**" or
|
58 |
+
"**Lo que descubrirás en este viaje:**" or
|
59 |
+
"**Tu nueva realidad incluye:**"
|
60 |
+
|
61 |
+
FORMAT RULES FOR BULLETS:
|
62 |
+
- Each benefit must start with "• " (bullet point followed by a space)
|
63 |
+
- The first verb or action phrase of each bullet must be in bold using "**bold text**"
|
64 |
+
- One benefit per line with exactly one empty line between bullets
|
65 |
+
- Never include colons (:) in bullets
|
66 |
+
- Never use exclamation marks (!) in any bullet
|
67 |
+
- Each benefit must be a complete and concise phrase
|
68 |
+
- Do not use any emojis in the bullets
|
69 |
+
- Use natural, conversational language
|
70 |
+
- ALL bullets must follow exactly the same formatting pattern
|
71 |
+
- The spacing between bullets must be exactly the same (one empty line)
|
72 |
+
|
73 |
# If previous sections were generated, use them as context
|
74 |
if 'headline_content' in context:
|
75 |
Align your solution with the promise made in the headline.
|
|
|
82 |
if 'avatar_details' in context:
|
83 |
Tailor the benefits to the specific needs and desires of the avatar.
|
84 |
Use language and examples that will resonate with the avatar's demographic.
|
85 |
+
Address the specific emotional triggers identified in the avatar analysis.
|
86 |
+
Counter the limiting beliefs that might prevent the avatar from taking action.
|
87 |
+
Show how your solution overcomes the specific obstacles mentioned.
|
88 |
+
|
89 |
+
if 'avatar_analysis' in context:
|
90 |
+
Use the detailed avatar analysis to:
|
91 |
+
- Address the specific pains and frustrations identified
|
92 |
+
- Connect with the emotional triggers that motivate action
|
93 |
+
- Show how your solution fulfills their deepest desires
|
94 |
+
- Preemptively handle the objections identified
|
95 |
+
- Create scenarios that illustrate the transformation in their daily life
|
96 |
|
97 |
if 'product_details' in context:
|
98 |
Highlight the specific features of the product that solve the problem.
|
|
|
114 |
|
115 |
María, quien mencioné anteriormente, utilizó exactamente este sistema para identificar su primera propiedad de inversión. En menos de 60 días, había completado su primera transacción con una rentabilidad del 22% sobre su inversión inicial.
|
116 |
|
117 |
+
Lo mejor de todo es que no necesitas experiencia previa ni grandes cantidades de capital para empezar. Nuestro sistema está diseñado específicamente para principiantes que quieren minimizar riesgos mientras maximizan sus retornos.
|
118 |
+
|
119 |
+
**5 Cambios poderosos que notarás:**
|
120 |
+
|
121 |
+
• **Participa con confianza** en el mercado inmobiliario y toma decisiones informadas desde tu primera inversión.
|
122 |
+
|
123 |
+
• **Supera el miedo** a perder tu dinero gracias a nuestro sistema de análisis de riesgo que minimiza las posibilidades de error.
|
124 |
+
|
125 |
+
• **Accede a oportunidades** exclusivas que normalmente solo están disponibles para inversores experimentados.
|
126 |
+
|
127 |
+
• **Optimiza tu capital** inicial y maximiza tus retornos con estrategias probadas por cientos de inversores exitosos.
|
128 |
+
|
129 |
+
• **Construye un patrimonio** sólido que te genere ingresos pasivos mes tras mes sin necesidad de trabajar más horas."
|
130 |
|
131 |
IMPORTANT INSTRUCTIONS:
|
132 |
- Write the entire section in Spanish
|