Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,20 @@ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
|
| 11 |
def generate_benefits(focus_points, product, target_audience, creativity, num_bullets):
|
| 12 |
model = genai.GenerativeModel("gemini-1.5-flash")
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Base del prompt para generar los bullets persuasivos
|
| 15 |
prompt_base = f"""
|
| 16 |
-
Eres un experto en copywriting y tu objetivo es crear bullets persuasivos que destaquen los beneficios del {product},
|
| 17 |
conecten emocionalmente con la audiencia {target_audience} y respondan a sus problemas, necesidades, deseos o situaciones espec铆ficas.\n\n
|
| 18 |
Ten en cuenta lo siguiente:\n
|
| 19 |
- Los bullets deben ser breves, concisos, como minititulares que impacten a la audiencia.\n
|
|
@@ -40,6 +51,7 @@ def generate_benefits(focus_points, product, target_audience, creativity, num_bu
|
|
| 40 |
"max_output_tokens": 2048, # Limitar a 50 tokens para que el bullet sea corto
|
| 41 |
"response_mime_type": "text/plain", # Respuesta en texto plano
|
| 42 |
},
|
|
|
|
| 43 |
)
|
| 44 |
|
| 45 |
# Generar los beneficios con la API de Google
|
|
|
|
| 11 |
def generate_benefits(focus_points, product, target_audience, creativity, num_bullets):
|
| 12 |
model = genai.GenerativeModel("gemini-1.5-flash")
|
| 13 |
|
| 14 |
+
# Instrucci贸n del sistema para el modelo
|
| 15 |
+
system_instruction = (
|
| 16 |
+
"You are a world-class copywriter, with expertise in crafting hooks, headlines, and subject lines that immediately "
|
| 17 |
+
"capture the reader's attention, prompting them to open the email or continue reading. Your skill lies in deeply understanding "
|
| 18 |
+
"the emotions, desires, and challenges of a specific audience. You are also an expert in creating benefits that connect symptoms "
|
| 19 |
+
"with problems, allowing you to design personalized strategies that resonate and motivate action. You know how to use proven "
|
| 20 |
+
"structures to attract your target audience, generating interest and creating a powerful connection. Your task is to generate "
|
| 21 |
+
"unusual, creative, and fascinating subject lines or headlines that spark curiosity and encourage the reader to engage further. "
|
| 22 |
+
"Respond in Spanish and use a numbered list format. Important: Only answer with subject lines, never include explanations or categories."
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
# Base del prompt para generar los bullets persuasivos
|
| 26 |
prompt_base = f"""
|
| 27 |
+
Eres un experto en copywriting y tu objetivo es crear {num_bullets} bullets persuasivos que destaquen los beneficios del {product},
|
| 28 |
conecten emocionalmente con la audiencia {target_audience} y respondan a sus problemas, necesidades, deseos o situaciones espec铆ficas.\n\n
|
| 29 |
Ten en cuenta lo siguiente:\n
|
| 30 |
- Los bullets deben ser breves, concisos, como minititulares que impacten a la audiencia.\n
|
|
|
|
| 51 |
"max_output_tokens": 2048, # Limitar a 50 tokens para que el bullet sea corto
|
| 52 |
"response_mime_type": "text/plain", # Respuesta en texto plano
|
| 53 |
},
|
| 54 |
+
system_instruction=system_instruction
|
| 55 |
)
|
| 56 |
|
| 57 |
# Generar los beneficios con la API de Google
|