Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,26 +71,17 @@ def get_gemini_response_bullets(target_audience, product, num_bullets, temperatu
|
|
71 |
)
|
72 |
)
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
)
|
86 |
-
|
87 |
-
# Crear un mensaje para el modelo que incluye los bullets generados
|
88 |
-
response = model.generate_content(chat_session.history)
|
89 |
-
|
90 |
-
if response and response.parts:
|
91 |
-
return response.parts[0].text
|
92 |
-
else:
|
93 |
-
raise ValueError("Lo sentimos, intenta con una combinaci贸n diferente de entradas.")
|
94 |
|
95 |
# Inicializar la aplicaci贸n Streamlit
|
96 |
st.set_page_config(page_title="Generador de Bullets", layout="wide")
|
|
|
71 |
)
|
72 |
)
|
73 |
|
74 |
+
# Crear un mensaje para el modelo que incluye los bullets generados seg煤n los tipos seleccionados
|
75 |
+
bullets_instruction = (
|
76 |
+
f"Tu tarea es crear {num_bullets} bullets que denoten los beneficios que resolver谩n los problemas de {target_audience}. "
|
77 |
+
"Aseg煤rate de que cada bullet sea atractivo y siga el estilo conversacional."
|
78 |
+
)
|
79 |
+
|
80 |
+
# Generar el resultado utilizando el modelo con la instrucci贸n de bullet espec铆fica
|
81 |
+
try:
|
82 |
+
response = model.generate_content([bullets_instruction])
|
83 |
+
except Exception as e:
|
84 |
+
raise ValueError("Error generando el contenido: " + str(e))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
# Inicializar la aplicaci贸n Streamlit
|
87 |
st.set_page_config(page_title="Generador de Bullets", layout="wide")
|