JeCabrera commited on
Commit
8f12b84
verified
1 Parent(s): 61f706c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -1
app.py CHANGED
@@ -40,7 +40,51 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, creativit
40
 
41
  model = genai.GenerativeModel(model_choice)
42
 
43
- # System Prompt - Instrucci贸n en ingl茅s para el modelo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  system_instruction = """
45
  You are a world-class copywriter, expert in creating benefits that connect symptoms with problems. You deeply understand the emotions, desires, and challenges of a specific audience, allowing you to design personalized marketing strategies that resonate and motivate action. You know how to use proven structures to attract your target audience, generating interest and creating a powerful connection.
46
  Generate unusual, creative, and fascinating bullets that subtly hint at the product without direct mention, capturing readers' attention. Respond in Spanish and use a numbered list format. 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.'.
 
40
 
41
  model = genai.GenerativeModel(model_choice)
42
 
43
+ # Configuraci贸n del modelo generativo y las instrucciones del sistema
44
+ model = genai.GenerativeModel(
45
+ model_name="gemini-1.5-flash", # Nombre del modelo que estamos utilizando
46
+ generation_config=generation_config, # Configuraci贸n de generaci贸n
47
+ system_instruction = (f"""
48
+ You are a world-class copywriter, expert in creating benefits that connect symptoms with problems of {target_audience}. You deeply understand the emotions, desires, and challenges of {target_audience}, allowing you to design personalized copywriting that resonate and motivate action. 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. 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.'
50
+ "Los bullets deben ser de los siguientes tipos: "
51
+ "* 'El armario del ba帽o es el mejor lugar para guardar medicamentos, 驴verdad? Incorrecto. Es el peor. "
52
+ "Los hechos est谩n en la p谩gina 10.' "
53
+ "* 'El mejor tiempo verbal que le da a tus clientes la sensaci贸n de que ya te han comprado.' "
54
+ "* 'La historia de...', 'Los misterios de...', 'La leyenda de...' "
55
+ "* 'Un sistema simple para escribir textos sin intentar convencerlos de comprar.' "
56
+ "* Verdad: 'La verdad que nunca te han contado en la escuela, o en casa, sobre c贸mo ganarte la vida con la m煤sica.' "
57
+ "* '驴Sab铆as que...' "
58
+ "* '驴Cu谩ndo es una buena idea decirle a una chica que te gusta? Si no se lo dices en ese momento, desp铆dete de conocerla 铆ntimamente.' "
59
+ f"Usando {mention_instruction} cuando desees mencionar {product}. "
60
+ f"Usa las siguientes instrucciones de menci贸n para guiar tu escritura: {mention_instruction} "
61
+ f"Usando el tipo de menci贸n '{product_mention}' para guiar c贸mo mencionar el producto en los beneficios o bullets. "
62
+ f"Al responder, siempre incluye un encabezado que haga referencia a {target_audience} y el producto de la siguiente manera: "
63
+ f"'Aqu铆 tienes 5 bullets para {target_audience}, que aumenten el deseo de adquirir el {product}, usando la menci贸n indirecta:' "
64
+
65
+ """
66
+ )
67
+ )
68
+
69
+ # Crear el prompt para generar bullets
70
+ bullets_instruction = (
71
+ f"Tu tarea es escribir {num_bullets} beneficios o bullets que conecten el s铆ntoma con el problema enfrentado por {target_audience}, "
72
+ f"aumentando su deseo de adquirir, asistir, descargar o comprar el {product}. "
73
+ f"Escribe los bullets con un nivel de creatividad {creativity}. "
74
+ "Aseg煤rate de que la menci贸n se adapte seg煤n este tipo: "
75
+ "Por favor, crea los bullets ahora."
76
+ )
77
+
78
+ # Selecci贸n aleatoria de tipos de menci贸n, manteniendo variedad en la salida
79
+ product_mention = get_random_product_mention()
80
+
81
+ # Crear un mensaje para el modelo que incluye los bullets generados seg煤n los tipos seleccionados
82
+ full_prompt = f"{system_instruction}\n{bullets_instruction}"
83
+
84
+
85
+
86
+
87
+ # System Prompt - Instrucci贸n en ingl茅s para el modelo
88
  system_instruction = """
89
  You are a world-class copywriter, expert in creating benefits that connect symptoms with problems. You deeply understand the emotions, desires, and challenges of a specific audience, allowing you to design personalized marketing strategies that resonate and motivate action. You know how to use proven structures to attract your target audience, generating interest and creating a powerful connection.
90
  Generate unusual, creative, and fascinating bullets that subtly hint at the product without direct mention, capturing readers' attention. Respond in Spanish and use a numbered list format. 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.'.