Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ curiosities = [
|
|
| 36 |
]
|
| 37 |
|
| 38 |
# Función para generar bullets informativos
|
| 39 |
-
def generate_bullets(number_of_bullets):
|
| 40 |
bullets = []
|
| 41 |
|
| 42 |
for _ in range(number_of_bullets):
|
|
@@ -54,60 +54,34 @@ def generate_bullets(number_of_bullets):
|
|
| 54 |
# Configurar la interfaz de usuario con Streamlit
|
| 55 |
st.set_page_config(page_title="QuickPrompt", layout="wide")
|
| 56 |
|
| 57 |
-
# Agregar el manual en el sidebar con mejor diseño
|
| 58 |
-
st.sidebar.markdown("## **Manual de Usuario para Quick Prompt**")
|
| 59 |
-
st.sidebar.write("""
|
| 60 |
-
**Bienvenido a Quick Prompt**
|
| 61 |
-
Quick Prompt está diseñado para ayudarte a crear bullets informativos que resalten los beneficios, dolores y curiosidades para atraer a tu audiencia.
|
| 62 |
-
|
| 63 |
-
### ¿Por qué son importantes estos bullets?
|
| 64 |
-
Estos bullets son elementos clave para captar la atención de tu audiencia y motivarles a tomar acción. Aquí te mostramos ejemplos de cada categoría:
|
| 65 |
-
- **Beneficios**: Mejora tu productividad diaria con técnicas efectivas.
|
| 66 |
-
- **Puntos de Dolor**: ¿Te sientes abrumado por la falta de organización?
|
| 67 |
-
- **Datos Curiosos**: ¿Sabías que el 70% de las personas no logran sus objetivos anuales?
|
| 68 |
-
|
| 69 |
-
### ¿Cómo utilizar Quick Prompt?
|
| 70 |
-
Sigue estos pasos para obtener resultados efectivos:
|
| 71 |
-
|
| 72 |
-
1. **Define tu público objetivo**
|
| 73 |
-
Reflexiona sobre quiénes son y qué necesitan.
|
| 74 |
-
|
| 75 |
-
2. **Especifica el número de bullets que deseas generar**
|
| 76 |
-
Determina cuántos bullets necesitas para tu mensaje.
|
| 77 |
-
|
| 78 |
-
3. **Generar los bullets**
|
| 79 |
-
Haz clic en el botón para obtener los bullets informativos.
|
| 80 |
-
""")
|
| 81 |
-
|
| 82 |
-
# Footer del manual
|
| 83 |
-
st.sidebar.write("Transforma tu mensaje con bullets que conectan con tu audiencia.")
|
| 84 |
-
|
| 85 |
-
# Centrar el título y el subtítulo
|
| 86 |
-
st.markdown("<h1 style='text-align: center;'>Quick Prompt</h1>", unsafe_allow_html=True)
|
| 87 |
-
st.markdown("<h4 style='text-align: center;'>Genera bullets que cautiven y motiven a tu audiencia.</h4>", unsafe_allow_html=True)
|
| 88 |
-
|
| 89 |
# Crear columnas
|
| 90 |
col1, col2 = st.columns([1, 2])
|
| 91 |
|
| 92 |
# Columnas de entrada
|
| 93 |
with col1:
|
|
|
|
|
|
|
|
|
|
| 94 |
number_of_bullets = st.selectbox("Número de bullets informativos", options=[1, 2, 3, 4, 5], index=2)
|
| 95 |
-
|
| 96 |
# Botón de enviar
|
| 97 |
submit = st.button("Generar Bullets")
|
| 98 |
|
| 99 |
# Mostrar los bullets generados
|
| 100 |
if submit:
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
<
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
]
|
| 37 |
|
| 38 |
# Función para generar bullets informativos
|
| 39 |
+
def generate_bullets(target_audience, product, call_to_action, number_of_bullets):
|
| 40 |
bullets = []
|
| 41 |
|
| 42 |
for _ in range(number_of_bullets):
|
|
|
|
| 54 |
# Configurar la interfaz de usuario con Streamlit
|
| 55 |
st.set_page_config(page_title="QuickPrompt", layout="wide")
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
# Crear columnas
|
| 58 |
col1, col2 = st.columns([1, 2])
|
| 59 |
|
| 60 |
# Columnas de entrada
|
| 61 |
with col1:
|
| 62 |
+
target_audience = st.text_input("¿Quién es tu público objetivo?", placeholder="Ejemplo: Estudiantes Universitarios")
|
| 63 |
+
product = st.text_input("¿Qué producto tienes en mente?", placeholder="Ejemplo: Curso de Inglés")
|
| 64 |
+
call_to_action = st.text_input("¿Qué acción deseas que tomen?", placeholder="Ejemplo: Inscribirse al curso")
|
| 65 |
number_of_bullets = st.selectbox("Número de bullets informativos", options=[1, 2, 3, 4, 5], index=2)
|
| 66 |
+
|
| 67 |
# Botón de enviar
|
| 68 |
submit = st.button("Generar Bullets")
|
| 69 |
|
| 70 |
# Mostrar los bullets generados
|
| 71 |
if submit:
|
| 72 |
+
if target_audience and product and call_to_action:
|
| 73 |
+
try:
|
| 74 |
+
# Obtener la respuesta del modelo
|
| 75 |
+
generated_bullets = generate_bullets(target_audience, product, call_to_action, number_of_bullets)
|
| 76 |
+
col2.markdown(f"""
|
| 77 |
+
<div style="border: 1px solid #000000; padding: 5px; border-radius: 8px; background-color: #ffffff;">
|
| 78 |
+
<h4>Bullets Generados:</h4>
|
| 79 |
+
<ul>
|
| 80 |
+
{''.join(f'<li>{bullet}</li>' for bullet in generated_bullets)}
|
| 81 |
+
</ul>
|
| 82 |
+
</div>
|
| 83 |
+
""", unsafe_allow_html=True)
|
| 84 |
+
except Exception as e:
|
| 85 |
+
col2.error(f"Error inesperado: {str(e)}")
|
| 86 |
+
else:
|
| 87 |
+
col2.warning("Por favor, completa todos los campos.")
|