Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,19 +95,19 @@ def generate_headlines(number_of_headlines, target_audience, product, temperatur
|
|
95 |
system_instruction="You are a world-class copywriter with experience in creating hooks, headlines, and subject lines that capture attention immediately. Your skill lies in deeply understanding the emotions, desires, and challenges of a specific audience. Generate unusual, creative, and fascinating headlines that capture readers' attention about the product. Respond in Spanish and use a numbered list format. Important: Only answer with bullets, never include explanations or categories, like this: 'La leyenda del padre soltero: Dice que nunca hay tiempo suficiente. El yoga te enseña a usar mejor el tiempo que tienes, incluso cuando te parece imposible.'."
|
96 |
)
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
|
112 |
response = chat_session.send_message("Genera los titulares") # Enviar mensaje para obtener la respuesta
|
113 |
return response.text # Regresar la respuesta directamente
|
|
|
95 |
system_instruction="You are a world-class copywriter with experience in creating hooks, headlines, and subject lines that capture attention immediately. Your skill lies in deeply understanding the emotions, desires, and challenges of a specific audience. Generate unusual, creative, and fascinating headlines that capture readers' attention about the product. Respond in Spanish and use a numbered list format. Important: Only answer with bullets, never include explanations or categories, like this: 'La leyenda del padre soltero: Dice que nunca hay tiempo suficiente. El yoga te enseña a usar mejor el tiempo que tienes, incluso cuando te parece imposible.'."
|
96 |
)
|
97 |
|
98 |
+
chat_session = model.start_chat(
|
99 |
+
history=[
|
100 |
+
{
|
101 |
+
"role": "user",
|
102 |
+
"parts": [
|
103 |
+
f"Tu tarea es crear {number_of_headlines} ganchos o encabezados titulares llamativos diseñados para {target_audience} con el fin de generar interés en {product}. "
|
104 |
+
f"Usa la siguiente mención: {mention_instruction}. "
|
105 |
+
"Los ganchos deben ser de este tipo: "
|
106 |
+
+ " ".join([", ".join(ejemplos) for ejemplos in headline_types.values()])
|
107 |
+
],
|
108 |
+
},
|
109 |
+
]
|
110 |
+
)
|
111 |
|
112 |
response = chat_session.send_message("Genera los titulares") # Enviar mensaje para obtener la respuesta
|
113 |
return response.text # Regresar la respuesta directamente
|