JeCabrera commited on
Commit
e32a9cf
·
verified ·
1 Parent(s): 0b8f73f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
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
- 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([f"{tipo}: " + ", ".join(ejemplos) for tipo, ejemplos in headline_types.items()])
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