Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
|
| 17 |
# email_formulas dictionary has been moved to formulas/email_formulas.py
|
| 18 |
|
| 19 |
# Cambiar el nombre de la función
|
| 20 |
-
def generate_emails(target_audience, product, temperature, selected_formula, selected_angle, file_content="", image_parts=None, is_image=False, emotion="", desired_action=""):
|
| 21 |
# Crear la configuración del modelo
|
| 22 |
generation_config = {
|
| 23 |
"temperature": temperature,
|
|
@@ -247,6 +247,12 @@ with col1:
|
|
| 247 |
target_audience = st.text_input("¿Quién es tu público objetivo?", placeholder="Ejemplo: Estudiantes Universitarios")
|
| 248 |
product = st.text_input("¿Qué producto/servicio estás promocionando?", placeholder="Ejemplo: Curso de Inglés")
|
| 249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
# Removed the number_of_emails selectbox
|
| 251 |
|
| 252 |
# Submit button
|
|
@@ -359,7 +365,7 @@ if submit:
|
|
| 359 |
|
| 360 |
if valid_inputs and selected_formula:
|
| 361 |
try:
|
| 362 |
-
# Update the function call to
|
| 363 |
generated_emails = generate_emails(
|
| 364 |
target_audience,
|
| 365 |
product,
|
|
@@ -370,9 +376,25 @@ if submit:
|
|
| 370 |
image_parts if 'image_parts' in locals() else None,
|
| 371 |
is_image if 'is_image' in locals() else False,
|
| 372 |
emotion,
|
| 373 |
-
desired_action
|
|
|
|
| 374 |
)
|
| 375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 376 |
# Remove the inline CSS since we've moved it to main.css
|
| 377 |
|
| 378 |
col2.markdown(f"""
|
|
|
|
| 17 |
# email_formulas dictionary has been moved to formulas/email_formulas.py
|
| 18 |
|
| 19 |
# Cambiar el nombre de la función
|
| 20 |
+
def generate_emails(target_audience, product, temperature, selected_formula, selected_angle, file_content="", image_parts=None, is_image=False, emotion="", desired_action="", creative_idea=""):
|
| 21 |
# Crear la configuración del modelo
|
| 22 |
generation_config = {
|
| 23 |
"temperature": temperature,
|
|
|
|
| 247 |
target_audience = st.text_input("¿Quién es tu público objetivo?", placeholder="Ejemplo: Estudiantes Universitarios")
|
| 248 |
product = st.text_input("¿Qué producto/servicio estás promocionando?", placeholder="Ejemplo: Curso de Inglés")
|
| 249 |
|
| 250 |
+
# Add new Creative Idea input field
|
| 251 |
+
creative_idea = st.text_area("Idea Creativa", placeholder="Ejemplo: Tu curso es como Netflix: ofrece contenido que engancha y soluciones que la gente realmente quiere ver", height=100)
|
| 252 |
+
|
| 253 |
+
# Submit button
|
| 254 |
+
submit = st.button("Generar Emails")
|
| 255 |
+
|
| 256 |
# Removed the number_of_emails selectbox
|
| 257 |
|
| 258 |
# Submit button
|
|
|
|
| 365 |
|
| 366 |
if valid_inputs and selected_formula:
|
| 367 |
try:
|
| 368 |
+
# Update the function call to include creative_idea
|
| 369 |
generated_emails = generate_emails(
|
| 370 |
target_audience,
|
| 371 |
product,
|
|
|
|
| 376 |
image_parts if 'image_parts' in locals() else None,
|
| 377 |
is_image if 'is_image' in locals() else False,
|
| 378 |
emotion,
|
| 379 |
+
desired_action,
|
| 380 |
+
creative_idea # Add the creative idea parameter
|
| 381 |
)
|
| 382 |
|
| 383 |
+
# Add creative idea to the prompt if provided
|
| 384 |
+
if creative_idea:
|
| 385 |
+
email_instruction += f"""
|
| 386 |
+
CREATIVE CONCEPT:
|
| 387 |
+
Use the following creative concept as the central theme for all emails in the sequence:
|
| 388 |
+
"{creative_idea}"
|
| 389 |
+
|
| 390 |
+
CREATIVE CONCEPT INSTRUCTIONS:
|
| 391 |
+
1. This concept should be the unifying theme across all emails
|
| 392 |
+
2. Use it as a metaphor or analogy throughout the sequence
|
| 393 |
+
3. Develop different aspects of this concept in each email
|
| 394 |
+
4. Make sure the concept naturally connects to the product benefits
|
| 395 |
+
5. The concept should make the emails more memorable and engaging
|
| 396 |
+
|
| 397 |
+
"""
|
| 398 |
# Remove the inline CSS since we've moved it to main.css
|
| 399 |
|
| 400 |
col2.markdown(f"""
|