Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -185,9 +185,10 @@ with col1:
|
|
185 |
generate_button = st.button("Generar Ideas Creativas")
|
186 |
|
187 |
with st.expander("Opciones avanzadas"):
|
188 |
-
# Replace
|
189 |
st.write("Tono de voz de la marca (opcional)")
|
190 |
tone_options = {
|
|
|
191 |
"Profesional": "A formal and expert tone that conveys authority and knowledge.",
|
192 |
"Serio": "A direct and sober tone, focused on facts and results.",
|
193 |
"Divertido": "A cheerful and positive tone that connects in a friendly way.",
|
@@ -195,17 +196,23 @@ with col1:
|
|
195 |
"Humorístico": "A tone that uses humor to connect and entertain."
|
196 |
}
|
197 |
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
204 |
|
205 |
-
#
|
206 |
-
if selected_tone:
|
|
|
|
|
207 |
st.session_state.selected_tone = selected_tone
|
208 |
-
|
|
|
|
|
|
|
209 |
|
210 |
# Use the stored tone or empty string
|
211 |
tone_of_voice = st.session_state.get("selected_tone", "")
|
|
|
185 |
generate_button = st.button("Generar Ideas Creativas")
|
186 |
|
187 |
with st.expander("Opciones avanzadas"):
|
188 |
+
# Replace nested expanders with a selectbox for tone selection
|
189 |
st.write("Tono de voz de la marca (opcional)")
|
190 |
tone_options = {
|
191 |
+
"Ninguno": "Sin tono específico",
|
192 |
"Profesional": "A formal and expert tone that conveys authority and knowledge.",
|
193 |
"Serio": "A direct and sober tone, focused on facts and results.",
|
194 |
"Divertido": "A cheerful and positive tone that connects in a friendly way.",
|
|
|
196 |
"Humorístico": "A tone that uses humor to connect and entertain."
|
197 |
}
|
198 |
|
199 |
+
# Use selectbox for tone selection
|
200 |
+
selected_tone = st.selectbox(
|
201 |
+
"Selecciona un tono:",
|
202 |
+
options=list(tone_options.keys()),
|
203 |
+
index=0,
|
204 |
+
key="tone_selectbox"
|
205 |
+
)
|
206 |
|
207 |
+
# Display the description of the selected tone
|
208 |
+
if selected_tone != "Ninguno":
|
209 |
+
st.info(tone_options[selected_tone])
|
210 |
+
# Store the selected tone
|
211 |
st.session_state.selected_tone = selected_tone
|
212 |
+
else:
|
213 |
+
# Clear any previously selected tone
|
214 |
+
if "selected_tone" in st.session_state:
|
215 |
+
del st.session_state.selected_tone
|
216 |
|
217 |
# Use the stored tone or empty string
|
218 |
tone_of_voice = st.session_state.get("selected_tone", "")
|