JeCabrera commited on
Commit
6bb7353
·
verified ·
1 Parent(s): 26ef472

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -86,17 +86,18 @@ st.title("VisionTales: Crea historias inolvidables con IA")
86
  with st.sidebar:
87
  st.header("Personaliza tu texto")
88
  target_audience = st.text_input("¿Quién es tu público objetivo?")
89
- product = st.text_input("Nombre del producto:")
90
- text_type = st.selectbox("Tipo de texto:", ["Historia", "Carta de venta", "Correo", "Landing page"])
91
- length = st.slider("Longitud del texto en palabras:", 50, 1000, 300)
92
- mood = st.selectbox("Estado de ánimo:", ["Feliz", "Triste", "Motivador", "Reflexivo"])
93
- model_choice = st.selectbox("Selecciona el modelo:", ["gemini-1.5-flash", "gemini-1.5-pro"])
94
 
95
  # Botón para generar el texto
96
- if st.button("Generar texto"):
97
  try:
 
98
  generated_text = get_gemini_response(target_audience, product, text_type, length, mood, model_choice)
99
- st.subheader("Texto Generado:")
100
  st.write(generated_text)
101
  except Exception as e:
102
- st.error(f"Error: {e}")
 
86
  with st.sidebar:
87
  st.header("Personaliza tu texto")
88
  target_audience = st.text_input("¿Quién es tu público objetivo?")
89
+ product = st.text_input("¿Qué producto tienes en mente?")
90
+ text_type = st.selectbox("Tipo de texto", ["Historia", "Carta de venta", "Correo", "Landing page"])
91
+ length = st.slider("Número de palabras", min_value=50, max_value=500, value=100)
92
+ mood = st.selectbox("Tono de voz", ["Conversacional", "Formal", "Emocional", "Persuasivo"])
93
+ model_choice = st.selectbox("Modelo", ["gemini-1.5-flash", "gemini-1.5-pro"])
94
 
95
  # Botón para generar el texto
96
+ if st.button("Escribir mi texto"):
97
  try:
98
+ # Obtener la respuesta del modelo
99
  generated_text = get_gemini_response(target_audience, product, text_type, length, mood, model_choice)
100
+ st.write("**Texto generado:**")
101
  st.write(generated_text)
102
  except Exception as e:
103
+ st.error(f"Ocurrió un error: {e}")