JeCabrera commited on
Commit
3c9c086
·
verified ·
1 Parent(s): 36fc645

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -17
app.py CHANGED
@@ -45,9 +45,8 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, temperatu
45
  system_instruction=(
46
  f"You are a world-class copywriter, expert in creating benefits that connect symptoms with problems of {target_audience}. "
47
  f"You deeply understand the emotions, desires, and challenges of {target_audience}, allowing you to design personalized copywriting that resonate and motivate action. "
48
- f"You know how to use proven structures to attract {target_audience}, generating interest and creating a powerful connection with {product}. "
49
- "Generate unusual, creative, and fascinating bullets that capturing {target_audience}'s attention. Respond in Spanish and use a numbered list format. "
50
- f"When responding, always include a heading referencing {target_audience} and the product as follows: 'Aquí hay {num_bullets} bullets para convencer a {target_audience}, de [beneficio de comprar, asistir, descargar, adquirir,] {product}' "
51
  )
52
  )
53
 
@@ -57,20 +56,11 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, temperatu
57
  {
58
  "role": "user",
59
  "parts": [
60
- f"Tu tarea es escribir {num_bullets} bullets que denoten los beneficios del {product} y que tienen la cualidad de fascinar y por lo tanto, fomentan el deseo de adquirir, asistir, descargar o comprar el {product}."
61
- f"Un buen bullet conecta los síntomas con los problemas enfrentados por {target_audience} de una manera natural, que no se note como manipuladora."
62
  f"Escribe bullets creativos, en un estilo conversacional, que no sean aburridos, sino más bien divertidos. "
63
- f"Sé sutil a la hora de crear los bullets para referirte a los beneficios del {product}. "
64
- f"Usa estos ejemplos como inspiración: {', '.join(selected_bullets)}." # Añadir bullets aleatorios
65
- "1. **Connection**: Words that highlight the relationship between the product and the benefit for the user (e.g., 'Improve,' 'Transform').\n"
66
- "2. **Benefit**: Explain how the user will benefit by attending, downloading, or purchasing the product.\n\n"
67
- "Ensure each bullet follows the structure of 'Connection + connector + Benefit,' and avoid including explanations like 'Connection: Improve' or 'Benefit: Increase my happiness.'\n"
68
- "Important: Only respond with bullets, never include explanations or categories, like this example: 'Attend the masterclass and discover techniques to boost your professional career.' (This bullet appeals to the desire for personal and professional growth.)\n"
69
- "Use these guidelines to generate high-converting bullets in Spanish."
70
- "Important: 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.' "
71
- "Bullets should vary, based on these examples to guide your task of creating bullets:\n\n"
72
- f"* {', '.join(selected_bullets)} "
73
- # Añadir más ejemplos si es necesario
74
  "Por favor, crea los bullets ahora."
75
  ],
76
  },
@@ -78,7 +68,7 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, temperatu
78
  )
79
 
80
  # Crear un mensaje para el modelo que incluye los bullets generados
81
- response = model.generate_content(chat_session.history) # Aquí usamos el historial del chat
82
 
83
  if response and response.parts:
84
  return response.parts[0].text
 
45
  system_instruction=(
46
  f"You are a world-class copywriter, expert in creating benefits that connect symptoms with problems of {target_audience}. "
47
  f"You deeply understand the emotions, desires, and challenges of {target_audience}, allowing you to design personalized copywriting that resonate and motivate action. "
48
+ "Generate unusual, creative, and fascinating bullets that capture {target_audience}'s attention. Respond in Spanish and use a numbered list format. "
49
+ f"When responding, always include a heading referencing {target_audience} as follows: 'Aquí hay {num_bullets} bullets para convencer a {target_audience}.'"
 
50
  )
51
  )
52
 
 
56
  {
57
  "role": "user",
58
  "parts": [
59
+ f"Tu tarea es escribir {num_bullets} bullets que denoten los beneficios que resolverán los problemas de {target_audience}. "
60
+ "Un buen bullet conecta los síntomas con los problemas enfrentados por {target_audience} de una manera natural, que no se note como manipuladora. "
61
  f"Escribe bullets creativos, en un estilo conversacional, que no sean aburridos, sino más bien divertidos. "
62
+ "Sé sutil a la hora de crear los bullets para referirte a los beneficios de tu oferta. "
63
+ f"Usa estos ejemplos como inspiración: {', '.join(selected_bullets)}. "
 
 
 
 
 
 
 
 
 
64
  "Por favor, crea los bullets ahora."
65
  ],
66
  },
 
68
  )
69
 
70
  # Crear un mensaje para el modelo que incluye los bullets generados
71
+ response = model.generate_content(chat_session.history)
72
 
73
  if response and response.parts:
74
  return response.parts[0].text