JeCabrera commited on
Commit
85052d2
·
verified ·
1 Parent(s): 34cb5f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -74,6 +74,9 @@ st.set_page_config(page_title="Generador de Historias", page_icon=":pencil:", la
74
  st.markdown("<h1 style='text-align: center;'>Generador de Historias</h1>", unsafe_allow_html=True)
75
  st.markdown("<h3 style='text-align: center;'>Crea historias persuasivas con inteligencia artificial, diseñadas para conectar emocionalmente con tu audiencia.</h3>", unsafe_allow_html=True)
76
 
 
 
 
77
  # Crear las columnas para el diseño (40% para la izquierda, 60% para la derecha)
78
  col1, col2 = st.columns([2, 3])
79
 
@@ -88,16 +91,7 @@ with col1:
88
  mood = st.selectbox("Tono de la historia:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Romántico"])
89
  length = st.slider("Longitud de la historia (palabras):", min_value=50, max_value=150, value=100, step=10)
90
 
91
- # Crear acordeón con las tres fórmulas
92
- with st.expander("P.A.S.A."):
93
- # Entrada adicional si es necesario para P.A.S.A.
94
- pass
95
-
96
- with st.expander("A.D.P."):
97
- # Entrada adicional si es necesario para A.D.P.
98
- pass
99
-
100
- with st.expander("G.H.A."):
101
  story_topic = st.text_area("De qué quieres que trate la historia", placeholder="Explica si hay algo específico sobre lo que te gustaría contar (puede ser una vivencia personal, película, cuento, personaje ficticio, etc.).")
102
 
103
  # Botón para generar contenido
@@ -108,11 +102,11 @@ with col2:
108
  if submit:
109
  if target_audience and product and action:
110
  try:
111
- if "P.A.S.A." in st.expander("P.A.S.A.").expanded:
112
  response = get_pasa_response(target_audience, product, action, mood, length)
113
- elif "A.D.P." in st.expander("A.D.P.").expanded:
114
  response = get_adp_response(target_audience, product, action, mood, length)
115
- elif "G.H.A." in st.expander("G.H.A.").expanded:
116
  if story_topic:
117
  response = get_gha_response(target_audience, product, action, mood, length, story_topic)
118
  else:
 
74
  st.markdown("<h1 style='text-align: center;'>Generador de Historias</h1>", unsafe_allow_html=True)
75
  st.markdown("<h3 style='text-align: center;'>Crea historias persuasivas con inteligencia artificial, diseñadas para conectar emocionalmente con tu audiencia.</h3>", unsafe_allow_html=True)
76
 
77
+ # Crear el selector para elegir la fórmula
78
+ formula = st.radio("Selecciona la fórmula para generar tu historia:", ["P.A.S.A.", "A.D.P.", "G.H.A."])
79
+
80
  # Crear las columnas para el diseño (40% para la izquierda, 60% para la derecha)
81
  col1, col2 = st.columns([2, 3])
82
 
 
91
  mood = st.selectbox("Tono de la historia:", ["Emocional", "Triste", "Feliz", "Horror", "Comedia", "Romántico"])
92
  length = st.slider("Longitud de la historia (palabras):", min_value=50, max_value=150, value=100, step=10)
93
 
94
+ if formula == "G.H.A.":
 
 
 
 
 
 
 
 
 
95
  story_topic = st.text_area("De qué quieres que trate la historia", placeholder="Explica si hay algo específico sobre lo que te gustaría contar (puede ser una vivencia personal, película, cuento, personaje ficticio, etc.).")
96
 
97
  # Botón para generar contenido
 
102
  if submit:
103
  if target_audience and product and action:
104
  try:
105
+ if formula == "P.A.S.A.":
106
  response = get_pasa_response(target_audience, product, action, mood, length)
107
+ elif formula == "A.D.P.":
108
  response = get_adp_response(target_audience, product, action, mood, length)
109
+ elif formula == "G.H.A.":
110
  if story_topic:
111
  response = get_gha_response(target_audience, product, action, mood, length, story_topic)
112
  else: