JeCabrera commited on
Commit
42f509e
·
verified ·
1 Parent(s): 8a1c1ff

Upload 8 files

Browse files
Files changed (8) hide show
  1. .gitattributes +35 -35
  2. README.md +191 -12
  3. app.py +325 -343
  4. manual.md +116 -116
  5. options.py +18 -0
  6. puv_formulas.py +226 -226
  7. requirements.txt +5 -10
  8. styles.py +265 -265
.gitattributes CHANGED
@@ -1,35 +1,35 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,12 +1,191 @@
1
- ---
2
- title: Creative Idea CopyXpert
3
- emoji: 🏆
4
- colorFrom: pink
5
- colorTo: green
6
- sdk: streamlit
7
- sdk_version: 1.43.2
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- short_description: Transform your business with creative value propositions.
12
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: PUV Generator 2G AI App
3
+ emoji: 🏆
4
+ colorFrom: pink
5
+ colorTo: green
6
+ sdk: streamlit
7
+ sdk_version: 1.42.2
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ short_description: Write unforgettable stories with IA power.
12
+ ---
13
+ **Bienvenid@ Copy Xpert**
14
+
15
+ Story Genius Maker está diseñada para ayudarte a tejer historias inolvidables en segundos, guiada por la magia de la inteligencia artificial que da vida a tus ideas en relatos cautivadores.
16
+
17
+ ### ¿Cómo utilizar Story Genius Maker?
18
+
19
+ Sigue estos pasos para sacar el máximo provecho de la herramienta:
20
+
21
+ ### 1. Configuración Básica
22
+
23
+ #### Historia Principal
24
+ - Escribe el tema o idea central de tu historia
25
+ - Sé específico y claro
26
+ - Ejemplo: "Mi transformación de vendedor tradicional a experto en ventas digitales"
27
+
28
+ #### Público Objetivo
29
+ - Define quién es tu audiencia ideal
30
+ - Incluye sus dolores, deseos y aspiraciones
31
+ - Ejemplos detallados:
32
+
33
+ + "Emprendedores digitales entre 30-45 años que luchan por conseguir clientes en LinkedIn"
34
+ + "Madres profesionales de 35-50 años buscando balance entre trabajo y familia"
35
+ + "Profesionales de marketing frustrados con el bajo engagement en redes sociales"
36
+ + "Coaches de vida que quieren destacar en un mercado saturado"
37
+ + "Dueños de pequeños negocios que buscan automatizar sus procesos"
38
+
39
+ #### Acción Deseada
40
+ - Especifica qué quieres que haga tu audiencia
41
+ - Sé claro y directo
42
+ - Ejemplos concretos:
43
+
44
+ - "Registrarse al webinar gratuito este jueves"
45
+ - "Descargar la guía PDF con 27 templates"
46
+ - "Agendar llamada de diagnóstico sin costo"
47
+ - "Aprovechar 50% de descuento - solo 48 horas"
48
+ - "Unirse al grupo privado de Facebook"
49
+
50
+ ### 2. Personalización de la Historia
51
+
52
+ #### Control de Longitud
53
+ - Corta: 100-115 palabras (ideal para posts y emails cortos)
54
+ - Media: 116-130 palabras (ideal para emails y landing pages)
55
+ - Larga: 131-150 palabras (ideal para historias detalladas)
56
+
57
+ Nota: La longitud está optimizada para mantener la atención del lector mientras se transmite el mensaje completo. Las historias más efectivas combinan impacto y detalle, manteniendo un equilibrio entre profundidad y engagement.
58
+
59
+ Recomendaciones por canal:
60
+
61
+ - LinkedIn/Facebook: 100-115 palabras
62
+ - Email marketing: 116-130 palabras
63
+ - Páginas de ventas: 131-150 palabras
64
+ - Landing pages: 100-115 palabras
65
+ - Historias detalladas: 131-150 palabras
66
+
67
+ #### Tono Emocional
68
+ - Inspirador: Eleva y motiva con historias de superación
69
+ - Empático: Conecta desde la comprensión y el entendimiento
70
+ - Profesional: Establece autoridad y credibilidad
71
+ - Humorístico: Entretiene mientras educa
72
+ - Desafiante: Provoca reflexión y acción
73
+ - Conversacional: Natural y cercano
74
+ - Nostálgico: Evoca recuerdos y emociones
75
+ - Urgente: Genera acción inmediata
76
+
77
+ ### 3. Fórmulas Disponibles
78
+
79
+ #### P.A.S.A. (Problema-Agitación-Solución-Acción)
80
+ Ideal para:
81
+ - Productos que resuelven dolores específicos
82
+ - Servicios de transformación personal
83
+ - Soluciones a problemas urgentes
84
+ - Ofertas de alto ticket
85
+ - Cuando el dolor es el principal motivador
86
+ - Ventas de servicios profesionales
87
+ - Productos de bienestar y salud
88
+
89
+ #### A.D.P. (Antes-Después-Puente)
90
+ Ideal para:
91
+ - Historias de transformación personal
92
+ - Testimonios de clientes
93
+ - Lanzamientos de productos
94
+ - Casos de estudio
95
+ - Servicios de coaching
96
+ - Programas de formación
97
+ - Productos de desarrollo personal
98
+
99
+ #### G.H.A. (Gancho-Historia-Acción)
100
+ Ideal para:
101
+ - Contenido viral en redes sociales
102
+ - Emails de nurturing
103
+ - Posts de blog
104
+ - Videos de YouTube
105
+ - Podcasts
106
+ - Webinars
107
+ - Presentaciones en vivo
108
+
109
+ ### Mejores Prácticas
110
+
111
+ #### Para Resultados Óptimos
112
+ 1. Sé específico con tu audiencia
113
+ - ❌ "Emprendedores que quieren vender más"
114
+ - ✅ "Emprendedores de e-commerce que facturan $5k-$10k mensuales y buscan escalar"
115
+
116
+ 2. Usa detalles sensoriales
117
+ - ❌ "Estaba frustrado con mis ventas"
118
+ - ✅ "Mis manos temblaban cada vez que revisaba el dashboard de ventas vacío"
119
+
120
+ 3. Mantén coherencia narrativa
121
+ - ❌ Saltar entre diferentes tiempos y perspectivas
122
+ - ✅ Mantener una línea temporal clara y una voz consistente
123
+
124
+ 4. Incluye elementos emocionales
125
+ - ❌ "Implementé la estrategia y funcionó"
126
+ - ✅ "Por fin pude dormir tranquilo, sabiendo que mi negocio estaba en crecimiento"
127
+
128
+ 5. Termina con CTA claro
129
+ - ❌ "Contáctanos para más información"
130
+ - ✅ "Reserva tu diagnóstico gratuito de 30 minutos - solo 5 espacios disponibles esta semana"
131
+
132
+ #### Evitar
133
+ 1. Historias genéricas
134
+ - ❌ "Un día decidí cambiar mi vida"
135
+ - ✅ "El 15 de marzo, mientras miraba mi cuenta bancaria con $127, tomé una decisión"
136
+
137
+ 2. Exceso de jerga técnica
138
+ - ❌ "Implementamos una estrategia de growth hacking con KPIs optimizados"
139
+ - ✅ "Creamos un sistema simple que duplicó nuestras ventas en 30 días"
140
+
141
+ 3. CTAs débiles o confusos
142
+ - ❌ "Piénsalo y decide"
143
+ - ✅ "Haz clic en el botón azul para reservar tu lugar - solo 3 espacios disponibles"
144
+
145
+ 4. Narrativas desconectadas
146
+ - ❌ Mezclar historias sin relación
147
+ - ✅ Mantener un hilo conductor claro
148
+
149
+ ### Solución de Problemas
150
+
151
+ #### Problemas Comunes
152
+ 1. **Historia poco engaging**
153
+ - Aumenta temperatura a 1.2-1.5
154
+ - Añade detalles específicos: "Mi primer webinar tuvo 2 asistentes, y uno era mi mamá"
155
+ - Incluye diálogo interno: "¿Realmente estoy hecho para esto?, me preguntaba cada noche"
156
+
157
+ 2. **CTA débil**
158
+ - Añade urgencia real: "Solo 5 espacios disponibles - 3 ya reservados"
159
+ - Especifica el siguiente paso: "Haz clic en el botón verde para agendar tu llamada"
160
+ - Refuerza el beneficio: "En 30 minutos, diseñaremos tu plan personalizado de ventas"
161
+
162
+ 3. **Narrativa dispersa**
163
+ - Usa una estructura clara: Situación → Complicación → Resolución
164
+ - Mantén un solo tema central: "Mi viaje de $0 a $10k mensuales"
165
+ - Conecta cada párrafo con el siguiente
166
+
167
+ ### Consejos Avanzados
168
+
169
+ 1. **Optimización de Historias**
170
+ - Prueba P.A.S.A. para productos que resuelven dolores claros
171
+ - Usa A.D.P. para servicios de transformación
172
+ - Aplica G.H.A. para contenido en redes sociales
173
+
174
+ 2. **Personalización Avanzada**
175
+ - Incluye jerga de tu industria: "De 0 leads a pipeline lleno"
176
+ - Usa metáforas relevantes: "Tu LinkedIn es como un vendedor 24/7"
177
+ - Adapta el tono según la red social
178
+
179
+ 3. **Testing y Mejora**
180
+ - A/B testing con diferentes ganchos
181
+ - Mide engagement por tipo de historia
182
+ - Analiza qué CTAs generan más conversiones
183
+
184
+ ## ¿Por qué las Historias son Importantes?
185
+
186
+ Las historias son el vehículo más poderoso para:
187
+ - Conectar emocionalmente: "Me sentí exactamente igual hace un año"
188
+ - Demostrar transformación: "De consultor frustrado a mentor buscado"
189
+ - Inspirar acción: "Si yo pude, tú también puedes"
190
+ - Construir confianza: A través de vulnerabilidad y autenticidad
191
+ - Memorabilidad del mensaje: Las historias se recuerdan 22 veces más que los hechos
app.py CHANGED
@@ -1,344 +1,326 @@
1
- from dotenv import load_dotenv
2
- import streamlit as st
3
- import os
4
- import google.generativeai as genai
5
- from puv_formulas import puv_formulas
6
- from styles import apply_styles
7
- import PyPDF2
8
- import docx
9
- from PIL import Image
10
- import datetime # Add this import for timestamp
11
-
12
- # Cargar variables de entorno
13
- load_dotenv()
14
-
15
- # Configurar API de Google Gemini
16
- genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
17
-
18
- # Función para obtener la respuesta del modelo Gemini
19
- def get_gemini_response(product_service, target_audience, main_benefit, tone_of_voice, temperature,
20
- file_content="", image_parts=None, creative_approach=""):
21
- # Check if we have at least one source of information
22
- has_file_content = bool(file_content.strip())
23
- has_image = image_parts is not None
24
- has_text_input = target_audience or product_service or main_benefit
25
-
26
- if not (has_file_content or has_image or has_text_input):
27
- return "Debes proporcionar al menos un tipo de información: público objetivo, producto/servicio, beneficio principal o un archivo de referencia."
28
-
29
- # If we only have file content but no other inputs, we can proceed
30
- if (has_file_content or has_image) and not has_text_input:
31
- # File-only mode
32
- business_info = "Analyze the provided reference material to extract business information.\n"
33
- else:
34
- # Regular mode with validation
35
- if not target_audience:
36
- return "El campo de público objetivo es obligatorio cuando no se proporciona un archivo de referencia completo."
37
-
38
- if not product_service:
39
- return "Debes proporcionar tu producto/servicio cuando no se proporciona un archivo de referencia completo."
40
-
41
- if not main_benefit:
42
- return "Debes proporcionar el beneficio principal cuando no se proporciona un archivo de referencia completo."
43
-
44
- # Adjust prompt based on what's provided
45
- business_info = f"Target Audience: {target_audience}\n"
46
- business_info += f"Product/Service: {product_service}\n"
47
- business_info += f"Main Benefit: {main_benefit}\n"
48
-
49
- if tone_of_voice:
50
- business_info += f"Brand Tone of Voice: {tone_of_voice}\n"
51
-
52
- # Add file content if available
53
- reference_info = ""
54
- if file_content:
55
- reference_info = f"\nREFERENCE MATERIAL:\n{file_content}\n"
56
-
57
- model = genai.GenerativeModel('gemini-2.0-flash')
58
- full_prompt = f"""
59
- You are a Creative Concept expert. Analyze (internally only, do not output the analysis) the following information:
60
- BUSINESS INFORMATION:
61
- {business_info}
62
- {reference_info}
63
-
64
- A Creative Idea is a set of pieces created to sell a brand, product, or service, united by the same idea that is transmitted through a creative concept.
65
-
66
- First, analyze (but don't output) these points:
67
- 1. TARGET AUDIENCE ANALYSIS:
68
- - What everyday concepts are they familiar with?
69
- - What TV shows, movies, or cultural references resonate with them?
70
- - What emotions and experiences are meaningful to them?
71
- - What mental images would be easy for them to recall?
72
-
73
- 2. PRODUCT/SERVICE ANALYSIS:
74
- - What is the main benefit or promise?
75
- - What makes it unique or different?
76
- - What transformation does it offer?
77
- - What process or journey does the customer go through?
78
-
79
- Based on your internal analysis, create THREE different Creative Concepts in Spanish language.
80
- Each concept should be a DIRECT ANALOGY or METAPHOR that connects your product/service to something completely different but familiar.
81
-
82
- Examples of good creative concepts:
83
- - "Escribir copy es como cocinar tu plato favorito porque necesitas los ingredientes correctos para que todos quieran probarlo"
84
- - "Tu negocio es como un equipo de fútbol: necesita buenos jugadores (productos) y una estrategia clara para ganar clientes"
85
- - "Tu curso es como Netflix: ofrece contenido que engancha y soluciones que la gente realmente quiere ver"
86
-
87
- For each concept, include:
88
-
89
- CONCEPT: A clear statement of the main benefit
90
- CREATIVITY: A direct analogy or metaphor connecting your product to something completely different but familiar
91
-
92
- CRITICAL INSTRUCTIONS:
93
- - Each concept MUST use a direct "X es como Y porque Z" structure
94
- - Use SIMPLE, EVERYDAY language that anyone can understand
95
- - Avoid technical jargon, complex words, or business terminology
96
- - Write as if you're explaining to a friend in a casual conversation
97
- - Use everyday objects, activities, movies, TV shows or cultural references everyone knows
98
- - Make the connection SURPRISING and UNEXPECTED - connect things that normally wouldn't be connected
99
- - Challenge conventional thinking by finding parallels between your product and something completely different
100
- - Create analogies that make people say "I never thought of it that way!"
101
- - Focus on the main benefit
102
- - Create clear mental images
103
- - Be easy to remember
104
- - Use the brand's tone of voice if provided
105
- - Format with proper spacing between sections
106
-
107
- Output EXACTLY in this format (no additional text) in Spanish language:
108
-
109
- CONCEPTO CREATIVO 1:
110
-
111
- Concepto:
112
- [Main message/benefit in simple, conversational language]
113
-
114
- Creatividad:
115
- [Direct analogy using everyday language: "X es como Y porque Z"]
116
-
117
-
118
- CONCEPTO CREATIVO 2:
119
-
120
- Concepto:
121
- [Main message/benefit]
122
-
123
- Creatividad:
124
- [Direct analogy: "X es como Y porque Z"]
125
-
126
-
127
- CONCEPTO CREATIVO 3:
128
-
129
- Concepto:
130
- [Main message/benefit]
131
-
132
- Creatividad:
133
- [Direct analogy: "X es como Y porque Z"]
134
- """
135
-
136
- # Handle text-only or text+image requests
137
- if image_parts:
138
- response = model.generate_content([full_prompt, image_parts], generation_config={"temperature": temperature})
139
- else:
140
- response = model.generate_content([full_prompt], generation_config={"temperature": temperature})
141
-
142
- return response.parts[0].text if response and response.parts else "Error generating content."
143
-
144
- # Configurar la aplicación Streamlit
145
- st.set_page_config(page_title="Generador de Ideas Creativas", page_icon="💡", layout="wide")
146
-
147
- # Aplicar estilos
148
- st.markdown(apply_styles(), unsafe_allow_html=True)
149
-
150
- # Título de la app
151
- st.markdown("<h1>Generador de Ideas Creativas</h1>", unsafe_allow_html=True)
152
- st.markdown("<h3>Crea conceptos creativos poderosos que conecten con tu audiencia y transmitan el valor de tu marca de manera memorable.</h3>", unsafe_allow_html=True)
153
-
154
- # Sidebar manual
155
- with open("manual.md", "r", encoding="utf-8") as file:
156
- manual_content = file.read()
157
- st.sidebar.markdown(manual_content)
158
-
159
- # Crear dos columnas
160
- col1, col2 = st.columns([1, 1])
161
-
162
- # Columna izquierda para inputs
163
- # In the app.py file, update the main_benefit field label and create an accordion for tone options
164
- with col1:
165
- product_service = st.text_area(
166
- "¿Cuál es tu producto o servicio?",
167
- placeholder="Ejemplo: Curso de copywriting con IA, Programa de coaching..."
168
- )
169
-
170
- main_benefit = st.text_area(
171
- "¿Cuál es tu Oferta Dorada/PUV?",
172
- placeholder="Ejemplo: Aprender copywriting a través de transformaciones reales de textos..."
173
- )
174
-
175
- target_audience = st.text_area(
176
- "¿Cuál es tu público objetivo?",
177
- placeholder="Ejemplo: Emprendedores que quieren mejorar sus textos comerciales..."
178
- )
179
-
180
- # Generate button after main inputs
181
- generate_button = st.button("Generar Ideas Creativas")
182
-
183
- with st.expander("Opciones avanzadas"):
184
- # Replace nested expanders with a selectbox for tone selection
185
- st.write("Tono de voz de la marca (opcional)")
186
- tone_options = {
187
- "Ninguno": "Sin tono específico",
188
- "Profesional": "A formal and expert tone that conveys authority and knowledge.",
189
- "Serio": "A direct and sober tone, focused on facts and results.",
190
- "Divertido": "A cheerful and positive tone that connects in a friendly way.",
191
- "Sarcástico": "A witty tone with a touch of irony that surprises.",
192
- "Humorístico": "A tone that uses humor to connect and entertain."
193
- }
194
-
195
- # Use selectbox for tone selection
196
- selected_tone = st.selectbox(
197
- "Selecciona un tono:",
198
- options=list(tone_options.keys()),
199
- index=0,
200
- key="tone_selectbox"
201
- )
202
-
203
- # Display the description of the selected tone
204
- if selected_tone != "Ninguno":
205
- st.info(tone_options[selected_tone])
206
- # Store the selected tone
207
- st.session_state.selected_tone = selected_tone
208
- else:
209
- # Clear any previously selected tone
210
- if "selected_tone" in st.session_state:
211
- del st.session_state.selected_tone
212
-
213
- # Use the stored tone or empty string
214
- tone_of_voice = st.session_state.get("selected_tone", "")
215
-
216
- # Añadir cargador de archivos
217
- uploaded_file = st.file_uploader("📄 Archivo o imagen de referencia",
218
- type=['txt', 'pdf', 'docx', 'jpg', 'jpeg', 'png'])
219
-
220
- file_content = ""
221
- is_image = False
222
- image_parts = None
223
-
224
- if uploaded_file is not None:
225
- file_type = uploaded_file.name.split('.')[-1].lower()
226
-
227
- # Manejar archivos de texto
228
- if file_type in ['txt', 'pdf', 'docx']:
229
- if file_type == 'txt':
230
- try:
231
- file_content = uploaded_file.read().decode('utf-8')
232
- except Exception as e:
233
- st.error(f"Error al leer el archivo TXT: {str(e)}")
234
- file_content = ""
235
-
236
- elif file_type == 'pdf':
237
- try:
238
- pdf_reader = PyPDF2.PdfReader(uploaded_file)
239
- file_content = ""
240
- for page in pdf_reader.pages:
241
- file_content += page.extract_text() + "\n"
242
- except Exception as e:
243
- st.error(f"Error al leer el archivo PDF: {str(e)}")
244
- file_content = ""
245
-
246
- elif file_type == 'docx':
247
- try:
248
- doc = docx.Document(uploaded_file)
249
- file_content = "\n".join([para.text for para in doc.paragraphs])
250
- except Exception as e:
251
- st.error(f"Error al leer el archivo DOCX: {str(e)}")
252
- file_content = ""
253
-
254
- # Manejar archivos de imagen
255
- elif file_type in ['jpg', 'jpeg', 'png']:
256
- try:
257
- image = Image.open(uploaded_file)
258
- image_bytes = uploaded_file.getvalue()
259
- image_parts = {
260
- "mime_type": uploaded_file.type,
261
- "data": image_bytes
262
- }
263
- is_image = True
264
- except Exception as e:
265
- st.error(f"Error al procesar la imagen: {str(e)}")
266
- is_image = False
267
-
268
-
269
- # Add creative approach selector (moved outside nested expander)
270
- creative_approaches = {
271
- "Analogías Cotidianas": "Usa objetos y situaciones del día a día para explicar tu producto",
272
- "Contrastes Extremos": "Compara tu producto con algo completamente opuesto para destacar beneficios",
273
- "Mundos Ficticios": "Usa referencias de películas, series o libros populares",
274
- "Absurdo Lógico": "Crea conexiones inesperadas pero que tienen sentido al explicarlas",
275
- "Inversión de Roles": "Presenta tu producto como si fuera el cliente, o el problema como la solución"
276
- }
277
-
278
- selected_approach = st.selectbox(
279
- "Enfoque creativo:",
280
- options=list(creative_approaches.keys()),
281
- index=0,
282
- key="approach_selectbox"
283
- )
284
-
285
- # Display the description of the selected approach
286
- st.info(creative_approaches[selected_approach])
287
-
288
- # Store the selected approach
289
- st.session_state.selected_approach = selected_approach
290
-
291
- # Temperature slider
292
- temperature = st.slider(
293
- "Nivel de creatividad:",
294
- min_value=0.0,
295
- max_value=2.0,
296
- value=1.0,
297
- step=0.1,
298
- help="Valores más altos generan ideas más creativas pero menos predecibles."
299
- )
300
-
301
- # Import the format_creative_response function
302
- from styles import apply_styles, format_creative_response
303
-
304
- with col2:
305
- if generate_button:
306
- # Store the response in session state so it persists across reruns
307
- with st.spinner("Creando tus ideas creativas..."):
308
- st.session_state.creative_response = get_gemini_response(
309
- product_service,
310
- target_audience,
311
- main_benefit,
312
- tone_of_voice,
313
- temperature,
314
- file_content,
315
- image_parts,
316
- st.session_state.get("selected_approach", "")
317
- # Removed contrast_level parameter
318
- )
319
-
320
- # Display the response if it exists in session state
321
- if 'creative_response' in st.session_state:
322
- st.write("### Conceptos Creativos")
323
-
324
- # Format the response with custom styling
325
- formatted_response = format_creative_response(st.session_state.creative_response)
326
-
327
- # Use markdown with HTML to display the formatted response
328
- st.markdown(formatted_response, unsafe_allow_html=True)
329
-
330
- # Add download button if we have a valid response
331
- if st.session_state.creative_response and not st.session_state.creative_response.startswith("Error") and not st.session_state.creative_response.startswith("Debes"):
332
- # Get current timestamp for the filename
333
- timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
334
-
335
- # Prepare content for download (use the original unformatted response)
336
- download_content = st.session_state.creative_response
337
-
338
- # Download button
339
- st.download_button(
340
- label="DESCARGAR IDEAS CREATIVAS",
341
- data=download_content,
342
- file_name=f"conceptos_creativos_{timestamp}.txt",
343
- mime="text/plain"
344
  )
 
