JeCabrera commited on
Commit
80e5215
·
verified ·
1 Parent(s): c25b879

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -14
app.py CHANGED
@@ -36,17 +36,26 @@ st.markdown("""
36
  <h3 style='text-align: center;'>Escribe una idea y la IA creará una historia única.</h3>
37
  """, unsafe_allow_html=True)
38
 
39
- # Entrada de texto
40
- input_prompt = st.text_area("Escribe de qué quieres que trate la historia:", placeholder="Escribe aquí tu idea...")
41
-
42
- # Opciones de personalización
43
- genre = st.selectbox("Tipo de texto:", ["Historia", "Poema", "Cita", "Ensayo"])
44
- length = st.selectbox("Longitud del texto:", ["Corto", "Largo"])
45
- language = st.selectbox("Idioma del texto:", ["Español", "Inglés"])
46
- mood = st.selectbox("Estado de ánimo:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Romántico"])
47
-
48
- # Botón para generar contenido
49
- if st.button("Generar historia"):
50
- response = get_gemini_response(input_prompt, genre, length, language, mood)
51
- st.subheader("Contenido generado:")
52
- st.write(response)
 
 
 
 
 
 
 
 
 
 
36
  <h3 style='text-align: center;'>Escribe una idea y la IA creará una historia única.</h3>
37
  """, unsafe_allow_html=True)
38
 
39
+ # Crear dos columnas
40
+ col1, col2 = st.columns([1, 1])
41
+
42
+ # Columna izquierda para inputs
43
+ with col1:
44
+ # Entrada de texto
45
+ input_prompt = st.text_area("Escribe de qué quieres que trate la historia:", placeholder="Escribe aquí tu idea...")
46
+
47
+ # Opciones de personalización
48
+ genre = st.selectbox("Tipo de texto:", ["Historia", "Poema", "Cita", "Ensayo"])
49
+ length = st.selectbox("Longitud del texto:", ["Corto", "Largo"])
50
+ language = st.selectbox("Idioma del texto:", ["Español", "Inglés"])
51
+ mood = st.selectbox("Estado de ánimo:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Romántico"])
52
+
53
+ # Botón para generar contenido
54
+ generate_button = st.button("Generar historia")
55
+
56
+ # Columna derecha para la salida
57
+ with col2:
58
+ if generate_button:
59
+ response = get_gemini_response(input_prompt, genre, length, language, mood)
60
+ st.subheader("Contenido generado:")
61
+ st.write(response)