JeCabrera commited on
Commit
e393388
·
verified ·
1 Parent(s): 1376a64

Upload 3 files

Browse files
Files changed (2) hide show
  1. app.py +26 -3
  2. formulas.py +84 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import google.generativeai as genai
3
  import os
4
  from dotenv import load_dotenv
5
  from styles import get_custom_css
 
6
 
7
  # Set page to wide mode to use full width
8
  st.set_page_config(layout="wide")
@@ -50,6 +51,23 @@ with col1:
50
  with st.expander('⚙️ Configuración Avanzada'):
51
  target_audience = st.text_area('👥 Público Objetivo', height=70,
52
  help='Describe tu cliente o público ideal')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  temperature = st.slider('🌡️ Nivel de Creatividad', min_value=0.0, max_value=2.0, value=0.7,
54
  help='Valores más altos hacen que el resultado sea más creativo pero menos enfocado')
55
 
@@ -65,6 +83,7 @@ with col1:
65
  st.session_state.product_service = product_service
66
  st.session_state.target_audience = target_audience
67
  st.session_state.temperature = temperature
 
68
 
69
  st.button('Generar Oferta 🎉', on_click=generate_offer)
70
 
@@ -73,13 +92,17 @@ with col2:
73
  # Check if form has been submitted
74
  if st.session_state.submitted:
75
  with st.spinner('Creando tu oferta perfecta...'):
76
- prompt = f"""Based on the following information, create a compelling offer:
77
  Skills: {st.session_state.skills}
78
  Product/Service: {st.session_state.product_service}
79
  Target Audience: {st.session_state.target_audience if st.session_state.target_audience else 'General audience'}
80
 
 
 
 
81
  Please create a professional and engaging offer that highlights the value proposition
82
- and appeals to the target audience. Include a clear call to action."""
 
83
 
84
  try:
85
  # Create generation config with temperature
@@ -89,7 +112,7 @@ with col2:
89
  response = model.generate_content(prompt, generation_config=generation_config)
90
  st.session_state.offer_result = response.text
91
 
92
- # Display result (removed the "Your offer is ready!" message)
93
  st.markdown('### 📝 Oferta Generada')
94
  st.markdown(st.session_state.offer_result)
95
 
 
3
  import os
4
  from dotenv import load_dotenv
5
  from styles import get_custom_css
6
+ from formulas import offer_formulas
7
 
8
  # Set page to wide mode to use full width
9
  st.set_page_config(layout="wide")
 
51
  with st.expander('⚙️ Configuración Avanzada'):
52
  target_audience = st.text_area('👥 Público Objetivo', height=70,
53
  help='Describe tu cliente o público ideal')
54
+
55
+ # Selector de fórmula
56
+ formula_type = st.selectbox(
57
+ '📋 Tipo de Fórmula',
58
+ options=list(offer_formulas.keys()),
59
+ help='Selecciona el tipo de fórmula para tu oferta'
60
+ )
61
+
62
+ # Mostrar descripción de la fórmula seleccionada
63
+ with st.expander("ℹ️ Ver detalles de la fórmula"):
64
+ st.markdown(offer_formulas[formula_type]["description"])
65
+
66
+ # Mostrar ejemplos
67
+ st.subheader("Ejemplos:")
68
+ for example in offer_formulas[formula_type]["examples"][:3]: # Mostrar solo 3 ejemplos
69
+ st.markdown(f"• {example}")
70
+
71
  temperature = st.slider('🌡️ Nivel de Creatividad', min_value=0.0, max_value=2.0, value=0.7,
72
  help='Valores más altos hacen que el resultado sea más creativo pero menos enfocado')
73
 
 
83
  st.session_state.product_service = product_service
84
  st.session_state.target_audience = target_audience
85
  st.session_state.temperature = temperature
86
+ st.session_state.formula_type = formula_type
87
 
88
  st.button('Generar Oferta 🎉', on_click=generate_offer)
89
 
 
92
  # Check if form has been submitted
93
  if st.session_state.submitted:
94
  with st.spinner('Creando tu oferta perfecta...'):
95
+ prompt = f"""Based on the following information, create a compelling offer using the {st.session_state.formula_type} formula:
96
  Skills: {st.session_state.skills}
97
  Product/Service: {st.session_state.product_service}
98
  Target Audience: {st.session_state.target_audience if st.session_state.target_audience else 'General audience'}
99
 
100
+ Formula Description:
101
+ {offer_formulas[st.session_state.formula_type]["description"]}
102
+
103
  Please create a professional and engaging offer that highlights the value proposition
104
+ and appeals to the target audience. Include a clear call to action.
105
+ Use the formula structure provided above to craft the offer."""
106
 
107
  try:
108
  # Create generation config with temperature
 
112
  response = model.generate_content(prompt, generation_config=generation_config)
113
  st.session_state.offer_result = response.text
114
 
115
+ # Display result
116
  st.markdown('### 📝 Oferta Generada')
117
  st.markdown(st.session_state.offer_result)
118
 