1
+ from dotenv import load_dotenv
2
+ import streamlit as st
3
+ import os
4
+ import google.generativeai as genai
5
+ from puv_formulas import puv_formulas
6
+ from styles import apply_styles, format_creative_response
7
+ from options import tone_options, creative_approaches
8
+ import PyPDF2
9
+ import docx
10
+ from PIL import Image
11
+ import datetime # Add this import for timestamp
12
+
13
+ # Cargar variables de entorno
14
+ load_dotenv()
15
+
16
+ # Configurar API de Google Gemini
17
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
18
+
19
+ # Función para obtener la respuesta del modelo Gemini
20
+ def get_gemini_response(product_service, target_audience, main_benefit, tone_of_voice, temperature,
21
+ file_content="", image_parts=None, creative_approach=""):
22
+ # Check if we have at least one source of information
23
+ has_file_content = bool(file_content.strip())
24
+ has_image = image_parts is not None
25
+ has_text_input = target_audience or product_service or main_benefit
26
+
27
+ if not (has_file_content or has_image or has_text_input):
28
+ return "Debes proporcionar al menos un tipo de información: público objetivo, producto/servicio, beneficio principal o un archivo de referencia."
29
+
30
+ # If we only have file content but no other inputs, we can proceed
31
+ if (has_file_content or has_image) and not has_text_input:
32
+ # File-only mode
33
+ business_info = "Analyze the provided reference material to extract business information.\n"
34
+ else:
35
+ # Regular mode with validation
36
+ if not target_audience:
37
+ return "El campo de público objetivo es obligatorio cuando no se proporciona un archivo de referencia completo."
38
+
39
+ if not product_service:
40
+ return "Debes proporcionar tu producto/servicio cuando no se proporciona un archivo de referencia completo."
41
+
42
+ if not main_benefit:
43
+ return "Debes proporcionar el beneficio principal cuando no se proporciona un archivo de referencia completo."
44
+
45
+ # Adjust prompt based on what's provided
46
+ business_info = f"Target Audience: {target_audience}\n"
47
+ business_info += f"Product/Service: {product_service}\n"
48
+ business_info += f"Main Benefit: {main_benefit}\n"
49
+
50
+ if tone_of_voice:
51
+ business_info += f"Brand Tone of Voice: {tone_of_voice}\n"
52
+
53
+ # Add file content if available
54
+ reference_info = ""
55
+ if file_content:
56
+ reference_info = f"\nREFERENCE MATERIAL:\n{file_content}\n"
57
+
58
+ model = genai.GenerativeModel('gemini-2.0-flash')
59
+ full_prompt = f"""
60
+ You are a Creative Concept expert. Analyze (internally only, do not output the analysis) the following information:
61
+ BUSINESS INFORMATION:
62
+ {business_info}
63
+ {reference_info}
64
+
65
+ A Creative Idea is a set of pieces created to sell a brand, product, or service, united by the same idea that is transmitted through a creative concept.
66
+
67
+ First, analyze (but don't output) these points:
68
+ 1. TARGET AUDIENCE ANALYSIS:
69
+ - What everyday concepts are they familiar with?
70
+ - What TV shows, movies, or cultural references resonate with them?
71
+ - What emotions and experiences are meaningful to them?
72
+ - What mental images would be easy for them to recall?
73
+
74
+ 2. PRODUCT/SERVICE ANALYSIS:
75
+ - What is the main benefit or promise?
76
+ - What makes it unique or different?
77
+ - What transformation does it offer?
78
+ - What process or journey does the customer go through?
79
+
80
+ Based on your internal analysis, create THREE different Creative Concepts in Spanish language.
81
+ Each concept should be a DIRECT ANALOGY or METAPHOR that connects your product/service to something completely different but familiar.
82
+
83
+ Examples of good creative concepts:
84
+ - "Escribir copy es como cocinar tu plato favorito porque necesitas los ingredientes correctos para que todos quieran probarlo"
85
+ - "Tu negocio es como un equipo de fútbol: necesita buenos jugadores (productos) y una estrategia clara para ganar clientes"
86
+ - "Tu curso es como Netflix: ofrece contenido que engancha y soluciones que la gente realmente quiere ver"
87
+
88
+ For each concept, include:
89
+
90
+ CONCEPT: A clear statement of the main benefit
91
+ CREATIVITY: A direct analogy or metaphor connecting your product to something completely different but familiar
92
+
93
+ CRITICAL INSTRUCTIONS:
94
+ - Each concept MUST use a direct "X es como Y porque Z" structure
95
+ - Use SIMPLE, EVERYDAY language that anyone can understand
96
+ - Avoid technical jargon, complex words, or business terminology
97
+ - Write as if you're explaining to a friend in a casual conversation
98
+ - Use everyday objects, activities, movies, TV shows or cultural references everyone knows
99
+ - Make the connection SURPRISING and UNEXPECTED - connect things that normally wouldn't be connected
100
+ - Challenge conventional thinking by finding parallels between your product and something completely different
101
+ - Create analogies that make people say "I never thought of it that way!"
102
+ - Focus on the main benefit
103
+ - Create clear mental images
104
+ - Be easy to remember
105
+ - Use the brand's tone of voice if provided
106
+ - Format with proper spacing between sections
107
+
108
+ Output EXACTLY in this format (no additional text) in Spanish language:
109
+
110
+ CONCEPTO CREATIVO 1:
111
+
112
+ Concepto:
113
+ [Main message/benefit in simple, conversational language]
114
+
115
+ Creatividad:
116
+ [Direct analogy using everyday language: "X es como Y porque Z"]
117
+
118
+
119
+ CONCEPTO CREATIVO 2:
120
+
121
+ Concepto:
122
+ [Main message/benefit]
123
+
124
+ Creatividad:
125
+ [Direct analogy: "X es como Y porque Z"]
126
+
127
+
128
+ CONCEPTO CREATIVO 3:
129
+
130
+ Concepto:
131
+ [Main message/benefit]
132
+
133
+ Creatividad:
134
+ [Direct analogy: "X es como Y porque Z"]
135
+ """
136
+
137
+ # Handle text-only or text+image requests
138
+ if image_parts:
139
+ response = model.generate_content([full_prompt, image_parts], generation_config={"temperature": temperature})
140
+ else:
141
+ response = model.generate_content([full_prompt], generation_config={"temperature": temperature})
142
+
143
+ return response.parts[0].text if response and response.parts else "Error generating content."
144
+
145
+ # Configurar la aplicación Streamlit
146
+ st.set_page_config(page_title="Generador de Ideas Creativas", page_icon="💡", layout="wide")
147
+
148
+ # Aplicar estilos
149
+ st.markdown(apply_styles(), unsafe_allow_html=True)
150
+
151
+ # Título de la app
152
+ st.markdown("<h1>Generador de Ideas Creativas</h1>", unsafe_allow_html=True)
153
+ st.markdown("<h3>Crea conceptos creativos poderosos que conecten con tu audiencia y transmitan el valor de tu marca de manera memorable.</h3>", unsafe_allow_html=True)
154
+
155
+ # Sidebar manual
156
+ with open("manual.md", "r", encoding="utf-8") as file:
157
+ manual_content = file.read()
158
+ st.sidebar.markdown(manual_content)
159
+
160
+ # Crear dos columnas
161
+ col1, col2 = st.columns([1, 1])
162
+
163
+ # Columna izquierda para inputs
164
+ # In the app.py file, update the main_benefit field label and create an accordion for tone options
165
+ with col1:
166
+ product_service = st.text_area(
167
+ "¿Cuál es tu producto o servicio?",
168
+ placeholder="Ejemplo: Curso de copywriting con IA, Programa de coaching..."
169
+ )
170
+
171
+ main_benefit = st.text_area(
172
+ "¿Cuál es tu Oferta Dorada/PUV?",
173
+ placeholder="Ejemplo: Aprender copywriting a través de transformaciones reales de textos..."
174
+ )
175
+
176
+ target_audience = st.text_area(
177
+ "¿Cuál es tu público objetivo?",
178
+ placeholder="Ejemplo: Emprendedores que quieren mejorar sus textos comerciales..."
179
+ )
180
+
181
+ # Generate button after main inputs
182
+ generate_button = st.button("Generar Ideas Creativas")
183
+
184
+ with st.expander("Opciones avanzadas"):
185
+ # Replace nested expanders with a selectbox for tone selection
186
+ st.write("Tono de voz de la marca (opcional)")
187
+
188
+ # Use selectbox for tone selection
189
+ selected_tone = st.selectbox(
190
+ "Selecciona un tono:",
191
+ options=list(tone_options.keys()),
192
+ index=0,
193
+ key="tone_selectbox"
194
+ )
195
+
196
+ # Display the description of the selected tone
197
+ if selected_tone != "Ninguno":
198
+ st.info(tone_options[selected_tone])
199
+ # Store the selected tone
200
+ st.session_state.selected_tone = selected_tone
201
+ else:
202
+ # Clear any previously selected tone
203
+ if "selected_tone" in st.session_state:
204
+ del st.session_state.selected_tone
205
+
206
+ # Use the stored tone or empty string
207
+ tone_of_voice = st.session_state.get("selected_tone", "")
208
+
209
+ # Añadir cargador de archivos
210
+ uploaded_file = st.file_uploader("📄 Archivo o imagen de referencia",
211
+ type=['txt', 'pdf', 'docx', 'jpg', 'jpeg', 'png'])
212
+
213
+ file_content = ""
214
+ is_image = False
215
+ image_parts = None
216
+
217
+ if uploaded_file is not None:
218
+ file_type = uploaded_file.name.split('.')[-1].lower()
219
+
220
+ # Manejar archivos de texto
221
+ if file_type in ['txt', 'pdf', 'docx']:
222
+ if file_type == 'txt':
223
+ try:
224
+ file_content = uploaded_file.read().decode('utf-8')
225
+ except Exception as e:
226
+ st.error(f"Error al leer el archivo TXT: {str(e)}")
227
+ file_content = ""
228
+
229
+ elif file_type == 'pdf':
230
+ try:
231
+ pdf_reader = PyPDF2.PdfReader(uploaded_file)
232
+ file_content = ""
233
+ for page in pdf_reader.pages:
234
+ file_content += page.extract_text() + "\n"
235
+ except Exception as e:
236
+ st.error(f"Error al leer el archivo PDF: {str(e)}")
237
+ file_content = ""
238
+
239
+ elif file_type == 'docx':
240
+ try:
241
+ doc = docx.Document(uploaded_file)
242
+ file_content = "\n".join([para.text for para in doc.paragraphs])
243
+ except Exception as e:
244
+ st.error(f"Error al leer el archivo DOCX: {str(e)}")
245
+ file_content = ""
246
+
247
+ # Manejar archivos de imagen
248
+ elif file_type in ['jpg', 'jpeg', 'png']:
249
+ try:
250
+ image = Image.open(uploaded_file)
251
+ image_bytes = uploaded_file.getvalue()
252
+ image_parts = {
253
+ "mime_type": uploaded_file.type,
254
+ "data": image_bytes
255
+ }
256
+ is_image = True
257
+ except Exception as e:
258
+ st.error(f"Error al procesar la imagen: {str(e)}")
259
+ is_image = False
260
+
261
+
262
+ # Add creative approach selector (moved outside nested expander)
263
+ selected_approach = st.selectbox(
264
+ "Enfoque creativo:",
265
+ options=list(creative_approaches.keys()),
266
+ index=0,
267
+ key="approach_selectbox"
268
+ )
269
+
270
+ # Display the description of the selected approach
271
+ st.info(creative_approaches[selected_approach])
272
+
273
+ # Store the selected approach
274
+ st.session_state.selected_approach = selected_approach
275
+
276
+ # Temperature slider
277
+ temperature = st.slider(
278
+ "Nivel de creatividad:",
279
+ min_value=0.0,
280
+ max_value=2.0,
281
+ value=1.0,
282
+ step=0.1,
283
+ help="Valores más altos generan ideas más creativas pero menos predecibles."
284
+ )
285
+
286
+ with col2:
287
+ if generate_button:
288
+ # Store the response in session state so it persists across reruns
289
+ with st.spinner("Creando tus ideas creativas..."):
290
+ st.session_state.creative_response = get_gemini_response(
291
+ product_service,
292
+ target_audience,
293
+ main_benefit,
294
+ tone_of_voice,
295
+ temperature,
296
+ file_content,
297
+ image_parts,
298
+ st.session_state.get("selected_approach", "")
299
+ # Removed contrast_level parameter
300
+ )
301
+
302
+ # Display the response if it exists in session state
303
+ if 'creative_response' in st.session_state:
304
+ st.write("### Conceptos Creativos")
305
+
306
+ # Format the response with custom styling
307
+ formatted_response = format_creative_response(st.session_state.creative_response)
308
+
309
+ # Use markdown with HTML to display the formatted response
310
+ st.markdown(formatted_response, unsafe_allow_html=True)
311
+
312
+ # Add download button if we have a valid response
313
+ if st.session_state.creative_response and not st.session_state.creative_response.startswith("Error") and not st.session_state.creative_response.startswith("Debes"):
314
+ # Get current timestamp for the filename
315
+ timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
316
+
317
+ # Prepare content for download (use the original unformatted response)
318
+ download_content = st.session_state.creative_response
319
+
320
+ # Download button
321
+ st.download_button(
322
+ label="DESCARGAR IDEAS CREATIVAS",
323
+ data=download_content,
324
+ file_name=f"conceptos_creativos_{timestamp}.txt",
325
+ mime="text/plain"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  )
manual.md CHANGED
@@ -1,117 +1,117 @@
1
- **Bienvenid@ Copy Xpert**
2
-
3
- Crea Propuestas Únicas de Valor (PUV) persuasivas que conecten con tus clientes ideales y comuniquen efectivamente tu valor en el mercado.
4
-
5
- ### ¿Cómo usar el Generador de PUV?
6
-
7
- Sigue estos pasos para aprovechar al máximo la herramienta:
8
-
9
- ### 1. Configuración Básica
10
-
11
- #### Producto/Servicio
12
- - Describe tu solución claramente
13
- - Enfócate en los beneficios principales
14
- - Ejemplos específicos:
15
-
16
- - "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días"
17
- - "Software de Automatización para Pequeños Negocios"
18
- - "Programa de Coaching Transformacional de 12 Semanas"
19
- - "Agencia de Marketing Digital Especializada en E-commerce"
20
- - "Plataforma de Cursos Online para Creadores"
21
-
22
- #### Público Objetivo
23
- - Define quién es tu cliente ideal
24
- - Incluye sus dolores, deseos y aspiraciones
25
- - Ejemplos detallados:
26
-
27
- - "Emprendedores digitales entre 30-45 años que luchan por conseguir clientes en LinkedIn"
28
- - "Coaches profesionales que quieren destacar en un mercado saturado"
29
- - "Dueños de pequeños negocios que buscan automatizar sus procesos"
30
- - "Dueños de tiendas online con ingresos de $10k-50k mensuales"
31
- - "Creadores de contenido que luchan por monetizar su audiencia"
32
-
33
- ### 2. Fórmulas Disponibles
34
-
35
- #### Fórmula Tradicional
36
- Ideal para:
37
- - Comunicación clara y directa
38
- - Servicios profesionales tradicionales
39
- - Cuando necesitas un enfoque directo y estructurado
40
- - Mercados que valoran la claridad
41
- - Servicios B2B establecidos
42
-
43
- #### Fórmula Anti-tradicional
44
- Ideal para:
45
- - Servicios innovadores
46
- - Cuando buscas diferenciarte
47
- - Mercados competitivos
48
- - Propuestas disruptivas
49
- - Transformaciones profundas
50
-
51
- #### Contrato Imposible
52
- Ideal para:
53
- - Ofertas disruptivas
54
- - Soluciones innovadoras
55
- - Desafiar las normas de la industria
56
- - Productos/servicios de alto ticket
57
- - Cuando quieres destacar
58
-
59
- #### Reto Ridículo
60
- Ideal para:
61
- - Simplificar soluciones complejas
62
- - Romper barreras con humor
63
- - Abordar frustraciones comunes
64
- - Cuando quieres mostrar facilidad de uso
65
- - Convertir escépticos con historias
66
-
67
- ### 3. Mejores Prácticas
68
-
69
- #### Para Resultados Óptimos
70
- 1. Sé específico con tu público objetivo
71
- - ❌ "Emprendedores que quieren vender más"
72
- - ✅ "Emprendedores de e-commerce que facturan $5k-$10k mensuales y buscan escalar"
73
-
74
- 2. Enfócate en la transformación
75
- - ❌ "Un buen curso de marketing"
76
- - ✅ "Un sistema probado que convierte coaches frustrados en expertos con agenda llena"
77
-
78
- 3. Usa resultados medibles
79
- - ❌ "Mejora tu negocio"
80
- - ✅ "Duplica tu base de clientes en 90 días"
81
-
82
- 4. Incluye diferenciadores
83
- - ❌ "Ayudo a negocios a crecer"
84
- - ✅ "Ayudo a proveedores de servicios a triplicar sus precios sin perder clientes"
85
-
86
- #### Evitar
87
- 1. Declaraciones genéricas
88
- - ❌ "El mejor servicio del mercado"
89
- - ✅ "La única estrategia de LinkedIn que garantiza 50 leads mensuales"
90
-
91
- 2. Jerga técnica
92
- - ❌ "Implementando modelos de atribución multicanal"
93
- - ✅ "Por fin sabrás exactamente de dónde vienen tus mejores clientes"
94
-
95
- 3. Promesas vagas
96
- - ❌ "Obtén mejores resultados"
97
- - ✅ "Genera tus primeros $10k mensuales en 90 días"
98
-
99
- ### Consejos Avanzados
100
-
101
- 1. **Ajuste del Nivel de Creatividad**
102
- - Bajo (0.0-0.7): Resultados más conservadores y consistentes
103
- - Medio (0.8-1.2): Balance entre creatividad y confiabilidad
104
- - Alto (1.3-2.0): Ángulos más innovadores e inesperados
105
-
106
- 2. **Selección de Fórmula**
107
- - Fórmula Tradicional: Para comunicación clara y directa
108
- - Fórmula Anti-tradicional: Para un enfoque más creativo y personal
109
- - Contrato Imposible: Para disrumpir el mercado
110
- - Reto Ridículo: Para conectar con humor y autenticidad
111
-
112
- 3. **Pruebas y Mejora**
113
- - Prueba diferentes fórmulas para la misma oferta
114
- - Experimenta con varios niveles de creatividad
115
- - Mantén lo que resuena con tu audiencia
116
-
117
  Recuerda: Una gran PUV debe hacer que tu cliente ideal piense, "¡Esto es exactamente lo que estaba buscando!"
 
