Update app.py
Browse files
app.py
CHANGED
|
@@ -328,23 +328,35 @@ IMPORTANT:
|
|
| 328 |
- Adapt speaking language from the audience
|
| 329 |
- Focus on transformative benefits"""
|
| 330 |
|
| 331 |
-
# Modificar el headlines_instruction para
|
| 332 |
headlines_instruction = (
|
| 333 |
f"{system_prompt}\n\n"
|
| 334 |
f"Tu tarea es crear {number_of_headlines} titulares irresistibles diseñados para {target_audience}. "
|
| 335 |
f"El objetivo es capturar la atención instantáneamente y generar curiosidad sobre {product}. "
|
| 336 |
f"Evita menciones obvias de {product} y enfócate en despertar interés genuino.\n\n"
|
| 337 |
-
f"
|
| 338 |
-
f"
|
| 339 |
)
|
| 340 |
|
| 341 |
-
# Agregar
|
| 342 |
-
|
| 343 |
-
random_examples = random.sample(selected_formula['examples'], min(
|
|
|
|
|
|
|
| 344 |
for i, example in enumerate(random_examples, 1):
|
| 345 |
headlines_instruction += f"{i}. {example}\n"
|
| 346 |
|
| 347 |
-
headlines_instruction += "\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
|
| 349 |
chat_session = model.start_chat(
|
| 350 |
history=[
|
|
@@ -355,7 +367,7 @@ IMPORTANT:
|
|
| 355 |
]
|
| 356 |
)
|
| 357 |
|
| 358 |
-
response = chat_session.send_message("Genera los titulares")
|
| 359 |
return response.text
|
| 360 |
|
| 361 |
# Configurar la interfaz de usuario con Streamlit
|
|
|
|
| 328 |
- Adapt speaking language from the audience
|
| 329 |
- Focus on transformative benefits"""
|
| 330 |
|
| 331 |
+
# Modificar el headlines_instruction para enfatizar los ejemplos
|
| 332 |
headlines_instruction = (
|
| 333 |
f"{system_prompt}\n\n"
|
| 334 |
f"Tu tarea es crear {number_of_headlines} titulares irresistibles diseñados para {target_audience}. "
|
| 335 |
f"El objetivo es capturar la atención instantáneamente y generar curiosidad sobre {product}. "
|
| 336 |
f"Evita menciones obvias de {product} y enfócate en despertar interés genuino.\n\n"
|
| 337 |
+
f"IMPORTANTE: Estudia cuidadosamente estos ejemplos modelo de la fórmula seleccionada. "
|
| 338 |
+
f"Cada ejemplo representa el estilo, estructura y tono exacto que debes seguir:\n\n"
|
| 339 |
)
|
| 340 |
|
| 341 |
+
# Agregar 5 ejemplos aleatorios con análisis
|
| 342 |
+
import random
|
| 343 |
+
random_examples = random.sample(selected_formula['examples'], min(5, len(selected_formula['examples'])))
|
| 344 |
+
|
| 345 |
+
headlines_instruction += "EJEMPLOS MODELO A SEGUIR:\n"
|
| 346 |
for i, example in enumerate(random_examples, 1):
|
| 347 |
headlines_instruction += f"{i}. {example}\n"
|
| 348 |
|
| 349 |
+
headlines_instruction += "\nINSTRUCCIONES ESPECÍFICAS:\n"
|
| 350 |
+
headlines_instruction += "1. Mantén la misma estructura y longitud que los ejemplos anteriores\n"
|
| 351 |
+
headlines_instruction += "2. Usa el mismo tono y estilo de escritura\n"
|
| 352 |
+
headlines_instruction += "3. Replica los patrones de construcción de frases\n"
|
| 353 |
+
headlines_instruction += "4. Conserva el nivel de especificidad y detalle\n"
|
| 354 |
+
headlines_instruction += f"5. Adapta el contenido para {target_audience} manteniendo la esencia de los ejemplos\n\n"
|
| 355 |
+
|
| 356 |
+
headlines_instruction += f"FÓRMULA A SEGUIR:\n{selected_formula['description']}\n\n"
|
| 357 |
+
|
| 358 |
+
headlines_instruction += "GENERA AHORA:\n"
|
| 359 |
+
headlines_instruction += f"Crea {number_of_headlines} titulares que sigan fielmente el estilo y estructura de los ejemplos mostrados."
|
| 360 |
|
| 361 |
chat_session = model.start_chat(
|
| 362 |
history=[
|
|
|
|
| 367 |
]
|
| 368 |
)
|
| 369 |
|
| 370 |
+
response = chat_session.send_message("Genera los titulares siguiendo exactamente el estilo de los ejemplos mostrados.")
|
| 371 |
return response.text
|
| 372 |
|
| 373 |
# Configurar la interfaz de usuario con Streamlit
|