Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,20 @@ def get_gemini_response(target_audience, product, product_mention, text_type, le
|
|
20 |
elif product_mention == "Metaf贸rica":
|
21 |
mention_instruction = f"Refer to the product '{product}' through a metaphor without explicitly mentioning it."
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
# Crear el prompt completo basado en los campos del frontend
|
24 |
full_prompt = f"""
|
25 |
-
You are a creative writer skilled in the art of persuasion. Write a {length} {text_type} in Spanish. The tone of the {text_type} should be {mood} and carefully crafted to emotionally resonate with a {target_audience}. {mention_instruction} Use persuasive techniques to guide the reader towards an intuitive understanding of the product's benefits, focusing on creating a strong emotional connection with the audience.
|
26 |
"""
|
27 |
|
28 |
response = model.generate_content([full_prompt])
|
@@ -76,7 +87,8 @@ with col1:
|
|
76 |
# Variable para c贸mo se debe mencionar el producto
|
77 |
product_mention = st.selectbox("Menci贸n del producto:", ["Directa", "Indirecta", "Metaf贸rica"])
|
78 |
|
79 |
-
|
|
|
80 |
length = st.selectbox("Longitud del texto:", ["Corto", "Largo"])
|
81 |
mood = st.selectbox("Tono del Texto:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Rom谩ntico"])
|
82 |
|
|
|
20 |
elif product_mention == "Metaf贸rica":
|
21 |
mention_instruction = f"Refer to the product '{product}' through a metaphor without explicitly mentioning it."
|
22 |
|
23 |
+
# Instrucci贸n espec铆fica para el tipo de texto
|
24 |
+
format_instruction = ""
|
25 |
+
if text_type == "Historia":
|
26 |
+
format_instruction = "Ensure that the narrative is engaging and includes character development, a clear plot, and a resolution."
|
27 |
+
elif text_type == "Carta de venta":
|
28 |
+
format_instruction = "Craft a compelling sales pitch that highlights the product's benefits and persuades the reader to take action."
|
29 |
+
elif text_type == "Correo":
|
30 |
+
format_instruction = "Write a concise and engaging email that captures the reader's attention and encourages a response."
|
31 |
+
elif text_type == "Landing page":
|
32 |
+
format_instruction = "Design an informative and persuasive landing page that effectively showcases the product and drives conversions."
|
33 |
+
|
34 |
# Crear el prompt completo basado en los campos del frontend
|
35 |
full_prompt = f"""
|
36 |
+
You are a creative writer skilled in the art of persuasion. Write a {length} {text_type} in Spanish. The tone of the {text_type} should be {mood} and carefully crafted to emotionally resonate with a {target_audience}. {mention_instruction} {format_instruction} Use persuasive techniques to guide the reader towards an intuitive understanding of the product's benefits, focusing on creating a strong emotional connection with the audience.
|
37 |
"""
|
38 |
|
39 |
response = model.generate_content([full_prompt])
|
|
|
87 |
# Variable para c贸mo se debe mencionar el producto
|
88 |
product_mention = st.selectbox("Menci贸n del producto:", ["Directa", "Indirecta", "Metaf贸rica"])
|
89 |
|
90 |
+
# Opciones actualizadas para el tipo de texto
|
91 |
+
text_type = st.selectbox("Tipo de texto:", ["Historia", "Carta de venta", "Correo", "Landing page"])
|
92 |
length = st.selectbox("Longitud del texto:", ["Corto", "Largo"])
|
93 |
mood = st.selectbox("Tono del Texto:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Rom谩ntico"])
|
94 |
|