1
+ **Bienvenid@ Copy Xpert**
2
+
3
+ Crea Propuestas Únicas de Valor (PUV) persuasivas que conecten con tus clientes ideales y comuniquen efectivamente tu valor en el mercado.
4
+
5
+ ### ¿Cómo usar el Generador de PUV?
6
+
7
+ Sigue estos pasos para aprovechar al máximo la herramienta:
8
+
9
+ ### 1. Configuración Básica
10
+
11
+ #### Producto/Servicio
12
+ - Describe tu solución claramente
13
+ - Enfócate en los beneficios principales
14
+ - Ejemplos específicos:
15
+
16
+ - "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días"
17
+ - "Software de Automatización para Pequeños Negocios"
18
+ - "Programa de Coaching Transformacional de 12 Semanas"
19
+ - "Agencia de Marketing Digital Especializada en E-commerce"
20
+ - "Plataforma de Cursos Online para Creadores"
21
+
22
+ #### Público Objetivo
23
+ - Define quién es tu cliente ideal
24
+ - Incluye sus dolores, deseos y aspiraciones
25
+ - Ejemplos detallados:
26
+
27
+ - "Emprendedores digitales entre 30-45 años que luchan por conseguir clientes en LinkedIn"
28
+ - "Coaches profesionales que quieren destacar en un mercado saturado"
29
+ - "Dueños de pequeños negocios que buscan automatizar sus procesos"
30
+ - "Dueños de tiendas online con ingresos de $10k-50k mensuales"
31
+ - "Creadores de contenido que luchan por monetizar su audiencia"
32
+
33
+ ### 2. Fórmulas Disponibles
34
+
35
+ #### Fórmula Tradicional
36
+ Ideal para:
37
+ - Comunicación clara y directa
38
+ - Servicios profesionales tradicionales
39
+ - Cuando necesitas un enfoque directo y estructurado
40
+ - Mercados que valoran la claridad
41
+ - Servicios B2B establecidos
42
+
43
+ #### Fórmula Anti-tradicional
44
+ Ideal para:
45
+ - Servicios innovadores
46
+ - Cuando buscas diferenciarte
47
+ - Mercados competitivos
48
+ - Propuestas disruptivas
49
+ - Transformaciones profundas
50
+
51
+ #### Contrato Imposible
52
+ Ideal para:
53
+ - Ofertas disruptivas
54
+ - Soluciones innovadoras
55
+ - Desafiar las normas de la industria
56
+ - Productos/servicios de alto ticket
57
+ - Cuando quieres destacar
58
+
59
+ #### Reto Ridículo
60
+ Ideal para:
61
+ - Simplificar soluciones complejas
62
+ - Romper barreras con humor
63
+ - Abordar frustraciones comunes
64
+ - Cuando quieres mostrar facilidad de uso
65
+ - Convertir escépticos con historias
66
+
67
+ ### 3. Mejores Prácticas
68
+
69
+ #### Para Resultados Óptimos
70
+ 1. Sé específico con tu público objetivo
71
+ - ❌ "Emprendedores que quieren vender más"
72
+ - ✅ "Emprendedores de e-commerce que facturan $5k-$10k mensuales y buscan escalar"
73
+
74
+ 2. Enfócate en la transformación
75
+ - ❌ "Un buen curso de marketing"
76
+ - ✅ "Un sistema probado que convierte coaches frustrados en expertos con agenda llena"
77
+
78
+ 3. Usa resultados medibles
79
+ - ❌ "Mejora tu negocio"
80
+ - ✅ "Duplica tu base de clientes en 90 días"
81
+
82
+ 4. Incluye diferenciadores
83
+ - ❌ "Ayudo a negocios a crecer"
84
+ - ✅ "Ayudo a proveedores de servicios a triplicar sus precios sin perder clientes"
85
+
86
+ #### Evitar
87
+ 1. Declaraciones genéricas
88
+ - ❌ "El mejor servicio del mercado"
89
+ - ✅ "La única estrategia de LinkedIn que garantiza 50 leads mensuales"
90
+
91
+ 2. Jerga técnica
92
+ - ❌ "Implementando modelos de atribución multicanal"
93
+ - ✅ "Por fin sabrás exactamente de dónde vienen tus mejores clientes"
94
+
95
+ 3. Promesas vagas
96
+ - ❌ "Obtén mejores resultados"
97
+ - ✅ "Genera tus primeros $10k mensuales en 90 días"
98
+
99
+ ### Consejos Avanzados
100
+
101
+ 1. **Ajuste del Nivel de Creatividad**
102
+ - Bajo (0.0-0.7): Resultados más conservadores y consistentes
103
+ - Medio (0.8-1.2): Balance entre creatividad y confiabilidad
104
+ - Alto (1.3-2.0): Ángulos más innovadores e inesperados
105
+
106
+ 2. **Selección de Fórmula**
107
+ - Fórmula Tradicional: Para comunicación clara y directa
108
+ - Fórmula Anti-tradicional: Para un enfoque más creativo y personal
109
+ - Contrato Imposible: Para disrumpir el mercado
110
+ - Reto Ridículo: Para conectar con humor y autenticidad
111
+
112
+ 3. **Pruebas y Mejora**
113
+ - Prueba diferentes fórmulas para la misma oferta
114
+ - Experimenta con varios niveles de creatividad
115
+ - Mantén lo que resuena con tu audiencia
116
+
117
  Recuerda: Una gran PUV debe hacer que tu cliente ideal piense, "¡Esto es exactamente lo que estaba buscando!"
