Spaces:
Build error
Build error
Update app.py
Browse files
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("
|
| 90 |
-
text_type = st.selectbox("Tipo de texto
|
| 91 |
-
length = st.slider("
|
| 92 |
-
mood = st.selectbox("
|
| 93 |
-
model_choice = st.selectbox("
|
| 94 |
|
| 95 |
# Botón para generar el texto
|
| 96 |
-
if st.button("
|
| 97 |
try:
|
|
|
|
| 98 |
generated_text = get_gemini_response(target_audience, product, text_type, length, mood, model_choice)
|
| 99 |
-
st.
|
| 100 |
st.write(generated_text)
|
| 101 |
except Exception as e:
|
| 102 |
-
st.error(f"
|
|
|
|
| 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}")
|