formulas.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Fórmulas con ejemplos y explicaciones
2
+ # Change from bullet_formulas to offer_formulas
3
+ offer_formulas = {
4
+ "La Fórmula 3 en 1": {
5
+ "description": """
6
+ Formula: [Feature + Benefit + Meaning]
7
+
8
+ This formula creates an instant connection by linking three key elements:
9
+
10
+ 1. Feature: The main characteristic or aspect of your offer
11
+ 2. Benefit: What it allows the user to achieve or obtain
12
+ 3. Meaning: The deeper impact or transformation in their life
13
+
14
+ **Instructions for Creating Connection Bullets:**
15
+
16
+ 1. Identify Your Core Feature:
17
+ - What makes your offer unique?
18
+ - What's the main characteristic?
19
+ - What's the standout element?
20
+
21
+ 2. Transform into Benefits:
22
+ - How does this feature help them?
23
+ - What can they achieve with it?
24
+ - What becomes possible?
25
+
26
+ 3. Add Deeper Meaning:
27
+ - How does it transform their life?
28
+ - What's the emotional impact?
29
+ - What does it mean for their identity?
30
+
31
+ **Structure Formats:**
32
+
33
+ 1. "[Feature] para que puedas [Benefit] con lo que [Meaning]"
34
+ 2. "Con [Feature] podrás [Benefit] permitiéndote [Meaning]"
35
+ 3. "Gracias a [Feature] lograrás [Benefit] haciendo que [Meaning]"
36
+ 4. "Mediante [Feature] conseguirás [Benefit] lo que significa [Meaning]"
37
+ 5. "Usando [Feature] alcanzarás [Benefit] transformando [Meaning]"
38
+ """,
39
+ "examples": [
40
+ # Format 1: Feature + Benefit + Meaning
41
+ "El Sistema de meditación guiada para que puedas alcanzar la paz mental con lo que por fin dejarás de sentirte abrumado por el caos diario.",
42
+ "El Método de escritura veloz para que puedas crear contenido sin esfuerzo con lo que te convertirás en una máquina de generar ideas brillantes.",
43
+ "La Técnica de respiración ancestral para que puedas multiplicar tu energía con lo que te sentirás imparable desde que despiertas.",
44
+ # Format 2: With + Feature + Benefit + Meaning
45
+ "Con nuestro algoritmo de enfoque profundo podrás duplicar tu productividad permitiéndote disfrutar más tiempo con quienes amas.",
46
+ "Con el sistema de aprendizaje acelerado podrás dominar cualquier habilidad permitiéndote reinventar tu carrera cuando quieras.",
47
+ "Con la metodología de visualización cuántica podrás manifestar tus metas permitiéndote vivir la vida que siempre soñaste.",
48
+ # Format 3: Thanks to + Feature + Benefit + Meaning
49
+ "Gracias a nuestra tecnología de reprogramación mental lograrás superar tus miedos haciendo que te sientas invencible ante cualquier reto.",
50
+ "Gracias al protocolo de optimización del sueño lograrás descansar como un bebé haciendo que tu energía sea legendaria todo el día.",
51
+ "Gracias al sistema de gestión emocional lograrás mantener la calma en cualquier situación haciendo que los demás te vean como un líder nato.",
52
+ # Format 4: Through + Feature + Benefit + Meaning
53
+ "Mediante nuestro framework de creatividad conseguirás ideas brillantes lo que significa que nunca más te quedarás en blanco.",
54
+ "Mediante el método de networking estratégico conseguirás conexiones poderosas lo que significa que las oportunidades vendrán solas.",
55
+ "Mediante la técnica de storytelling magnético conseguirás cautivar a tu audiencia lo que significa que tu mensaje será inolvidable.",
56
+ # Format 5: Using + Feature + Benefit + Meaning
57
+ "Usando nuestro sistema de automatización mental alcanzarás el estado de flow transformando cada tarea en una experiencia placentera.",
58
+ "Usando el protocolo de productividad zen alcanzarás más con menos esfuerzo transformando tu relación con el trabajo para siempre.",
59
+ "Usando la metodología de impacto profundo alcanzarás el corazón de tu audiencia transformando seguidores en fans incondicionales."
60
+ ]
61
+ },
62
+ # Puedes añadir más fórmulas aquí
63
+ "Fórmula Problema-Solución": {
64
+ "description": """
65
+ Formula: [Problem + Solution + Result]
66
+
67
+ Esta fórmula conecta directamente con el dolor del cliente:
68
+
69
+ 1. Problem: El problema o dolor que enfrenta tu cliente
70
+ 2. Solution: La solución que ofreces
71
+ 3. Result: El resultado transformador que obtendrán
72
+
73
+ **Structure Formats:**
74
+ 1. "¿Cansado de [Problem]? Descubre [Solution] y logra [Result]"
75
+ 2. "Olvídate de [Problem] con [Solution] para conseguir [Result]"
76
+ 3. "Dile adiós a [Problem] gracias a [Solution] y disfruta de [Result]"
77
+ """,
78
+ "examples": [
79
+ "¿Cansado de perder tiempo con estrategias que no funcionan? Descubre nuestro sistema probado y logra resultados en la mitad del tiempo.",
80
+ "Olvídate de las dietas restrictivas con nuestro método de nutrición intuitiva para conseguir el cuerpo que deseas sin sacrificios.",
81
+ "Dile adiós al insomnio gracias a nuestra técnica de relajación profunda y disfruta de un descanso reparador cada noche."
82
+ ]
83
+ }
84
+ }