options.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Define tone options dictionary
2
+ tone_options = {
3
+ "Ninguno": "Sin tono específico",
4
+ "Profesional": "A formal and expert tone that conveys authority and knowledge.",
5
+ "Serio": "A direct and sober tone, focused on facts and results.",
6
+ "Divertido": "A cheerful and positive tone that connects in a friendly way.",
7
+ "Sarcástico": "A witty tone with a touch of irony that surprises.",
8
+ "Humorístico": "A tone that uses humor to connect and entertain."
9
+ }
10
+
11
+ # Define creative approaches dictionary
12
+ creative_approaches = {
13
+ "Analogías Cotidianas": "Usa objetos y situaciones del día a día para explicar tu producto",
14
+ "Contrastes Extremos": "Compara tu producto con algo completamente opuesto para destacar beneficios",
15
+ "Mundos Ficticios": "Usa referencias de películas, series o libros populares",
16
+ "Absurdo Lógico": "Crea conexiones inesperadas pero que tienen sentido al explicarlas",
17
+ "Inversión de Roles": "Presenta tu producto como si fuera el cliente, o el problema como la solución"
18
+ }
puv_formulas.py CHANGED
@@ -1,227 +1,227 @@
1
- puv_formulas = {
2
- "Fórmula Tradicional": {
3
- "description": """
4
- The Traditional Formula creates a powerful UVP that focuses on four key objectives:
5
- - Attracting your ideal client by highlighting specific characteristics and pain points
6
- - Repelling non-ideal clients to ensure resource efficiency
7
- - Explaining the promised transformation clearly
8
- - Generating purchase commitment through value demonstration
9
- - Clear avatar description with specific pain points
10
- - Direct transformation promise
11
-
12
- Structure:
13
- 1. Start with "Yo ayudo a..." followed by:
14
- [AVATAR DESCRIPTION]
15
- - Demographics
16
- - Current situation
17
- - Pain points
18
- - Specific characteristics
19
-
20
- 2. Then "a conseguir..." followed by:
21
- [TRANSFORMATION]
22
- - Clear outcome
23
- - Specific benefits
24
- - What they won't need to do
25
-
26
- Key elements:
27
- - Ultra-specific avatar description
28
- - Clear transformation promise
29
- - Natural client filtering
30
- - Simple, direct language
31
- """,
32
- "examples": [
33
- {
34
- "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
35
- "product_service": "programa de citas y relaciones para ejecutivas",
36
- "uvp": "Yo ayudo a mujeres empresarias solteras con poco tiempo para el amor, que se sienten atrapadas en su carrera y han tenido malas experiencias en el pasado, a conseguir una pareja compatible que respete su éxito y su tiempo, sin tener que perderse en citas frustrantes ni en relaciones que no aportan nada."
37
- },
38
- {
39
- "target_audience": "fotógrafos principiantes abrumados por la tecnología",
40
- "product_service": "curso de fotografía digital simplificada",
41
- "uvp": "Yo ayudo a fotógrafos principiantes abrumados por los términos técnicos y configuraciones complejas, que se sienten frustrados al ver sus fotos salir borrosas o sobreexpuestas, a dominar su cámara y crear imágenes profesionales que impresionen a sus clientes, sin tener que memorizar manual tras manual ni invertir en equipos carísimos."
42
- },
43
- {
44
- "target_audience": "profesionales del bienestar estresados por el marketing",
45
- "product_service": "sistema de atracción de clientes para terapeutas",
46
- "uvp": "Yo ayudo a terapeutas y coaches holísticos que prefieren enfocarse en sanar a sus clientes en lugar de promocionarse, y que se sienten incómodos con las tácticas de marketing agresivas, a llenar su agenda con clientes ideales que valoran su trabajo, sin tener que convertirse en vendedores ni comprometer sus valores."
47
- },
48
- {
49
- "target_audience": "emprendedores creativos sin presencia digital",
50
- "product_service": "programa de marca personal auténtica",
51
- "uvp": "Yo ayudo a emprendedores creativos que tienen talento pero pasan desapercibidos en el mundo digital, que se sienten invisibles a pesar de su experiencia y pasión, a construir una marca personal magnética que atrae oportunidades y clientes de forma natural, sin tener que fingir ser alguien más ni seguir fórmulas genéricas de marketing."
52
- }
53
- ]
54
- },
55
- "Fórmula Anti-tradicional": {
56
- "description": """
57
- The Anti-traditional Formula creates a clear and direct UVP that focuses on four key objectives:
58
- - Attracting your ideal client by highlighting specific characteristics and pain points
59
- - Repelling non-ideal clients to ensure resource efficiency
60
- - Explaining the promised transformation clearly
61
- - Generating purchase commitment through value demonstration
62
-
63
- Structure:
64
- 1. Start with a powerful opener:
65
- - "Yo transformo..."
66
- - "Me especializo en..."
67
- - "Soy experto/a en..."
68
- - "Mi misión es..."
69
- - "Potencio a..."
70
- (Choose one and describe your avatar's situation, problems, desires)
71
-
72
- 2. To achieve [PROMISED TRANSFORMATION]
73
- (Explain the change/result simply and convincingly)
74
- Key elements to include:
75
- - Emotional appeal
76
- - Clear and direct language
77
- - Service highlights
78
- - Natural filtering of non-ideal clients
79
- """,
80
- "examples": [
81
- {
82
- "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
83
- "product_service": "programa de citas y relaciones para ejecutivas",
84
- "uvp": "Me especializo en transformar la vida amorosa de mujeres empresarias solteras con poco tiempo para el amor, que se sienten atrapadas en su carrera y han tenido malas experiencias en el pasado, para conseguir una pareja compatible que respete su éxito y su tiempo, sin tener que perderse en citas frustrantes ni en relaciones que no aportan nada."
85
- },
86
- {
87
- "target_audience": "geeks introvertidos obsesionados con los videojuegos",
88
- "product_service": "transformación a streamers exitosos",
89
- "uvp": "Soy el puente que conecta a geeks introvertidos obsesionados con los videojuegos, que pasan más tiempo hablando con NPCs que con personas reales y cuyo único ejercicio es mover el pulgar en el control, con su sueño de transformarse en streamers exitosos que gana dinero jugando, sin tener que abandonar su cueva ni fingir ser extrovertidos."
90
- },
91
- {
92
- "target_audience": "millennials traumatizados por Excel",
93
- "product_service": "programa de dominio de datos y automatización",
94
- "uvp": "Mi misión es convertir a millennials traumatizados por Excel que rompen en sudor frío cada vez que su jefe menciona 'tablas dinámicas', y que han fingido entender fórmulas durante años, en verdaderos magos de los datos que impresionan a sus colegas con automatizaciones brillantes, sin tener que memorizar ni una sola fórmula matemática."
95
- },
96
- {
97
- "target_audience": "emprendedores caóticos desorganizados",
98
- "product_service": "sistema de productividad para mentes creativas",
99
- "uvp": "Soy el arquitecto que transforma a emprendedores caóticos que tienen más ideas que organización, cuyo escritorio parece zona de desastre y que pierden más tiempo buscando archivos que trabajando, en maestros de la productividad que funcionan incluso con mentes creativas dispersas, sin convertirse en robots corporativos aburridos."
100
- }
101
- ]
102
- },
103
- "Contrato Imposible": {
104
- "description": """
105
- The "Impossible Contract" formula creates a compelling and disruptive UVP by challenging conventional approaches.
106
- It works by:
107
- - Making a bold, specific promise to a well-defined audience
108
- - Presenting your solution in an unexpected, intriguing way
109
- - Highlighting a transformative benefit that seems "too good to be true"
110
- - Differentiating from traditional solutions by stating what you won't do
111
-
112
- This formula is particularly effective when you want to:
113
- - Stand out in a crowded market
114
- - Challenge industry conventions
115
- - Appeal to audiences frustrated with traditional solutions
116
- - Create an emotional connection while maintaining credibility
117
-
118
- Structure:
119
- 1. Start with a bold opener:
120
- - "¿Te imaginas poder..."
121
- - "Soy el antídoto para..."
122
- - "Revoluciono la manera..."
123
- - "¿Y si te dijera que..."
124
- - "Desbloqueo el potencial..."
125
- (Be specific with your target audience)
126
-
127
- 2. [PRODUCT/SERVICE]
128
- (Describe it in a fun, unexpected way that shows transformation)
129
-
130
- 3. You won't believe [TRANSFORMATIVE BENEFIT]
131
- (Must be directly related to the expected change/result)
132
-
133
- 4. But watch out: [ANTI-TRADITIONAL APPROACH]
134
- (Show how you're different from conventional solutions)
135
- """,
136
- "examples": [
137
- {
138
- "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
139
- "product_service": "curso transformador de relaciones",
140
- "uvp": "¿Te imaginas poder encontrar el amor de tu vida mientras construyes tu imperio? Para mujeres empresarias solteras con poco tiempo para el amor, he creado un curso transformador que revoluciona las citas ejecutivas. No tendrás que perder tiempo en citas sin futuro ni en apps de citas que no aportan nada. Lo mejor de todo es que conseguirás una pareja que valora tu tiempo y tu éxito, sin tener que cambiar quién eres ni hacerte pasar por alguien más."
141
- },
142
- {
143
- "target_audience": "diseñadores gráficos frustrados con clientes imposibles",
144
- "product_service": "sistema de automatización de proyectos creativos",
145
- "uvp": "Soy el antídoto para diseñadores gráficos hartos de clientes que piden 'algo más moderno' sin saber qué quieren. Mi sistema revolucionario automatiza el 80% de las revisiones infinitas. No más noches en vela haciendo cambios insignificantes ni presentaciones interminables. Lo mejor es que duplicarás tus ingresos trabajando la mitad del tiempo, sin tener que sacrificar tu visión creativa ni convertirte en un robot corporativo."
146
- },
147
- {
148
- "target_audience": "emprendedores tecnológicos con miedo a hablar en público",
149
- "product_service": "programa de presentaciones impactantes",
150
- "uvp": "Revoluciono la manera en que los emprendedores tech que prefieren código que conversaciones dominan sus presentaciones. Mi método único te libera de memorizar guiones robóticos. Olvídate de sudar frío antes de cada pitch o fingir ser un showman extrovertido. Lo increíble es que cautivarás a cualquier inversor siendo 100% tú mismo, usando tu naturaleza analítica como superpoder."
151
- },
152
- {
153
- "target_audience": "profesionales del fitness adictos al trabajo",
154
- "product_service": "sistema de entrenamiento remoto",
155
- "uvp": "Desbloqueo el potencial oculto de entrenadores fitness workahólicos con un sistema revolucionario que genera ingresos mientras duermes. No más madrugar a las 5 AM ni sacrificar tu propio entrenamiento. Lo sorprendente es que ganarás más dinero entrenando menos personas, sin convertirte en un vendedor agresivo ni perder la conexión personal con tus clientes."
156
- },
157
- {
158
- "target_audience": "emprendedores digitales de 30-45 años que coleccionan conexiones en LinkedIn como si fueran cromos",
159
- "product_service": "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días",
160
- "uvp": "Ayer me reí tanto viendo mi feed de LinkedIn que casi escupo el café... Otro post de '5 hábitos matutinos de los millonarios' con dos likes: uno de la mamá del autor y otro de su cuenta alternativa. Para todos esos emprendedores digitales de 30-45 que han probado cada hashtag trending desde #MindsetDelÉxito hasta #LinkedInLocal sin más resultado que el visto de su ex compañero del cole... He creado un método que convierte tu perfil abandonado en un imán de clientes reales. Sin tener que publicar frases motivacionales robadas de Google, ni fingir que meditas 4 horas al día, ni etiquetar a medio LinkedIn en fotos random. En 90 días, pasarás de ser el fantasma de LinkedIn a tener una comunidad que de verdad quiere hacer negocios contigo, y todo sin tener que usar ni una sola vez el hashtag #Emprendimiento."
161
- },
162
- ]
163
- },
164
- "Reto Ridículo": {
165
- "description": """
166
- The "Ridiculous Challenge" formula uses humor and storytelling to create an instant connection with your audience through shared experiences and pain points.
167
- Formula Structure:
168
- 1. Start with a funny personal anecdote or observation:
169
- - Share a recent "aha moment"
170
- - Tell a relatable story
171
- - Point out an absurd industry situation
172
- (Make it specific and recent: "The other day...", "Last week...", "Yesterday...")
173
-
174
- 2. Address your audience with empathy and humor:
175
- - Call out their specific struggles
176
- - Reference industry inside jokes
177
- - Make fun of common "solutions" in your field
178
- - Use their jargon (but in a playful way)
179
-
180
- 3. Present your solution as the obvious alternative:
181
- - Keep it conversational and light
182
- - Contrast it with typical "guru advice"
183
- - Show how it embraces reality instead of perfection
184
- - Make it sound both powerful and approachable
185
-
186
- 4. End with a transformation that feels both ambitious and realistic:
187
- - Include specific, measurable results
188
- - Add a humorous twist to the outcome
189
- - Emphasize the human aspect of the solution
190
-
191
- Key Elements:
192
- - Use contemporary references your audience will recognize
193
- - Include specific numbers or situations that feel authentic
194
- - Make fun of industry clichés and overused phrases
195
- - Show you're "one of them" by sharing similar experiences
196
- - Balance humor with actual value and transformation
197
- - Keep the tone casual but knowledgeable
198
- """,
199
- "examples": [
200
- {
201
- "target_audience": "asesores financieros corporativos obsesionados con los números que luchan por humanizar sus servicios",
202
- "product_service": "método de educación financiera simplificada",
203
- "uvp": "Después de ver a otro ejecutivo de alto nivel quedarse dormido mientras explicaba el fascinante mundo de los derivados financieros (¡con 47 diapositivas llenas de gráficos!), me di cuenta que algo andaba mal. Para todos los asesores financieros que pueden recitar ratios P/E durante la cena pero no logran que sus clientes entiendan la diferencia entre un ETF y un emoji... Mi método convierte tu expertise numérica en historias tan entretenidas que tus clientes preferirán hablar de diversificación de portafolios que de la última temporada de su serie favorita."
204
- },
205
- {
206
- "target_audience": "nutricionistas certificados hartos de luchar contra las dietas milagro de Instagram",
207
- "product_service": "sistema de cambio de hábitos sostenibles",
208
- "uvp": "La semana pasada, una nutricionista me confesó que su cliente más dedicada estaba siguiendo en secreto a una influencer que promete pérdida de peso comiendo solo papaya los martes. ¡Ay! Para todos los profesionales de la nutrición que compiten contra licuados mágicos y dietas del color... Desarrollé un sistema que hace que la ciencia de la nutrición sea más atractiva que cualquier tendencia de TikTok. Mis pacientes ahora presumen sus conocimientos nutricionales basados en evidencia y hasta detectan fake news alimentarias mejor que un fact-checker profesional."
209
- },
210
- {
211
- "target_audience": "consultores de marketing digital ahogados en herramientas y análisis de datos",
212
- "product_service": "método de storytelling auténtico",
213
- "uvp": "El otro día, un consultor de marketing presumía sus 27 dashboards de analytics, 13 herramientas de automatización y 5 CRMs... mientras su único lead seguía siendo su mamá. Para todos los marketeros que tienen más pestañas abiertas que conversiones... Mi método te enseña a dejar de esconderte detrás de los datos y empezar a contar historias que conectan. Sin necesidad de otro curso de Google Analytics o un doctorado en ciencia de datos. Solo estrategias que convierten números en narrativas que tus clientes realmente quieren escuchar."
214
- },
215
- {
216
- "target_audience": "emprendedores digitales de 30-45 años que coleccionan conexiones en LinkedIn como si fueran cromos",
217
- "product_service": "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días",
218
- "uvp": "Ayer me reí tanto viendo mi feed de LinkedIn que casi escupo el café... Otro post de '5 hábitos matutinos de los millonarios' con dos likes: uno de la mamá del autor y otro de su cuenta alternativa. Para todos esos emprendedores digitales de 30-45 que han probado cada hashtag trending desde #MindsetDelÉxito hasta #LinkedInLocal sin más resultado que el visto de su ex compañero del cole... He creado un método que convierte tu perfil abandonado en un imán de clientes reales. Sin tener que publicar frases motivacionales robadas de Google, ni fingir que meditas 4 horas al día, ni etiquetar a medio LinkedIn en fotos random. En 90 días, pasarás de ser el fantasma de LinkedIn a tener una comunidad que de verdad quiere hacer negocios contigo, y todo sin tener que usar ni una sola vez el hashtag #Emprendimiento."
219
- },
220
- {
221
- "target_audience": "coaches de productividad perfeccionistas que predican lo que no pueden practicar",
222
- "product_service": "sistema de gestión del tiempo realista",
223
- "uvp": "Encontré mi antigua lista de 'hábitos matutinos de alto rendimiento' escondida bajo una pila de libros de productividad sin terminar. Para todos los coaches que recomiendan rutinas de 5am mientras responden emails a medianoche... He creado un sistema que abraza la realidad del caos productivo. Nada de mantras tóxicos tipo 'levántate y conquista' ni apps que te hacen sentir culpable por respirar. Este método te permite ser productivo siendo humano, incluso en esos días donde tu mayor logro es encontrar los pantalones que combinan."
224
- }
225
- ]
226
- }
227
  }
 
