Spaces:
Running
Running
Upload 17 files
Browse files- README.md +2 -2
- app.py +16 -23
- bonuses/generator.py +1 -1
- formulas.py +9 -0
- prompts.py +88 -1
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title: Great Offer
|
3 |
emoji: 🚀
|
4 |
colorFrom: yellow
|
5 |
colorTo: gray
|
6 |
sdk: streamlit
|
7 |
-
sdk_version: 1.43.
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: mit
|
|
|
1 |
---
|
2 |
+
title: Great Offer
|
3 |
emoji: 🚀
|
4 |
colorFrom: yellow
|
5 |
colorTo: gray
|
6 |
sdk: streamlit
|
7 |
+
sdk_version: 1.43.1
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: mit
|
app.py
CHANGED
@@ -216,30 +216,29 @@ with col2:
|
|
216 |
if hasattr(st.session_state, 'file_content') and st.session_state.input_type in ["file", "both"]:
|
217 |
file_content = st.session_state.file_content
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
# Get the instruction using the formula
|
220 |
-
|
|
|
|
|
|
|
221 |
target_audience=target_audience_value,
|
222 |
product_service=product_service_value,
|
223 |
selected_formula_name=st.session_state.formula_type,
|
224 |
file_content=file_content,
|
|
|
|
|
225 |
skills=skills_value,
|
226 |
sophistication_level=st.session_state.sophistication_level if hasattr(st.session_state, 'sophistication_level') else None
|
227 |
)
|
228 |
-
|
229 |
-
# Add instruction for generating benefit bullets based on the promise
|
230 |
-
bullet_content = None
|
231 |
-
if hasattr(st.session_state, 'file_content') and st.session_state.input_type in ["file", "both"]:
|
232 |
-
bullet_content = st.session_state.file_content
|
233 |
-
|
234 |
-
instruction += create_bullet_instruction(
|
235 |
-
target_audience=target_audience_value,
|
236 |
-
product_service=product_service_value,
|
237 |
-
uploaded_content=bullet_content,
|
238 |
-
skills=skills_value
|
239 |
-
)
|
240 |
-
|
241 |
# Validar componentes de la fórmula Contraste Revelador
|
242 |
-
# Before line 244, make sure situacion is defined
|
243 |
if formula_type == "Contraste Revelador":
|
244 |
# Initialize variables with default empty values if they don't exist
|
245 |
situacion = st.session_state.get('situacion', '')
|
@@ -257,14 +256,8 @@ with col2:
|
|
257 |
if resultado and not any(char.isdigit() for char in resultado):
|
258 |
st.warning("El resultado emocional debe incluir algún número específico como prueba social")
|
259 |
|
260 |
-
#
|
261 |
-
|
262 |
-
target_audience=target_audience_value,
|
263 |
-
product_service=product_service_value,
|
264 |
-
selected_formula_name=st.session_state.formula_type,
|
265 |
-
uploaded_content=bullet_content,
|
266 |
-
skills=skills_value
|
267 |
-
)
|
268 |
|
269 |
try:
|
270 |
generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)
|
|
|
216 |
if hasattr(st.session_state, 'file_content') and st.session_state.input_type in ["file", "both"]:
|
217 |
file_content = st.session_state.file_content
|
218 |
|
219 |
+
# Preparar el contenido para los bullets y bonos
|
220 |
+
bullet_content = None
|
221 |
+
bonus_content = None
|
222 |
+
if hasattr(st.session_state, 'file_content') and st.session_state.input_type in ["file", "both"]:
|
223 |
+
bullet_content = st.session_state.file_content
|
224 |
+
bonus_content = st.session_state.file_content
|
225 |
+
|
226 |
# Get the instruction using the formula
|
227 |
+
from prompts import create_integrated_instruction
|
228 |
+
|
229 |
+
# Construir la instrucción integrada
|
230 |
+
instruction = create_integrated_instruction(
|
231 |
target_audience=target_audience_value,
|
232 |
product_service=product_service_value,
|
233 |
selected_formula_name=st.session_state.formula_type,
|
234 |
file_content=file_content,
|
235 |
+
bullet_content=bullet_content,
|
236 |
+
bonus_content=bonus_content, # Añadir parámetro explícito
|
237 |
skills=skills_value,
|
238 |
sophistication_level=st.session_state.sophistication_level if hasattr(st.session_state, 'sophistication_level') else None
|
239 |
)
|
240 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
# Validar componentes de la fórmula Contraste Revelador
|
|
|
242 |
if formula_type == "Contraste Revelador":
|
243 |
# Initialize variables with default empty values if they don't exist
|
244 |
situacion = st.session_state.get('situacion', '')
|
|
|
256 |
if resultado and not any(char.isdigit() for char in resultado):
|
257 |
st.warning("El resultado emocional debe incluir algún número específico como prueba social")
|
258 |
|
259 |
+
# Eliminar esta instrucción redundante para los bonos
|
260 |
+
# La función create_integrated_instruction ya incluye las instrucciones para los bonos
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
try:
|
263 |
generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)
|
bonuses/generator.py
CHANGED
@@ -44,7 +44,7 @@ For the bonus creation section:
|
|
44 |
You are a world-class expert in creating irresistible bonus packages that increase perceived value and overcome objections.
|
45 |
|
46 |
OBJECTIVE:
|
47 |
-
- Generate
|
48 |
- Each bonus must address a specific objection or accelerate results
|
49 |
- Connect emotionally with the target audience's needs
|
50 |
- Provide tools/templates that reduce effort and time
|
|
|
44 |
You are a world-class expert in creating irresistible bonus packages that increase perceived value and overcome objections.
|
45 |
|
46 |
OBJECTIVE:
|
47 |
+
- Generate 5 compelling and specific bonuses in Spanish
|
48 |
- Each bonus must address a specific objection or accelerate results
|
49 |
- Connect emotionally with the target audience's needs
|
50 |
- Provide tools/templates that reduce effort and time
|
formulas.py
CHANGED
@@ -542,6 +542,15 @@ SPECIFIC INSTRUCTIONS FOR THE UNIQUE VALUE PROPOSITION:
|
|
542 |
4. FORMAT RESTRICTIONS:
|
543 |
- Keep the transformation statement concise and powerful
|
544 |
- Make objections relatable and honest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
"""
|
546 |
}
|
547 |
}
|
|
|
542 |
4. FORMAT RESTRICTIONS:
|
543 |
- Keep the transformation statement concise and powerful
|
544 |
- Make objections relatable and honest
|
545 |
+
- DO NOT include benefits or bonuses sections (these will be handled separately)
|
546 |
+
- Ensure each version is truly unique in its approach
|
547 |
+
|
548 |
+
5. IMPORTANT GUIDELINES:
|
549 |
+
- Create 3 COMPLETELY DIFFERENT versions
|
550 |
+
- Use different action verbs in each promise
|
551 |
+
- Include specific timeframes when possible
|
552 |
+
- DO NOT repeat the same structure or approach between versions
|
553 |
+
- DO NOT include benefits or bonuses sections
|
554 |
"""
|
555 |
}
|
556 |
}
|
prompts.py
CHANGED
@@ -217,4 +217,91 @@ For Propuesta Única de Valor (Nivel {level_num}):
|
|
217 |
# Add the concise guidance to the instruction
|
218 |
instruction += f"\n\nSOPHISTICATION GUIDANCE (NIVEL {level_num}):{formula_specific_guidance}"
|
219 |
|
220 |
-
return instruction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
# Add the concise guidance to the instruction
|
218 |
instruction += f"\n\nSOPHISTICATION GUIDANCE (NIVEL {level_num}):{formula_specific_guidance}"
|
219 |
|
220 |
+
return instruction
|
221 |
+
|
222 |
+
|
223 |
+
def create_integrated_instruction(target_audience=None, product_service=None, selected_formula_name=None,
|
224 |
+
file_content=None, bullet_content=None, bonus_content=None, skills=None,
|
225 |
+
sophistication_level=None):
|
226 |
+
"""
|
227 |
+
Crea una instrucción integrada que combina la oferta principal, los beneficios y los bonos
|
228 |
+
con un formato consistente para todas las fórmulas.
|
229 |
+
|
230 |
+
Args:
|
231 |
+
target_audience: Descripción del público objetivo
|
232 |
+
product_service: Información del producto/servicio
|
233 |
+
selected_formula_name: Nombre de la fórmula seleccionada
|
234 |
+
file_content: Contenido de archivos subidos para la oferta principal
|
235 |
+
bullet_content: Contenido de archivos subidos para los beneficios
|
236 |
+
bonus_content: Contenido de archivos subidos para los bonos
|
237 |
+
skills: Habilidades y experiencia del usuario
|
238 |
+
sophistication_level: Nivel de sofisticación del mercado
|
239 |
+
|
240 |
+
Returns:
|
241 |
+
str: Instrucción completa e integrada
|
242 |
+
"""
|
243 |
+
from bullets.generator import create_bullet_instruction
|
244 |
+
from bonuses.generator import create_bonus_instruction
|
245 |
+
|
246 |
+
# Crear la instrucción base para la oferta principal
|
247 |
+
offer_instruction = create_offer_instruction(
|
248 |
+
target_audience=target_audience,
|
249 |
+
product_service=product_service,
|
250 |
+
selected_formula_name=selected_formula_name,
|
251 |
+
file_content=file_content,
|
252 |
+
skills=skills,
|
253 |
+
sophistication_level=sophistication_level
|
254 |
+
)
|
255 |
+
|
256 |
+
# Crear instrucciones para los beneficios
|
257 |
+
bullet_instruction = create_bullet_instruction(
|
258 |
+
target_audience=target_audience,
|
259 |
+
product_service=product_service,
|
260 |
+
selected_formula_name=selected_formula_name,
|
261 |
+
uploaded_content=file_content, # Usar el mismo contenido que para la oferta principal
|
262 |
+
skills=skills
|
263 |
+
)
|
264 |
+
|
265 |
+
# Crear instrucciones para los bonos
|
266 |
+
bonus_instruction = create_bonus_instruction(
|
267 |
+
target_audience=target_audience,
|
268 |
+
product_service=product_service,
|
269 |
+
selected_formula_name=selected_formula_name,
|
270 |
+
uploaded_content=file_content, # Usar el mismo contenido que para la oferta principal
|
271 |
+
skills=skills
|
272 |
+
)
|
273 |
+
|
274 |
+
# Instrucción de integración que especifica el formato exacto para todas las fórmulas
|
275 |
+
integration_instruction = f"""
|
276 |
+
INSTRUCCIÓN DE INTEGRACIÓN IMPORTANTE:
|
277 |
+
|
278 |
+
Para cada una de las 3 versiones de oferta que generes, sigue EXACTAMENTE esta estructura:
|
279 |
+
|
280 |
+
VERSIÓN X:
|
281 |
+
[Promesa principal según la fórmula {selected_formula_name}]
|
282 |
+
|
283 |
+
BENEFICIOS:
|
284 |
+
• [Beneficio específico 1]
|
285 |
+
• [Beneficio específico 2]
|
286 |
+
• [Beneficio específico 3]
|
287 |
+
• [Beneficio específico 4]
|
288 |
+
• [Beneficio específico 5]
|
289 |
+
|
290 |
+
BONOS:
|
291 |
+
• BONO #1: [NOMBRE ATRACTIVO] - [Descripción breve] - Valor: $X
|
292 |
+
• BONO #2: [NOMBRE ATRACTIVO] - [Descripción breve] - Valor: $X
|
293 |
+
• BONO #3: [NOMBRE ATRACTIVO] - [Descripción breve] - Valor: $X
|
294 |
+
|
295 |
+
Valor total de bonos: $XXX - Todo incluido con tu inversión hoy.
|
296 |
+
|
297 |
+
IMPORTANTE:
|
298 |
+
- Mantén esta estructura exacta para TODAS las fórmulas, incluyendo Propuesta Única de Valor
|
299 |
+
- Cada versión debe tener su propia sección de BENEFICIOS y BONOS
|
300 |
+
- Presenta las 3 versiones completas una tras otra
|
301 |
+
- No incluyas explicaciones o comentarios adicionales
|
302 |
+
"""
|
303 |
+
|
304 |
+
# Combinar todas las instrucciones
|
305 |
+
complete_instruction = offer_instruction + "\n\n" + bullet_instruction + "\n\n" + bonus_instruction + "\n\n" + integration_instruction
|
306 |
+
|
307 |
+
return complete_instruction
|