Update app.py
Browse files
app.py
CHANGED
|
@@ -240,31 +240,31 @@ IMPORTANT:
|
|
| 240 |
- Focus on transformative benefits"""
|
| 241 |
|
| 242 |
# Crear un mensaje para el modelo
|
| 243 |
-
headlines_instruction = (
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
)
|
| 255 |
-
|
| 256 |
-
# Crear la sesión de chat
|
| 257 |
-
chat_session = model.start_chat(
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
)
|
| 265 |
|
| 266 |
-
response = chat_session.send_message("Genera los titulares")
|
| 267 |
-
return response.text
|
| 268 |
|
| 269 |
# Configurar la interfaz de usuario con Streamlit
|
| 270 |
st.set_page_config(page_title="Enchanted Hooks", layout="wide")
|
|
|
|
| 240 |
- Focus on transformative benefits"""
|
| 241 |
|
| 242 |
# Crear un mensaje para el modelo
|
| 243 |
+
headlines_instruction = (
|
| 244 |
+
f"{system_prompt}\n\n"
|
| 245 |
+
f"Tu tarea es crear {number_of_headlines} titulares irresistibles diseñados para {target_audience}. "
|
| 246 |
+
f"El objetivo es capturar la atención instantáneamente y generar curiosidad sobre {product}. "
|
| 247 |
+
f"Evita menciones obvias del producto y enfócate en despertar interés genuino. "
|
| 248 |
+
f"Usa la fórmula seleccionada como guía:\n\n{selected_formula['description']}\n\n"
|
| 249 |
+
f"Inspírate en estos ejemplos:\n"
|
| 250 |
+
f"1. {selected_formula['examples'][0]}\n"
|
| 251 |
+
f"2. {selected_formula['examples'][1]}\n"
|
| 252 |
+
f"3. {selected_formula['examples'][2]}\n\n"
|
| 253 |
+
f"Tu objetivo es crear titulares tan intrigantes que sea imposible no seguir leyendo."
|
| 254 |
+
)
|
| 255 |
+
|
| 256 |
+
# Crear la sesión de chat
|
| 257 |
+
chat_session = model.start_chat(
|
| 258 |
+
history=[
|
| 259 |
+
{
|
| 260 |
+
"role": "user",
|
| 261 |
+
"parts": [headlines_instruction],
|
| 262 |
+
},
|
| 263 |
+
]
|
| 264 |
+
)
|
| 265 |
|
| 266 |
+
response = chat_session.send_message("Genera los titulares")
|
| 267 |
+
return response.text # Este return debe estar dentro de la función
|
| 268 |
|
| 269 |
# Configurar la interfaz de usuario con Streamlit
|
| 270 |
st.set_page_config(page_title="Enchanted Hooks", layout="wide")
|