1
+ puv_formulas = {
2
+ "Fórmula Tradicional": {
3
+ "description": """
4
+ The Traditional Formula creates a powerful UVP that focuses on four key objectives:
5
+ - Attracting your ideal client by highlighting specific characteristics and pain points
6
+ - Repelling non-ideal clients to ensure resource efficiency
7
+ - Explaining the promised transformation clearly
8
+ - Generating purchase commitment through value demonstration
9
+ - Clear avatar description with specific pain points
10
+ - Direct transformation promise
11
+
12
+ Structure:
13
+ 1. Start with "Yo ayudo a..." followed by:
14
+ [AVATAR DESCRIPTION]
15
+ - Demographics
16
+ - Current situation
17
+ - Pain points
18
+ - Specific characteristics
19
+
20
+ 2. Then "a conseguir..." followed by:
21
+ [TRANSFORMATION]
22
+ - Clear outcome
23
+ - Specific benefits
24
+ - What they won't need to do
25
+
26
+ Key elements:
27
+ - Ultra-specific avatar description
28
+ - Clear transformation promise
29
+ - Natural client filtering
30
+ - Simple, direct language
31
+ """,
32
+ "examples": [
33
+ {
34
+ "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
35
+ "product_service": "programa de citas y relaciones para ejecutivas",
36
+ "uvp": "Yo ayudo a mujeres empresarias solteras con poco tiempo para el amor, que se sienten atrapadas en su carrera y han tenido malas experiencias en el pasado, a conseguir una pareja compatible que respete su éxito y su tiempo, sin tener que perderse en citas frustrantes ni en relaciones que no aportan nada."
37
+ },
38
+ {
39
+ "target_audience": "fotógrafos principiantes abrumados por la tecnología",
40
+ "product_service": "curso de fotografía digital simplificada",
41
+ "uvp": "Yo ayudo a fotógrafos principiantes abrumados por los términos técnicos y configuraciones complejas, que se sienten frustrados al ver sus fotos salir borrosas o sobreexpuestas, a dominar su cámara y crear imágenes profesionales que impresionen a sus clientes, sin tener que memorizar manual tras manual ni invertir en equipos carísimos."
42
+ },
43
+ {
44
+ "target_audience": "profesionales del bienestar estresados por el marketing",
45
+ "product_service": "sistema de atracción de clientes para terapeutas",
46
+ "uvp": "Yo ayudo a terapeutas y coaches holísticos que prefieren enfocarse en sanar a sus clientes en lugar de promocionarse, y que se sienten incómodos con las tácticas de marketing agresivas, a llenar su agenda con clientes ideales que valoran su trabajo, sin tener que convertirse en vendedores ni comprometer sus valores."
47
+ },
48
+ {
49
+ "target_audience": "emprendedores creativos sin presencia digital",
50
+ "product_service": "programa de marca personal auténtica",
51
+ "uvp": "Yo ayudo a emprendedores creativos que tienen talento pero pasan desapercibidos en el mundo digital, que se sienten invisibles a pesar de su experiencia y pasión, a construir una marca personal magnética que atrae oportunidades y clientes de forma natural, sin tener que fingir ser alguien más ni seguir fórmulas genéricas de marketing."
52
+ }
53
+ ]
54
+ },
55
+ "Fórmula Anti-tradicional": {
56
+ "description": """
57
+ The Anti-traditional Formula creates a clear and direct UVP that focuses on four key objectives:
58
+ - Attracting your ideal client by highlighting specific characteristics and pain points
59
+ - Repelling non-ideal clients to ensure resource efficiency
60
+ - Explaining the promised transformation clearly
61
+ - Generating purchase commitment through value demonstration
62
+
63
+ Structure:
64
+ 1. Start with a powerful opener:
65
+ - "Yo transformo..."
66
+ - "Me especializo en..."
67
+ - "Soy experto/a en..."
68
+ - "Mi misión es..."
69
+ - "Potencio a..."
70
+ (Choose one and describe your avatar's situation, problems, desires)
71
+
72
+ 2. To achieve [PROMISED TRANSFORMATION]
73
+ (Explain the change/result simply and convincingly)
74
+ Key elements to include:
75
+ - Emotional appeal
76
+ - Clear and direct language
77
+ - Service highlights
78
+ - Natural filtering of non-ideal clients
79
+ """,
80
+ "examples": [
81
+ {
82
+ "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
83
+ "product_service": "programa de citas y relaciones para ejecutivas",
84
+ "uvp": "Me especializo en transformar la vida amorosa de mujeres empresarias solteras con poco tiempo para el amor, que se sienten atrapadas en su carrera y han tenido malas experiencias en el pasado, para conseguir una pareja compatible que respete su éxito y su tiempo, sin tener que perderse en citas frustrantes ni en relaciones que no aportan nada."
85
+ },
86
+ {
87
+ "target_audience": "geeks introvertidos obsesionados con los videojuegos",
88
+ "product_service": "transformación a streamers exitosos",
89
+ "uvp": "Soy el puente que conecta a geeks introvertidos obsesionados con los videojuegos, que pasan más tiempo hablando con NPCs que con personas reales y cuyo único ejercicio es mover el pulgar en el control, con su sueño de transformarse en streamers exitosos que gana dinero jugando, sin tener que abandonar su cueva ni fingir ser extrovertidos."
90
+ },
91
+ {
92
+ "target_audience": "millennials traumatizados por Excel",
93
+ "product_service": "programa de dominio de datos y automatización",
94
+ "uvp": "Mi misión es convertir a millennials traumatizados por Excel que rompen en sudor frío cada vez que su jefe menciona 'tablas dinámicas', y que han fingido entender fórmulas durante años, en verdaderos magos de los datos que impresionan a sus colegas con automatizaciones brillantes, sin tener que memorizar ni una sola fórmula matemática."
95
+ },
96
+ {
97
+ "target_audience": "emprendedores caóticos desorganizados",
98
+ "product_service": "sistema de productividad para mentes creativas",
99
+ "uvp": "Soy el arquitecto que transforma a emprendedores caóticos que tienen más ideas que organización, cuyo escritorio parece zona de desastre y que pierden más tiempo buscando archivos que trabajando, en maestros de la productividad que funcionan incluso con mentes creativas dispersas, sin convertirse en robots corporativos aburridos."
100
+ }
101
+ ]
102
+ },
103
+ "Contrato Imposible": {
104
+ "description": """
105
+ The "Impossible Contract" formula creates a compelling and disruptive UVP by challenging conventional approaches.
106
+ It works by:
107
+ - Making a bold, specific promise to a well-defined audience
108
+ - Presenting your solution in an unexpected, intriguing way
109
+ - Highlighting a transformative benefit that seems "too good to be true"
110
+ - Differentiating from traditional solutions by stating what you won't do
111
+
112
+ This formula is particularly effective when you want to:
113
+ - Stand out in a crowded market
114
+ - Challenge industry conventions
115
+ - Appeal to audiences frustrated with traditional solutions
116
+ - Create an emotional connection while maintaining credibility
117
+
118
+ Structure:
119
+ 1. Start with a bold opener:
120
+ - "¿Te imaginas poder..."
121
+ - "Soy el antídoto para..."
122
+ - "Revoluciono la manera..."
123
+ - "¿Y si te dijera que..."
124
+ - "Desbloqueo el potencial..."
125
+ (Be specific with your target audience)
126
+
127
+ 2. [PRODUCT/SERVICE]
128
+ (Describe it in a fun, unexpected way that shows transformation)
129
+
130
+ 3. You won't believe [TRANSFORMATIVE BENEFIT]
131
+ (Must be directly related to the expected change/result)
132
+
133
+ 4. But watch out: [ANTI-TRADITIONAL APPROACH]
134
+ (Show how you're different from conventional solutions)
135
+ """,
136
+ "examples": [
137
+ {
138
+ "target_audience": "mujeres empresarias solteras con poco tiempo para el amor",
139
+ "product_service": "curso transformador de relaciones",
140
+ "uvp": "¿Te imaginas poder encontrar el amor de tu vida mientras construyes tu imperio? Para mujeres empresarias solteras con poco tiempo para el amor, he creado un curso transformador que revoluciona las citas ejecutivas. No tendrás que perder tiempo en citas sin futuro ni en apps de citas que no aportan nada. Lo mejor de todo es que conseguirás una pareja que valora tu tiempo y tu éxito, sin tener que cambiar quién eres ni hacerte pasar por alguien más."
141
+ },
142
+ {
143
+ "target_audience": "diseñadores gráficos frustrados con clientes imposibles",
144
+ "product_service": "sistema de automatización de proyectos creativos",
145
+ "uvp": "Soy el antídoto para diseñadores gráficos hartos de clientes que piden 'algo más moderno' sin saber qué quieren. Mi sistema revolucionario automatiza el 80% de las revisiones infinitas. No más noches en vela haciendo cambios insignificantes ni presentaciones interminables. Lo mejor es que duplicarás tus ingresos trabajando la mitad del tiempo, sin tener que sacrificar tu visión creativa ni convertirte en un robot corporativo."
146
+ },
147
+ {
148
+ "target_audience": "emprendedores tecnológicos con miedo a hablar en público",
149
+ "product_service": "programa de presentaciones impactantes",
150
+ "uvp": "Revoluciono la manera en que los emprendedores tech que prefieren código que conversaciones dominan sus presentaciones. Mi método único te libera de memorizar guiones robóticos. Olvídate de sudar frío antes de cada pitch o fingir ser un showman extrovertido. Lo increíble es que cautivarás a cualquier inversor siendo 100% tú mismo, usando tu naturaleza analítica como superpoder."
151
+ },
152
+ {
153
+ "target_audience": "profesionales del fitness adictos al trabajo",
154
+ "product_service": "sistema de entrenamiento remoto",
155
+ "uvp": "Desbloqueo el potencial oculto de entrenadores fitness workahólicos con un sistema revolucionario que genera ingresos mientras duermes. No más madrugar a las 5 AM ni sacrificar tu propio entrenamiento. Lo sorprendente es que ganarás más dinero entrenando menos personas, sin convertirte en un vendedor agresivo ni perder la conexión personal con tus clientes."
156
+ },
157
+ {
158
+ "target_audience": "emprendedores digitales de 30-45 años que coleccionan conexiones en LinkedIn como si fueran cromos",
159
+ "product_service": "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días",
160
+ "uvp": "Ayer me reí tanto viendo mi feed de LinkedIn que casi escupo el café... Otro post de '5 hábitos matutinos de los millonarios' con dos likes: uno de la mamá del autor y otro de su cuenta alternativa. Para todos esos emprendedores digitales de 30-45 que han probado cada hashtag trending desde #MindsetDelÉxito hasta #LinkedInLocal sin más resultado que el visto de su ex compañero del cole... He creado un método que convierte tu perfil abandonado en un imán de clientes reales. Sin tener que publicar frases motivacionales robadas de Google, ni fingir que meditas 4 horas al día, ni etiquetar a medio LinkedIn en fotos random. En 90 días, pasarás de ser el fantasma de LinkedIn a tener una comunidad que de verdad quiere hacer negocios contigo, y todo sin tener que usar ni una sola vez el hashtag #Emprendimiento."
161
+ },
162
+ ]
163
+ },
164
+ "Reto Ridículo": {
165
+ "description": """
166
+ The "Ridiculous Challenge" formula uses humor and storytelling to create an instant connection with your audience through shared experiences and pain points.
167
+ Formula Structure:
168
+ 1. Start with a funny personal anecdote or observation:
169
+ - Share a recent "aha moment"
170
+ - Tell a relatable story
171
+ - Point out an absurd industry situation
172
+ (Make it specific and recent: "The other day...", "Last week...", "Yesterday...")
173
+
174
+ 2. Address your audience with empathy and humor:
175
+ - Call out their specific struggles
176
+ - Reference industry inside jokes
177
+ - Make fun of common "solutions" in your field
178
+ - Use their jargon (but in a playful way)
179
+
180
+ 3. Present your solution as the obvious alternative:
181
+ - Keep it conversational and light
182
+ - Contrast it with typical "guru advice"
183
+ - Show how it embraces reality instead of perfection
184
+ - Make it sound both powerful and approachable
185
+
186
+ 4. End with a transformation that feels both ambitious and realistic:
187
+ - Include specific, measurable results
188
+ - Add a humorous twist to the outcome
189
+ - Emphasize the human aspect of the solution
190
+
191
+ Key Elements:
192
+ - Use contemporary references your audience will recognize
193
+ - Include specific numbers or situations that feel authentic
194
+ - Make fun of industry clichés and overused phrases
195
+ - Show you're "one of them" by sharing similar experiences
196
+ - Balance humor with actual value and transformation
197
+ - Keep the tone casual but knowledgeable
198
+ """,
199
+ "examples": [
200
+ {
201
+ "target_audience": "asesores financieros corporativos obsesionados con los números que luchan por humanizar sus servicios",
202
+ "product_service": "método de educación financiera simplificada",
203
+ "uvp": "Después de ver a otro ejecutivo de alto nivel quedarse dormido mientras explicaba el fascinante mundo de los derivados financieros (¡con 47 diapositivas llenas de gráficos!), me di cuenta que algo andaba mal. Para todos los asesores financieros que pueden recitar ratios P/E durante la cena pero no logran que sus clientes entiendan la diferencia entre un ETF y un emoji... Mi método convierte tu expertise numérica en historias tan entretenidas que tus clientes preferirán hablar de diversificación de portafolios que de la última temporada de su serie favorita."
204
+ },
205
+ {
206
+ "target_audience": "nutricionistas certificados hartos de luchar contra las dietas milagro de Instagram",
207
+ "product_service": "sistema de cambio de hábitos sostenibles",
208
+ "uvp": "La semana pasada, una nutricionista me confesó que su cliente más dedicada estaba siguiendo en secreto a una influencer que promete pérdida de peso comiendo solo papaya los martes. ¡Ay! Para todos los profesionales de la nutrición que compiten contra licuados mágicos y dietas del color... Desarrollé un sistema que hace que la ciencia de la nutrición sea más atractiva que cualquier tendencia de TikTok. Mis pacientes ahora presumen sus conocimientos nutricionales basados en evidencia y hasta detectan fake news alimentarias mejor que un fact-checker profesional."
209
+ },
210
+ {
211
+ "target_audience": "consultores de marketing digital ahogados en herramientas y análisis de datos",
212
+ "product_service": "método de storytelling auténtico",
213
+ "uvp": "El otro día, un consultor de marketing presumía sus 27 dashboards de analytics, 13 herramientas de automatización y 5 CRMs... mientras su único lead seguía siendo su mamá. Para todos los marketeros que tienen más pestañas abiertas que conversiones... Mi método te enseña a dejar de esconderte detrás de los datos y empezar a contar historias que conectan. Sin necesidad de otro curso de Google Analytics o un doctorado en ciencia de datos. Solo estrategias que convierten números en narrativas que tus clientes realmente quieren escuchar."
214
+ },
215
+ {
216
+ "target_audience": "emprendedores digitales de 30-45 años que coleccionan conexiones en LinkedIn como si fueran cromos",
217
+ "product_service": "Curso de LinkedIn Orgánico: De 0 a 10k seguidores en 90 días",
218
+ "uvp": "Ayer me reí tanto viendo mi feed de LinkedIn que casi escupo el café... Otro post de '5 hábitos matutinos de los millonarios' con dos likes: uno de la mamá del autor y otro de su cuenta alternativa. Para todos esos emprendedores digitales de 30-45 que han probado cada hashtag trending desde #MindsetDelÉxito hasta #LinkedInLocal sin más resultado que el visto de su ex compañero del cole... He creado un método que convierte tu perfil abandonado en un imán de clientes reales. Sin tener que publicar frases motivacionales robadas de Google, ni fingir que meditas 4 horas al día, ni etiquetar a medio LinkedIn en fotos random. En 90 días, pasarás de ser el fantasma de LinkedIn a tener una comunidad que de verdad quiere hacer negocios contigo, y todo sin tener que usar ni una sola vez el hashtag #Emprendimiento."
219
+ },
220
+ {
221
+ "target_audience": "coaches de productividad perfeccionistas que predican lo que no pueden practicar",
222
+ "product_service": "sistema de gestión del tiempo realista",
223
+ "uvp": "Encontré mi antigua lista de 'hábitos matutinos de alto rendimiento' escondida bajo una pila de libros de productividad sin terminar. Para todos los coaches que recomiendan rutinas de 5am mientras responden emails a medianoche... He creado un sistema que abraza la realidad del caos productivo. Nada de mantras tóxicos tipo 'levántate y conquista' ni apps que te hacen sentir culpable por respirar. Este método te permite ser productivo siendo humano, incluso en esos días donde tu mayor logro es encontrar los pantalones que combinan."
224
+ }
225
+ ]
226
+ }
227
  }
