Update app.py
Browse files
app.py
CHANGED
|
@@ -158,15 +158,6 @@ if 'respuesta_programada' in st.session_state and st.session_state['respuesta_pr
|
|
| 158 |
horas, minutos = divmod(minutos, 60)
|
| 159 |
tiempo_restante_str = f"{horas}h {minutos}m {segundos}s" if horas > 0 else f"{minutos}m {segundos}s"
|
| 160 |
st.info(f"Tiempo restante: {tiempo_restante_str}")
|
| 161 |
-
|
| 162 |
-
# Reproducir la notificaci贸n si el tiempo ha pasado y la notificaci贸n a煤n no se ha reproducido
|
| 163 |
-
if datetime.now() >= respuesta_programada['tiempo_ejecucion'] and not respuesta_programada['notificacion_reproducida']:
|
| 164 |
-
# Reproducir la notificaci贸n
|
| 165 |
-
with open("notificacion.mp3", "rb") as audio_file:
|
| 166 |
-
st.audio(audio_file.read(), format="audio/mp3")
|
| 167 |
-
st.session_state['respuesta_programada']['notificacion_reproducida'] = True # Marcar que se ha reproducido
|
| 168 |
-
|
| 169 |
-
# Generar la respuesta si ya se ha reproducido la notificaci贸n y no se ha generado el audio
|
| 170 |
if st.session_state['respuesta_programada']['notificacion_reproducida'] and st.session_state['respuesta_programada']['audio_file_path'] is None:
|
| 171 |
respuesta, audio_file_path = obtener_respuesta_groq(respuesta_programada['pregunta'])
|
| 172 |
|
|
|
|
| 158 |
horas, minutos = divmod(minutos, 60)
|
| 159 |
tiempo_restante_str = f"{horas}h {minutos}m {segundos}s" if horas > 0 else f"{minutos}m {segundos}s"
|
| 160 |
st.info(f"Tiempo restante: {tiempo_restante_str}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
if st.session_state['respuesta_programada']['notificacion_reproducida'] and st.session_state['respuesta_programada']['audio_file_path'] is None:
|
| 162 |
respuesta, audio_file_path = obtener_respuesta_groq(respuesta_programada['pregunta'])
|
| 163 |
|