Josedcape commited on
Commit
6ae5988
·
verified ·
1 Parent(s): 140b530

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -99,15 +99,25 @@ if st.button("Programar Recordatorio con Galatea (Groq)"):
99
  st.warning("Por favor, ingresa un recordatorio.")
100
 
101
  # Iniciar el scheduler en un hilo separado
102
- def run_scheduler():
103
- while True:
104
- schedule.run_pending()
105
- time.sleep(1)
106
-
107
  if 'scheduler_thread' not in st.session_state:
 
 
 
 
 
108
  st.session_state.scheduler_thread = threading.Thread(target=run_scheduler)
109
  st.session_state.scheduler_thread.start()
110
 
111
- # Autorefresh cada 30 segundos
112
- st.experimental_rerun()
 
 
 
 
 
 
 
 
 
 
113
 
 
99
  st.warning("Por favor, ingresa un recordatorio.")
100
 
101
  # Iniciar el scheduler en un hilo separado
 
 
 
 
 
102
  if 'scheduler_thread' not in st.session_state:
103
+ def run_scheduler():
104
+ while True:
105
+ schedule.run_pending()
106
+ time.sleep(1)
107
+
108
  st.session_state.scheduler_thread = threading.Thread(target=run_scheduler)
109
  st.session_state.scheduler_thread.start()
110
 
111
+ # Mostrar el estado de los recordatorios
112
+ if 'respuestas_anteriores' not in st.session_state:
113
+ st.session_state.respuestas_anteriores = []
114
+
115
+ # Mostrar mensajes anteriores
116
+ if st.session_state.respuestas_anteriores:
117
+ st.write("Últimos recordatorios programados:")
118
+ for respuesta in st.session_state.respuestas_anteriores:
119
+ st.write(respuesta)
120
+
121
+ # Autorefresh cada 30 segundos (puedes ajustar este intervalo)
122
+ st.autorefresh(interval=30000, key="datarefresh")
123