requirements.txt CHANGED
@@ -1,10 +1,5 @@
1
- streamlit
2
- google-generativeai
3
- python-dotenv
4
- langchain
5
- PyPDF2
6
- chromadb
7
- pdf2image
8
- faiss-cpu
9
- python-docx
10
- Pillow
 
1
+ streamlit
2
+ google-generativeai
3
+ python-dotenv
4
+ langchain
5
+ faiss-cpu
 
 
 
 
 
styles.py CHANGED
@@ -1,266 +1,266 @@
1
- import streamlit as st
2
-
3
- def apply_styles():
4
- return """
5
- <style>
6
- /* Remove top margin and reduce other margins */
7
- .main .block-container {
8
- padding-top: 1rem !important;
9
- margin-top: 0 !important;
10
- max-width: 95% !important;
11
- }
12
-
13
- h1, h3 {
14
- text-align: center;
15
- margin-top: 0.5rem !important;
16
- margin-bottom: 0.5rem !important;
17
- }
18
-
19
- .stButton > button {
20
- background-color: #FFD700 !important;
21
- color: black !important;
22
- border: 1px solid black !important;
23
- font-weight: bold !important;
24
- width: 80% !important;
25
- margin-left: 10% !important;
26
- }
27
-
28
- [data-testid="stDownloadButton"] {
29
- text-align: center;
30
- display: flex;
31
- justify-content: center;
32
- margin-top: 5px;
33
- width: 90%;
34
- margin-left: auto;
35
- margin-right: auto;
36
- }
37
-
38
- [data-testid="stDownloadButton"] button {
39
- width: 100%;
40
- border-radius: 5px;
41
- height: 3em;
42
- background: linear-gradient(to right, #00D100, #009900);
43
- color: white;
44
- font-weight: bold;
45
- transition: all 0.3s ease;
46
- border: none;
47
- text-transform: uppercase;
48
- letter-spacing: 1px;
49
- }
50
-
51
- [data-testid="stDownloadButton"] button:hover {
52
- background: linear-gradient(to right, #00C000, #008800);
53
- transform: translateY(-2px);
54
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
55
- }
56
-
57
- .stButton > button:hover {
58
- transform: translateY(-2px);
59
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
60
- transition: all 0.3s ease;
61
- }
62
-
63
- /* Hide the hamburger menu and Streamlit footer */
64
- #MainMenu {visibility: hidden;}
65
- footer {visibility: hidden;}
66
-
67
- /* Creative Concept Styling */
68
- .concept-title {
69
- font-size: 1.5rem;
70
- font-weight: bold;
71
- color: #2c3e50;
72
- margin-top: 2rem;
73
- padding: 0.5rem;
74
- border-bottom: 2px solid #3498db;
75
- }
76
-
77
- .section-header {
78
- font-size: 1.2rem;
79
- font-weight: bold;
80
- color: #3498db;
81
- margin-top: 1rem;
82
- margin-bottom: 0.5rem;
83
- }
84
-
85
- .analogy {
86
- color: #e74c3c;
87
- font-weight: bold;
88
- }
89
-
90
- .creative-concepts {
91
- background-color: #f8f9fa;
92
- padding: 1.5rem;
93
- border-radius: 10px;
94
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
95
- margin-bottom: 1.5rem;
96
- }
97
- </style>
98
- """
99
- st.markdown("""
100
- <style>
101
- .stTextArea > label {
102
- font-size: 1.2rem;
103
- font-weight: bold;
104
- color: #2c3e50;
105
- }
106
-
107
- .stSelectbox > label {
108
- font-size: 1.2rem;
109
- font-weight: bold;
110
- color: #2c3e50;
111
- }
112
-
113
- .stSlider > label {
114
- font-size: 1.2rem;
115
- font-weight: bold;
116
- color: #2c3e50;
117
- }
118
-
119
- .stButton > button {
120
- background-color: #2c3e50;
121
- color: white;
122
- padding: 0.5rem 2rem;
123
- font-size: 1.1rem;
124
- font-weight: bold;
125
- border-radius: 5px;
126
- }
127
-
128
- .stButton > button:hover {
129
- background-color: #34495e;
130
- }
131
-
132
- h1 {
133
- color: #2c3e50;
134
- font-size: 2.5rem;
135
- margin-bottom: 1rem;
136
- }
137
-
138
- h3 {
139
- color: #34495e;
140
- font-size: 1.3rem;
141
- font-weight: normal;
142
- margin-bottom: 2rem;
143
- }
144
-
145
- .stMarkdown {
146
- font-size: 1.1rem;
147
- }
148
-
149
- .element-container {
150
- margin-bottom: 1rem;
151
- }
152
- </style>
153
- """, unsafe_allow_html=True)
154
-
155
- def format_creative_response(response_text):
156
- """Format the creative response with custom styling"""
157
- if not response_text or response_text.startswith("Error") or response_text.startswith("Debes"):
158
- return response_text
159
-
160
- # Parse the response into sections
161
- sections = []
162
- current_concept = {"title": "", "content": []}
163
- current_section = None
164
-
165
- for line in response_text.split('\n'):
166
- line = line.strip()
167
- if not line:
168
- continue
169
-
170
- if line.startswith("CONCEPTO CREATIVO"):
171
- # Start a new concept
172
- if current_concept["title"]:
173
- sections.append(current_concept)
174
- current_concept = {"title": line, "content": []}
175
- current_section = None
176
- elif line.startswith("Concepto:"):
177
- current_section = "concept"
178
- current_concept["content"].append({"type": current_section, "header": line, "text": ""})
179
- elif line.startswith("Creatividad:"):
180
- current_section = "creativity"
181
- current_concept["content"].append({"type": current_section, "header": line, "text": ""})
182
- elif line.startswith("Ejemplo de Titular:"):
183
- current_section = "headline"
184
- current_concept["content"].append({"type": current_section, "header": line, "text": ""})
185
- elif current_section:
186
- # Add content to the current section
187
- current_concept["content"][-1]["text"] = line
188
-
189
- # Add the last concept
190
- if current_concept["title"]:
191
- sections.append(current_concept)
192
-
193
- # Build the HTML
194
- html = ""
195
- for concept in sections:
196
- html += f'<div class="creative-concept-card">'
197
- html += f'<div class="concept-title">{concept["title"]}</div>'
198
-
199
- for item in concept["content"]:
200
- html += f'<div class="concept-section">'
201
- html += f'<div class="section-header">{item["header"]}</div>'
202
-
203
- # Apply special styling to analogy text
204
- if item["type"] == "creativity" and "es como" in item["text"] and "porque" in item["text"]:
205
- import re
206
- analogy_pattern = r'([^\.]+es como [^\.]+porque [^\.]+)'
207
- styled_text = re.sub(analogy_pattern, r'<span class="analogy">\1</span>', item["text"])
208
- html += f'<div class="section-content">{styled_text}</div>'
209
- else:
210
- html += f'<div class="section-content">{item["text"]}</div>'
211
-
212
- html += '</div>'
213
-
214
- html += '</div>'
215
-
216
- # Add custom CSS for the new layout
217
- css = """
218
- <style>
219
- .creative-concept-card {
220
- background-color: #f8f9fa;
221
- padding: 1.5rem;
222
- border-radius: 10px;
223
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
224
- margin-bottom: 2rem;
225
- }
226
-
227
- .concept-title {
228
- font-size: 1.5rem;
229
- font-weight: bold;
230
- color: #2c3e50;
231
- padding-bottom: 0.5rem;
232
- border-bottom: 2px solid #3498db;
233
- margin-bottom: 1.5rem;
234
- }
235
-
236
- .concept-section {
237
- margin-bottom: 1.5rem;
238
- }
239
-
240
- .section-header {
241
- font-size: 1.2rem;
242
- font-weight: bold;
243
- color: #3498db;
244
- margin-bottom: 0.5rem;
245
- }
246
-
247
- .section-content {
248
- font-size: 1.1rem;
249
- line-height: 1.5;
250
- }
251
-
252
- .analogy {
253
- color: #e74c3c;
254
- font-weight: bold;
255
- }
256
- </style>
257
- """
258
-
259
- return css + html
260
-
261
- def format_story_output(story_text):
262
- return f"""
263
- <div class="story-output">
264
- {story_text}
265
- </div>
266
  """
 
