Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ IMPORTANT: Only write the bullets. No headers, no explanations, no types of bull
|
|
| 40 |
"""
|
| 41 |
|
| 42 |
# Funci贸n para obtener una cantidad de bullets
|
| 43 |
-
def get_gemini_response_bullets(target_audience, product, num_bullets, creativity):
|
| 44 |
product_mention = get_random_product_mention()
|
| 45 |
mention_instruction = get_mention_instruction(product_mention, product) # Define aqu铆
|
| 46 |
model_choice = "gemini-1.5-flash" # Modelo por defecto
|
|
@@ -56,7 +56,8 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, creativit
|
|
| 56 |
# Crear el prompt para generar bullets
|
| 57 |
full_prompt = f"""
|
| 58 |
{system_instruction}
|
| 59 |
-
Your task is to create {num_bullets} benefits or bullets that connect the symptom with the problem faced by {target_audience}, increasing their
|
|
|
|
| 60 |
Infuse your responses with a creativity level of {creativity}. The bullets should be of the following types:
|
| 61 |
* 'The bathroom cabinet is the best place to store medicine, right? Incorrect. It's the worst. The facts are on page 10.'
|
| 62 |
* 'The best verb tense that gives your clients the feeling they've already bought from you.'
|
|
@@ -125,6 +126,9 @@ with col1:
|
|
| 125 |
# Campos de entrada
|
| 126 |
target_audience = st.text_input("驴Qui茅n es tu p煤blico objetivo?")
|
| 127 |
product = st.text_input("驴Qu茅 producto tienes en mente?")
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
# Campos de personalizaci贸n sin acorde贸n
|
| 130 |
num_bullets = st.slider("N煤mero de Bullets", min_value=1, max_value=15, value=5)
|
|
@@ -138,7 +142,7 @@ if submit:
|
|
| 138 |
if target_audience and product:
|
| 139 |
try:
|
| 140 |
# Obtener la respuesta del modelo
|
| 141 |
-
generated_bullets = get_gemini_response_bullets(target_audience, product, num_bullets, creativity)
|
| 142 |
col2.markdown(f"""
|
| 143 |
<div style="border: 1px solid #000000; padding: 5px; border-radius: 8px; background-color: #ffffff;">
|
| 144 |
<h4>Mira la magia en acci贸n:</h4>
|
|
|
|
| 40 |
"""
|
| 41 |
|
| 42 |
# Funci贸n para obtener una cantidad de bullets
|
| 43 |
+
def get_gemini_response_bullets(target_audience, product, num_bullets, creativity, desired_action):
|
| 44 |
product_mention = get_random_product_mention()
|
| 45 |
mention_instruction = get_mention_instruction(product_mention, product) # Define aqu铆
|
| 46 |
model_choice = "gemini-1.5-flash" # Modelo por defecto
|
|
|
|
| 56 |
# Crear el prompt para generar bullets
|
| 57 |
full_prompt = f"""
|
| 58 |
{system_instruction}
|
| 59 |
+
Your task is to create {num_bullets} benefits or bullets that connect the symptom with the problem faced by {target_audience}, increasing their curiosity about the {product}.
|
| 60 |
+
The ultimate goal is to inspire the audience to take the following action: {desired_action}.
|
| 61 |
Infuse your responses with a creativity level of {creativity}. The bullets should be of the following types:
|
| 62 |
* 'The bathroom cabinet is the best place to store medicine, right? Incorrect. It's the worst. The facts are on page 10.'
|
| 63 |
* 'The best verb tense that gives your clients the feeling they've already bought from you.'
|
|
|
|
| 126 |
# Campos de entrada
|
| 127 |
target_audience = st.text_input("驴Qui茅n es tu p煤blico objetivo?")
|
| 128 |
product = st.text_input("驴Qu茅 producto tienes en mente?")
|
| 129 |
+
|
| 130 |
+
# A帽adir nuevo campo de entrada para la Acci贸n Deseada
|
| 131 |
+
desired_action = st.text_input("驴Cu谩l es la acci贸n deseada?")
|
| 132 |
|
| 133 |
# Campos de personalizaci贸n sin acorde贸n
|
| 134 |
num_bullets = st.slider("N煤mero de Bullets", min_value=1, max_value=15, value=5)
|
|
|
|
| 142 |
if target_audience and product:
|
| 143 |
try:
|
| 144 |
# Obtener la respuesta del modelo
|
| 145 |
+
generated_bullets = get_gemini_response_bullets(target_audience, product, num_bullets, creativity, desired_action)
|
| 146 |
col2.markdown(f"""
|
| 147 |
<div style="border: 1px solid #000000; padding: 5px; border-radius: 8px; background-color: #ffffff;">
|
| 148 |
<h4>Mira la magia en acci贸n:</h4>
|