1
+ import streamlit as st
2
+
3
+ def apply_styles():
4
+ return """
5
+ <style>
6
+ /* Remove top margin and reduce other margins */
7
+ .main .block-container {
8
+ padding-top: 1rem !important;
9
+ margin-top: 0 !important;
10
+ max-width: 95% !important;
11
+ }
12
+
13
+ h1, h3 {
14
+ text-align: center;
15
+ margin-top: 0.5rem !important;
16
+ margin-bottom: 0.5rem !important;
17
+ }
18
+
19
+ .stButton > button {
20
+ background-color: #FFD700 !important;
21
+ color: black !important;
22
+ border: 1px solid black !important;
23
+ font-weight: bold !important;
24
+ width: 80% !important;
25
+ margin-left: 10% !important;
26
+ }
27
+
28
+ [data-testid="stDownloadButton"] {
29
+ text-align: center;
30
+ display: flex;
31
+ justify-content: center;
32
+ margin-top: 5px;
33
+ width: 90%;
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ }
37
+
38
+ [data-testid="stDownloadButton"] button {
39
+ width: 100%;
40
+ border-radius: 5px;
41
+ height: 3em;
42
+ background: linear-gradient(to right, #00D100, #009900);
43
+ color: white;
44
+ font-weight: bold;
45
+ transition: all 0.3s ease;
46
+ border: none;
47
+ text-transform: uppercase;
48
+ letter-spacing: 1px;
49
+ }
50
+
51
+ [data-testid="stDownloadButton"] button:hover {
52
+ background: linear-gradient(to right, #00C000, #008800);
53
+ transform: translateY(-2px);
54
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
55
+ }
56
+
57
+ .stButton > button:hover {
58
+ transform: translateY(-2px);
59
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
60
+ transition: all 0.3s ease;
61
+ }
62
+
63
+ /* Hide the hamburger menu and Streamlit footer */
64
+ #MainMenu {visibility: hidden;}
65
+ footer {visibility: hidden;}
66
+
67
+ /* Creative Concept Styling */
68
+ .concept-title {
69
+ font-size: 1.5rem;
70
+ font-weight: bold;
71
+ color: #2c3e50;
72
+ margin-top: 2rem;
73
+ padding: 0.5rem;
74
+ border-bottom: 2px solid #3498db;
75
+ }
76
+
77
+ .section-header {
78
+ font-size: 1.2rem;
79
+ font-weight: bold;
80
+ color: #3498db;
81
+ margin-top: 1rem;
82
+ margin-bottom: 0.5rem;
83
+ }
84
+
85
+ .analogy {
86
+ color: #e74c3c;
87
+ font-weight: bold;
88
+ }
89
+
90
+ .creative-concepts {
91
+ background-color: #f8f9fa;
92
+ padding: 1.5rem;
93
+ border-radius: 10px;
94
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
95
+ margin-bottom: 1.5rem;
96
+ }
97
+ </style>
98
+ """
99
+ st.markdown("""
100
+ <style>
101
+ .stTextArea > label {
102
+ font-size: 1.2rem;
103
+ font-weight: bold;
104
+ color: #2c3e50;
105
+ }
106
+
107
+ .stSelectbox > label {
108
+ font-size: 1.2rem;
109
+ font-weight: bold;
110
+ color: #2c3e50;
111
+ }
112
+
113
+ .stSlider > label {
114
+ font-size: 1.2rem;
115
+ font-weight: bold;
116
+ color: #2c3e50;
117
+ }
118
+
119
+ .stButton > button {
120
+ background-color: #2c3e50;
121
+ color: white;
122
+ padding: 0.5rem 2rem;
123
+ font-size: 1.1rem;
124
+ font-weight: bold;
125
+ border-radius: 5px;
126
+ }
127
+
128
+ .stButton > button:hover {
129
+ background-color: #34495e;
130
+ }
131
+
132
+ h1 {
133
+ color: #2c3e50;
134
+ font-size: 2.5rem;
135
+ margin-bottom: 1rem;
136
+ }
137
+
138
+ h3 {
139
+ color: #34495e;
140
+ font-size: 1.3rem;
141
+ font-weight: normal;
142
+ margin-bottom: 2rem;
143
+ }
144
+
145
+ .stMarkdown {
146
+ font-size: 1.1rem;
147
+ }
148
+
149
+ .element-container {
150
+ margin-bottom: 1rem;
151
+ }
152
+ </style>
153
+ """, unsafe_allow_html=True)
154
+
155
+ def format_creative_response(response_text):
156
+ """Format the creative response with custom styling"""
157
+ if not response_text or response_text.startswith("Error") or response_text.startswith("Debes"):
158
+ return response_text
159
+
160
+ # Parse the response into sections
161
+ sections = []
162
+ current_concept = {"title": "", "content": []}
163
+ current_section = None
164
+
165
+ for line in response_text.split('\n'):
166
+ line = line.strip()
167
+ if not line:
168
+ continue
169
+
170
+ if line.startswith("CONCEPTO CREATIVO"):
171
+ # Start a new concept
172
+ if current_concept["title"]:
173
+ sections.append(current_concept)
174
+ current_concept = {"title": line, "content": []}
175
+ current_section = None
176
+ elif line.startswith("Concepto:"):
177
+ current_section = "concept"
178
+ current_concept["content"].append({"type": current_section, "header": line, "text": ""})
179
+ elif line.startswith("Creatividad:"):
180
+ current_section = "creativity"
181
+ current_concept["content"].append({"type": current_section, "header": line, "text": ""})
182
+ elif line.startswith("Ejemplo de Titular:"):
183
+ current_section = "headline"
184
+ current_concept["content"].append({"type": current_section, "header": line, "text": ""})
185
+ elif current_section:
186
+ # Add content to the current section
187
+ current_concept["content"][-1]["text"] = line
188
+
189
+ # Add the last concept
190
+ if current_concept["title"]:
191
+ sections.append(current_concept)
192
+
193
+ # Build the HTML
194
+ html = ""
195
+ for concept in sections:
196
+ html += f'<div class="creative-concept-card">'
197
+ html += f'<div class="concept-title">{concept["title"]}</div>'
198
+
199
+ for item in concept["content"]:
200
+ html += f'<div class="concept-section">'
201
+ html += f'<div class="section-header">{item["header"]}</div>'
202
+
203
+ # Apply special styling to analogy text
204
+ if item["type"] == "creativity" and "es como" in item["text"] and "porque" in item["text"]:
205
+ import re
206
+ analogy_pattern = r'([^\.]+es como [^\.]+porque [^\.]+)'
207
+ styled_text = re.sub(analogy_pattern, r'<span class="analogy">\1</span>', item["text"])
208
+ html += f'<div class="section-content">{styled_text}</div>'
209
+ else:
210
+ html += f'<div class="section-content">{item["text"]}</div>'
211
+
212
+ html += '</div>'
213
+
214
+ html += '</div>'
215
+
216
+ # Add custom CSS for the new layout
217
+ css = """
218
+ <style>
219
+ .creative-concept-card {
220
+ background-color: #f8f9fa;
221
+ padding: 1.5rem;
222
+ border-radius: 10px;
223
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
224
+ margin-bottom: 2rem;
225
+ }
226
+
227
+ .concept-title {
228
+ font-size: 1.5rem;
229
+ font-weight: bold;
230
+ color: #2c3e50;
231
+ padding-bottom: 0.5rem;
232
+ border-bottom: 2px solid #3498db;
233
+ margin-bottom: 1.5rem;
234
+ }
235
+
236
+ .concept-section {
237
+ margin-bottom: 1.5rem;
238
+ }
239
+
240
+ .section-header {
241
+ font-size: 1.2rem;
242
+ font-weight: bold;
243
+ color: #3498db;
244
+ margin-bottom: 0.5rem;
245
+ }
246
+
247
+ .section-content {
248
+ font-size: 1.1rem;
249
+ line-height: 1.5;
250
+ }
251
+
252
+ .analogy {
253
+ color: #e74c3c;
254
+ font-weight: bold;
255
+ }
256
+ </style>
257
+ """
258
+
259
+ return css + html
260
+
261
+ def format_story_output(story_text):
262
+ return f"""
263
+ <div class="story-output">
264
+ {story_text}
265
+ </div>
266
  """